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

After GZIP compression these minified files vary in size:
Boot
  26356 bytes (25.7k)
CDN
cdnjs
  23359 bytes (22.8k)
CDN
gzip -6 (default)
  22300 bytes (21.8k)
local copy
unpkg
  22280 bytes (21.8k)
CDN
gzip -9
  22229 bytes (21.7k)
local copy
jsdelivr
  22226 bytes (21.7k)
CDN
libdeflate -12
  21539 bytes (21.0k)
local copy
7zip -mx=9 -tgzip
  21481 bytes (21.0k)
local copy
zultra
  21472 bytes (21.0k)
local copy
kzip -s0 -rn -b4
  21469 bytes (21.0k)
local copy
pigz -11 -n
  21448 bytes (20.9k)
local copy
Zopfli
  21398 bytes (20.9k)
local copy
Zopfli (defluff)
  21397 bytes (20.9k)
local copy

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

You will automatically get the smallest lodash 4.12.0 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 828 bytes by using my lodash 4.12.0 Zopfli version instead of the best available CDN (3.87% smaller than jsdelivr, 21398 vs. 22226 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 --mls8192 --bsr40 --lazy --ohh

(found May 9, 2016)
Description Value Parameter
iterations 1000000  --i1000000
maximum blocks 8  --mb8
maximum length score 8192  --mls8192
block splitting recursion 40  --bsr40
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 (21397 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.12.0/dist/lodash.min.js --location | md5sum
7043453ddd3d308a365ae4e876dabca9  -
curl --silent --compressed https://minime.stephan-brumme.com/files/lodash/lodash-4.12.0.min.zopfli.js.gz | md5sum
7043453ddd3d308a365ae4e876dabca9  -

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

These CDNs send you the original file:
CDN Size (compressed) MD5 (uncompressed) Timestamp
unpkg 22280 bytes 7043453ddd3d308a365ae4e876dabca9 July 11, 2016 @ 16:46
jsdelivr 22226 bytes 7043453ddd3d308a365ae4e876dabca9 (invalid)

And some CDNs send you a different file:
CDN Size (compressed) MD5 (uncompressed) Comment / Diff Timestamp
Boot 26356 bytes f67dbdd8c7884bdcf960e6d0413b6cae < /**
< * @license
< * lodash lodash.com/license | Underscore.js 1.8.3 undersc [...]
< */
< ;(function(){function t(t,n){return t.set(n[0],n[1]),t}fun [...]
< for(var r=-1,e=t.length;++r<e;)if(!n(t[r],r,t))return fals [...]
< return r}function p(t,n,r,e){var u=t.length;for(e&&u&&(r=t [...]
< return-1}function b(t,n){var r=t?t.length:0;return r?w(t,n [...]
< return t[n]})}function E(t,n){return t.has(n)}function I(t [...]
< return n}function z(t){for(var n,r=[];!(n=t.next()).done;) [...]
[...]
May 9, 2016 @ 19:43
cdnjs 23359 bytes f67dbdd8c7884bdcf960e6d0413b6cae < /**
< * @license
< * lodash lodash.com/license | Underscore.js 1.8.3 undersc [...]
< */
< ;(function(){function t(t,n){return t.set(n[0],n[1]),t}fun [...]
< for(var r=-1,e=t.length;++r<e;)if(!n(t[r],r,t))return fals [...]
< return r}function p(t,n,r,e){var u=t.length;for(e&&u&&(r=t [...]
< return-1}function b(t,n){var r=t?t.length:0;return r?w(t,n [...]
< return t[n]})}function E(t,n){return t.has(n)}function I(t [...]
< return n}function z(t){for(var n,r=[];!(n=t.next()).done;) [...]
[...]
(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
21398 bytes -2 bytes zopfli --i1000000 --mls8192 --bsr40 --lazy --ohh May 9, 2016 @ 20:04
21400 bytes -1 byte zopfli --i100000 --mls512 --bsr4 --lazy --ohh May 9, 2016 @ 18:25
21401 bytes -2 bytes zopfli --i100000 --mls8192 --bsr40 --lazy --ohh May 9, 2016 @ 14:37
21403 bytes -4 bytes zopfli --i10000 --mls8192 --bsr40 --lazy --ohh May 9, 2016 @ 13:52
21407 bytes -1 byte zopfli --i1000 --mls8192 --bsr12 --lazy --ohh May 9, 2016 @ 13:49
21408 bytes -10 bytes zopfli --i1000 --mls8192 --bsr40 --lazy --ohh May 9, 2016 @ 13:48
21418 bytes zopfli --i100 --mls8192 --bsr40 --lazy --ohh May 9, 2016 @ 13:38

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

Most recent activity on July 20, 2020 @ 12:51.

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
21438 21447 21441 21441 21446 21448 21449 21448 21454 21440 21437 21432 21436 21453 21441
21425 21427 21422 21423 21430 21427 21415 21409 21398 21414 21416 21425 21428 21432 21435
21414 21419 21414 21420 21431 21424 21438 21431 21424 21423 21418 21426 21427 21438 21437
21413 21414 21422 21416 21417 21413 21419 21407 21421 21418 21422 21426 21422 21443 21418
21423 21414 21410 21401 21419 21416 21416 21410 21412 21419 21412 21422 21427 21439 21419
21425 21419 21412 21418 21418 21412 21410 21436 21437 21430 21414 21420 21426 21437 21423
21419 21415 21413 21418 21423 21413 21410 21411 21417 21415 21416 21421 21425 21430 21414
21413 21412 21415 21420 21409 21423 21422 21418 21407 21417 21414 21417 21426 21439 21420
21410 21412 21415 21409 21418 21410 21415 21421 21417 21416 21418 21414 21399 21414 21416
21424 21420 21413 21417 21408 21424 21420 21410 21412 21414 21416 21425 21402 21422 21422
21424 21411 21418 21407 21411 21419 21412 21412 21419 21419 21416 21423 21405 21435 21420
21421 21418 21411 21412 21412 21415 21416 21418 21415 21418 21415 21422 21425 21443 21423
21425 21409 21415 21411 21411 21420 21414 21420 21416 21412 21416 21416 21427 21432 21419
21423 21414 21411 21409 21424 21416 21423 21408 21417 21416 21410 21424 21425 21422 21422
21421 21416 21414 21414 21416 21423 21422 21416 21412 21418 21416 21418 21427 21422 21421
21419 21419 21415 21408 21419 21420 21418 21420 21405 21422 21413 21418 21421 21418 21413
21413 21411 21411 21417 21421 21421 21418 21413 21414 21420 21409 21423 21426 21429 21422
21412 21413 21414 21416 21414 21417 21422 21413 21413 21413 21416 21414 21420 21419 21413
21418 21416 21410 21408 21420 21418 21412 21407 21413 21420 21420 21421 21426 21422 21419
21421 21416 21412 21408 21417 21412 21420 21407 21409 21420 21417 21423 21423 21432 21419
21424 21415 21414 21419 21416 21415 21413 21410 21416 21421 21417 21415 21427 21421 21420
21418 21412 21411 21408 21415 21417 21416 21409 21405 21415 21415 21423 21421 21424 21422
21425 21412 21413 21415 21421 21419 21418 21412 21416 21416 21415 21418 21398 21424 21414

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 21418 bytes 100%
1,000 21407 bytes -11 bytes 100%
10,000 21403 bytes -4 bytes 100%
100,000 21400 bytes -3 bytes 1.45%
1,000,000 21398 bytes -2 bytes 0.87%
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
21483 bytes +85 bytes (+0.40%) +14 bytes
21536 bytes +138 bytes (+0.64%) +67 bytes
21470 bytes +72 bytes (+0.34%) +1 byte
21483 bytes +85 bytes (+0.40%) +14 bytes
21469 bytes +71 bytes (+0.33%)
21478 bytes +80 bytes (+0.37%) +9 bytes
21500 bytes +102 bytes (+0.48%) +31 bytes
21524 bytes +126 bytes (+0.59%) +55 bytes
21556 bytes +158 bytes (+0.74%) +87 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 18041 bytes -3357 bytes (-15.69%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 18392 bytes -3006 bytes (-14.05%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 18767 bytes -2631 bytes (-12.30%)
Brotli (Wikipedia) brotli brotli -q 11 20050 bytes -1348 bytes (-6.30%)
LZMA2 (Wikipedia) xz xz -9 20576 bytes -822 bytes (-3.84%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 20692 bytes -706 bytes (-3.30%)
Zstandard (Wikipedia) zstd zstd -19 21266 bytes -132 bytes (-0.62%)

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.