Choose a version:
49% The original file has 1043973 bytes (1,019.5k) and is available from the project website.
There you can find the official minified version, too, which brings down the size to 511098 bytes (499.1k, 49%).

After GZIP compression these minified files vary in size:
gzip -6 (default)
  129914 bytes (126.9k)
local copy
jsdelivr
  129865 bytes (126.8k)
CDN
gzip -9
  129486 bytes (126.5k)
local copy
7zip -mx=9 -tgzip
  124949 bytes (122.0k)
local copy
libdeflate -12
  124928 bytes (122.0k)
local copy
kzip -s0 -rn -b0
  124698 bytes (121.8k)
local copy
pigz -11 -n
  124689 bytes (121.8k)
local copy
Zopfli
  124489 bytes (121.6k)
local copy
Zopfli (defluff)
  124483 bytes (121.6k)
local copy

perma-link to the smallest file on my server:
http://minime.stephan-brumme.com/files/threejs/three-r87.min.js

You will automatically get the smallest ThreeJS 87 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 5376 bytes by using my ThreeJS 87 Zopfli version instead of the best available CDN (4.32% smaller than jsdelivr, 124489 vs. 129865 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 --mls2048 --bsr16 --lazy --ohh

(found August 28, 2017)
Description Value Parameter
iterations 1000000  --i1000000
maximum blocks 8  --mb8
maximum length score 2048  --mls2048
block splitting recursion 16  --bsr16
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 6 more bytes (124483 bytes).

Verify file integrity

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

MD5:
curl --silent --compressed https://raw.githubusercontent.com/mrdoob/three.js/r87/build/three.min.js --location | md5sum
61269fcecc3ab8c56cc34708403c8138  -
curl --silent --compressed http://minime.stephan-brumme.com/files/threejs/three-r87.min.zopfli.js.gz | md5sum
61269fcecc3ab8c56cc34708403c8138  -

SHA1:
curl --silent --compressed https://raw.githubusercontent.com/mrdoob/three.js/r87/build/three.min.js --location | sha1sum
f9b95e1f33215d213943fd50cde00c0aa901d834  -
curl --silent --compressed http://minime.stephan-brumme.com/files/threejs/three-r87.min.zopfli.js.gz | sha1sum
f9b95e1f33215d213943fd50cde00c0aa901d834  -

CDN Size (compressed) MD5 (uncompressed) Comment / Diff Timestamp
jsdelivr 129865 bytes cf699f9a11c6d3f3171428919b427e13 < g.map[p],void 0===t&&(t=new Ie(p),p=g,g=t,p.seq.push(g),p. [...]
> g.map[p],void 0===t&&(t=new Ie(p),p=g,g=t,p.seq.push(g),p. [...]
< "scale");p=b.getUniformLocation(A,"rotation");t=b.getUnifo [...]
< Y.matrixWorld.elements[13],Y.matrixWorld.elements[14]),v.a [...]
> "scale");p=b.getUniformLocation(A,"rotation");t=b.getUnifo [...]
> Y.matrixWorld.elements[13],Y.matrixWorld.elements[14]),v.a [...]
< C.scale&&(ga.x=C.x,ga.y=C.y,ga.z=C.z,J=C.size*C.scale/la.w [...]
< c,d,e,f,g,h,k);this.needsUpdate=!0}function Lf(a,b,c,d,e){ [...]
> C.scale&&(ga.x=C.x,ga.y=C.y,ga.z=C.z,J=C.size*C.scale/la.w [...]
> c,d,e,f,g,h,k);this.needsUpdate=!0}function Lf(a,b,c,d,e){ [...]
[...]
November 9, 2017 @ 11:40

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

Other Versions

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

88, 87, 86, 85, 84, 83, 82, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68, 67, 66, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50

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

Changelog

Best Zopfli parameters so far:
Size Improvement Parameters Found
124489 bytes -5 bytes zopfli --i1000000 --mls2048 --bsr16 --lazy --ohh August 28, 2017 @ 08:24
124494 bytes -7 bytes zopfli --i100000 --mls2048 --bsr16 --lazy --ohh August 26, 2017 @ 22:47
124501 bytes -6 bytes zopfli --i10000 --mls2048 --bsr16 --lazy --ohh August 25, 2017 @ 16:54
124507 bytes -5 bytes zopfli --i1000 --mls2048 --bsr16 --lazy --ohh August 25, 2017 @ 12:48
124512 bytes -29 bytes zopfli --i1000 --mls2048 --bsr7 --lazy --ohh August 25, 2017 @ 12:48
124541 bytes -2 bytes zopfli --i1000 --mls2048 --bsr13 --lazy --ohh August 25, 2017 @ 12:47
124543 bytes zopfli --i100 --mls2048 --bsr16 --lazy --ohh August 25, 2017 @ 12:15

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

Most recent activity on November 9, 2017 @ 11:40.

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
124842 124789 124750 124808 124795 124775 124811 124814 124684 124722 124705 124732 124714 124708 124738
124678 124686 124675 124727 124668 124667 124714 124637 124641 124642 124678 124675 124655 124655 124663
124700 124703 124866 124661 124658 124707 124622 124705 124629 124621 124681 124682 124647 124671 124664
124682 124639 124688 124630 124637 124640 124643 124678 124655 124656 124495 124625 124649 124670 124624
124698 124688 124688 124711 124717 124665 124663 124668 124640 124663 124603 124631 124652 124665 124652
124752 124761 124745 124665 124694 124670 124701 124686 124624 124632 124669 124676 124649 124640 124653
124671 124677 124669 124705 124713 124698 124662 124655 124660 124632 124551 124653 124630 124630 124644
124646 124721 124677 124653 124694 124675 124671 124597 124628 124663 124646 124675 124647 124649 124664
124677 124679 124664 124662 124664 124658 124658 124657 124623 124664 124538 124545 124649 124645 124656
124681 124712 124676 124697 124665 124630 124625 124653 124649 124625 124534 124667 124649 124630 124656
124675 124673 124691 124698 124706 124662 124670 124653 124656 124697 124529 124620 124655 124650 124628
124671 124680 124625 124689 124661 124704 124657 124655 124659 124701 124650 124624 124641 124661 124658
124638 124712 124689 124702 124678 124677 124660 124657 124621 124621 124489 124675 124646 124671 124653
124683 124678 124681 124689 124672 124710 124696 124671 124630 124662 124664 124670 124662 124665 124659
124673 124676 124673 124676 124660 124703 124705 124678 124628 124664 124534 124624 124647 124674 124660
124706 124709 124679 124662 124707 124676 124618 124668 124672 124664 124655 124675 124645 124639 124622
124645 124649 124670 124667 124656 124638 124705 124657 124637 124637 124534 124673 124647 124639 124653
124680 124677 124690 124696 124692 124708 124679 124659 124633 124624 124534 124626 124647 124631 124624
124683 124676 124695 124699 124664 124710 124704 124627 124627 124702 124534 124627 124647 124628 124663
124682 124678 124676 124673 124670 124666 124660 124653 124646 124662 124646 124655 124644 124629 124669
124671 124673 124658 124622 124658 124706 124627 124620 124654 124663 124545 124626 124642 124646 124650
124670 124674 124673 124699 124665 124677 124676 124653 124620 124699 124644 124625 124643 124623 124621
124674 124674 124669 124696 124717 124707 124658 124658 124655 124622 124538 124673 124648 124638 124629

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 124543 bytes 100%
1,000 124507 bytes -36 bytes 100%
10,000 124501 bytes -6 bytes 100%
100,000 124494 bytes -7 bytes 0.58%
1,000,000 124489 bytes -5 bytes 0.29%
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
124698 bytes +209 bytes (+0.17%)
125181 bytes +692 bytes (+0.56%) +483 bytes
125179 bytes +690 bytes (+0.55%) +481 bytes
124937 bytes +448 bytes (+0.36%) +239 bytes
124871 bytes +382 bytes (+0.31%) +173 bytes
124740 bytes +251 bytes (+0.20%) +42 bytes
124780 bytes +291 bytes (+0.23%) +82 bytes
124727 bytes +238 bytes (+0.19%) +29 bytes
124708 bytes +219 bytes (+0.18%) +10 bytes

Non-DEFLATE Algorithms

Archivers based on completely different compression algorithms often produce superior results.
Unfortunately, browsers only support gzip compression at the moment.
Algorithm Program Parameters Size Compared To Best Zopfli
ZPAQ (Wikipedia) zpaq zpaq -method 69 84423 bytes -40066 bytes (-32.18%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 97006 bytes -27483 bytes (-22.08%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 102881 bytes -21608 bytes (-17.36%)
Brotli (Wikipedia) brotli brotli -q 11 106759 bytes -17730 bytes (-14.24%)
LZMA2 (Wikipedia) xz xz -9 107220 bytes -17269 bytes (-13.87%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 111227 bytes -13262 bytes (-10.65%)
ZSTD (Wikipedia) zstd zstd -19 113387 bytes -11102 bytes (-8.92%)

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 2017.
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