Choose a version:
13% The original file has 544098 bytes (531.3k) and is available from the project website.
There you can find the official minified version, too, which brings down the size to 73015 bytes (71.3k, 13%).

After GZIP compression these minified files vary in size:
unpkg
  29517 bytes (28.8k)
CDN
Boot
  26035 bytes (25.4k)
CDN
cdnjs
  26035 bytes (25.4k)
CDN
gzip -6 (default)
  25949 bytes (25.3k)
local copy
gzip -9
  25900 bytes (25.3k)
local copy
libdeflate -12
  25088 bytes (24.5k)
local copy
7zip -mx=9 -tgzip
  24958 bytes (24.4k)
local copy
zultra
  24916 bytes (24.3k)
local copy
pigz -11 -n
  24835 bytes (24.3k)
local copy
kzip -s0 -rn -b6
  24796 bytes (24.2k)
local copy
Zopfli
  24739 bytes (24.2k)
local copy
Zopfli (defluff)
  24738 bytes (24.2k)
local copy

perma-link to the smallest file on my server:
http://minime.stephan-brumme.com/files/lodash/lodash-4.17.21.min.js (or via HTTPS)

You will automatically get the smallest lodash 4.17.21 file, ETag caching is available and
if your browser doesn't support GZIP decompression then the uncompressed version will be sent.

Currently best Zopfli settings

Save 1296 bytes by using my lodash 4.17.21 Zopfli version instead of the best available CDN (5.24% smaller than cdnjs, 24739 vs. 26035 bytes):
You can use my super-compressed files for whatever purpose you like as long as you respect the library's original license agreement.
There are no restrictions from my side - but please avoid hot-linking if you run a high-traffic website.

These command-line settings yielded the best compression ratio so far (Linux version of zopfli-krzymod):
zopfli --i1000000 --mb8 --mls2 --bsr19 --lazy --ohh

(found February 23, 2021)
Description Value Parameter
iterations 1000000  --i1000000
maximum blocks 8  --mb8
maximum length score 2  --mls2
block splitting recursion 19  --bsr19
lazy matching in LZ77 yes  --lazy
optimized Huffman headers yes  --ohh
initial random W for iterations 1  --rw1
initial random Z for iterations 2  --rz2

Even Smaller Files Thanks To Defluff

Zopfli's output can be further optimized by the defluff tool.
In this particular case, defluff saves 1 more byte (24738 bytes).

Verify file integrity

After decompression, my uncompressed files are identical to the original ones:

MD5:
curl --silent --compressed https://raw.githubusercontent.com/lodash/lodash/4.17.21/dist/lodash.min.js --location | md5sum
9becc40fb1d85d21d0ca38e2f7069511  -
curl --silent --compressed https://minime.stephan-brumme.com/files/lodash/lodash-4.17.21.min.zopfli.js.gz | md5sum
9becc40fb1d85d21d0ca38e2f7069511  -

SHA1:
curl --silent --compressed https://raw.githubusercontent.com/lodash/lodash/4.17.21/dist/lodash.min.js --location | sha1sum
ae854b04025db8b7f48fdd6dedf41e77eae44394  -
curl --silent --compressed https://minime.stephan-brumme.com/files/lodash/lodash-4.17.21.min.zopfli.js.gz | sha1sum
ae854b04025db8b7f48fdd6dedf41e77eae44394  -

All listed CDNs deliver identical contents:
CDN Size (compressed) MD5 (uncompressed) Timestamp
unpkg 29517 bytes 9becc40fb1d85d21d0ca38e2f7069511 (invalid)
Boot 26035 bytes 9becc40fb1d85d21d0ca38e2f7069511 (invalid)
cdnjs 26035 bytes 9becc40fb1d85d21d0ca38e2f7069511 (invalid)

Note: only the MD5 hashes are shown to keep things simple.

Other Versions

Available lodash versions at minime.stephan-brumme.com:

4.17.21, 4.17.20, 4.17.19, 4.17.18, 4.17.17, 4.17.16, 4.17.15, 4.17.14, 4.17.13, 4.17.12, 4.17.11, 4.17.10, 4.17.9, 4.17.5, 4.17.4, 4.17.3, 4.17.2, 4.17.1, 4.17.0, 4.16.6, 4.16.5, 4.16.4, 4.16.3, 4.16.2, 4.16.1, 4.16.0, 4.15.0, 4.14.2, 4.14.1, 4.14.0, 4.13.1, 4.13.0, 4.12.0, 4.11.2, 4.11.1, 4.11.0, 4.10.0,
4.9.0, 4.8.2, 4.8.1, 4.8.0, 4.7.0, 4.6.1, 4.6.0, 4.5.1, 4.5.0, 4.4.0, 4.3.0, 4.2.1, 4.2.0, 4.1.0, 4.0.1, 4.0.0

The project site contains an overview how well these versions were compressed.
Other interesting projects are AngularJS, BackboneJS, Bootstrap, D3, Dojo, Ember, jQuery, Knockout, React, Socket.IO, ThreeJS, UnderscoreJS and Vue.

Changelog

Best Zopfli parameters so far:
Size Improvement Parameters Found
24739 bytes -2 bytes zopfli --i1000000 --mls2 --bsr19 --lazy --ohh February 23, 2021 @ 15:30
24741 bytes -2 bytes zopfli --i100000 --mls2 --bsr19 --lazy --ohh February 22, 2021 @ 19:37
24743 bytes -5 bytes zopfli --i10000 --mls2 --bsr19 --lazy --ohh February 22, 2021 @ 19:09
24748 bytes -2 bytes zopfli --i1000 --mls2 --bsr19 --lazy --ohh February 22, 2021 @ 19:05
24750 bytes -8 bytes zopfli --i1000 --mls8 --bsr25 --lazy --ohh February 22, 2021 @ 19:05
24758 bytes zopfli --i100 --mls2 --bsr19 --lazy --ohh February 22, 2021 @ 19:04

If there are multiple parameter sets yielding the same compressed size, only the first one found is shown.

Most recent activity on February 23, 2021 @ 16:58.

Heatmaps

This Zopfli heatmap visualizes how compression changes when modifying the --bsr and --mls parameter.
Cell's contents is the best filesize achieved (in bytes, hover with mouse over cells to see number of iterations).

Good parameters are green, bad are red. The best and worst are bold as well.
The brightness of the blue background color indicates how many iterations were processed:
10,000, 100,000 or 1,000,000.
bsr \ mls
2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768
bsr \ mls
2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768
24802 24803 24798 24846 24848 24835 24846 24896 24852 24853 24869 24880 24858 24829 24837
24771 24784 24774 24787 24806 24777 24780 24791 24793 24781 24791 24772 24772 24784 24794
24800 24792 24803 24762 24761 24812 24818 24814 24750 24761 24826 24753 24752 24766 24772
24770 24775 24799 24792 24819 24817 24812 24811 24763 24819 24815 24835 24814 24829 24827
24782 24791 24778 24792 24813 24824 24811 24807 24821 24814 24829 24833 24784 24815 24783
24786 24812 24778 24780 24823 24806 24815 24818 24813 24808 24815 24830 24809 24819 24813
24788 24795 24774 24791 24786 24807 24812 24803 24751 24758 24823 24830 24764 24817 24748
24759 24777 24773 24760 24754 24764 24767 24750 24768 24759 24764 24785 24757 24762 24752
24772 24771 24761 24766 24763 24779 24757 24751 24772 24759 24792 24785 24754 24763 24755
24775 24790 24789 24764 24755 24806 24809 24815 24760 24807 24808 24825 24766 24819 24772
24765 24789 24776 24776 24828 24806 24817 24805 24750 24815 24812 24779 24763 24826 24816
24783 24783 24779 24784 24769 24768 24811 24803 24760 24756 24764 24816 24768 24760 24761
24775 24775 24799 24784 24820 24755 24812 24808 24813 24814 24813 24836 24807 24818 24820
24771 24762 24762 24762 24759 24756 24770 24750 24758 24759 24806 24816 24763 24758 24754
24762 24756 24756 24749 24748 24756 24770 24750 24767 24763 24766 24784 24764 24762 24750
24739 24766 24759 24754 24749 24750 24808 24749 24759 24759 24757 24826 24757 24762 24756
24789 24792 24781 24760 24775 24742 24818 24802 24767 24760 24817 24810 24767 24762 24772
24771 24773 24782 24763 24821 24806 24814 24766 24749 24758 24810 24822 24764 24818 24778
24786 24786 24779 24772 24826 24807 24807 24802 24749 24756 24806 24820 24807 24819 24816
24763 24782 24754 24753 24756 24755 24760 24751 24747 24753 24815 24800 24760 24767 24753
24768 24754 24740 24762 24763 24776 24764 24760 24758 24764 24763 24769 24759 24764 24751
24752 24777 24749 24755 24753 24756 24771 24755 24750 24760 24768 24788 24769 24818 24775
24783 24776 24758 24765 24756 24758 24818 24750 24751 24758 24761 24833 24824 24763 24755

Due to the Monte Carlo design of my search algorithm, not all parameters have reached the same number of iterations yet:
Iterations Min. Bytes Reduction Coverage
100 24758 bytes 100%
1,000 24748 bytes -10 bytes 100%
10,000 24743 bytes -5 bytes 100%
100,000 24741 bytes -2 bytes 0.87%
1,000,000 24739 bytes -2 bytes 0.58%
10,000,000

KZIP has far less options available for tuning/optimization. I only played around with the number of blocks (parameter -n):
Blocks Min. Bytes Compared To Best Zopfli Compared To Best KZIP
24840 bytes +101 bytes (+0.41%) +44 bytes
25091 bytes +352 bytes (+1.42%) +295 bytes
24948 bytes +209 bytes (+0.84%) +152 bytes
24883 bytes +144 bytes (+0.58%) +87 bytes
24843 bytes +104 bytes (+0.42%) +47 bytes
24833 bytes +94 bytes (+0.38%) +37 bytes
24796 bytes +57 bytes (+0.23%)
24812 bytes +73 bytes (+0.30%) +16 bytes
24827 bytes +88 bytes (+0.36%) +31 bytes

Non-DEFLATE Algorithms

Archivers based on completely different compression algorithms often produce superior results.
Unfortunately, browsers only support gzip compression at the moment.
However, support for Brotli is constantly growing - but your browser doesn't support it.
Algorithm Program Parameters Size Compared To Best Zopfli
ZPAQ (Wikipedia) zpaq zpaq -method 69 20800 bytes -3939 bytes (-15.92%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 21904 bytes -2835 bytes (-11.46%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 21980 bytes -2759 bytes (-11.15%)
Brotli (Wikipedia) brotli brotli -q 11 23015 bytes -1724 bytes (-6.97%)
LZMA2 (Wikipedia) xz xz -9 23488 bytes -1251 bytes (-5.06%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 24286 bytes -453 bytes (-1.83%)
Zstandard (Wikipedia) zstd zstd -19 24503 bytes -236 bytes (-0.95%)

Detailled Analysis

I wrote a DEFLATE decoder in Javascript. Click the button below to start a client-side analysis of the smallest gzipped files (may take a second):


Notes: pigz is a fast open source multi-threaded implementation of gzip written by one of the original authors of gzip.
However, when using compression level 11, pigz actually switches to the slower Zopfli algorithm and isn't multi-threaded anymore.
KrzyMOD's extensions to Zopfli offer the highest level of configuration and is therefore used for my brute-force search.
Ken Silverman wrote the closed-source KZIP compression program and Jonathon Fowler ported it to Linux.
Defluff was created by Joachim Henke; DeflOpt is a tool by Ben Jos Walbeehm.

website made by Stephan Brumme in 2015 and still improving in 2024.
all timestamps are displayed in central european time. see my changelog.
no flash, not even images or external css files - and everything squeezed into a single html file.
which was handsomely compressed before releasing it into the wild internet - obviously.

please visit my homepage and my blog, too.
email: minime (at) stephan-brumme.com

All trademarks are property of their respective owners. You know, the boring legal stuff.