Choose a version:
50% The original file has 1112124 bytes (1,086.1k) and is available from the project website.
There you can find the official minified version, too, which brings down the size to 551410 bytes (538.5k, 50%).

After GZIP compression these minified files vary in size:
cdnjs
  138855 bytes (135.6k)
CDN
unpkg
  137668 bytes (134.4k)
CDN
gzip -6 (default)
  137423 bytes (134.2k)
local copy
jsdelivr
  137273 bytes (134.1k)
CDN
gzip -9
  136908 bytes (133.7k)
local copy
7zip -mx=9 -tgzip
  132292 bytes (129.2k)
local copy
libdeflate -12
  132231 bytes (129.1k)
local copy
zultra
  132042 bytes (128.9k)
local copy
pigz -11 -n
  131838 bytes (128.7k)
local copy
kzip -s0 -rn -b0
  131833 bytes (128.7k)
local copy
Zopfli
  131707 bytes (128.6k)
local copy
Zopfli (defluff)
  131705 bytes (128.6k)
local copy

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

You will automatically get the smallest ThreeJS 99 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 5566 bytes by using my ThreeJS 99 Zopfli version instead of the best available CDN (4.23% smaller than jsdelivr, 131707 vs. 137273 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 --mls4096 --bsr18 --lazy --ohh

(found December 5, 2018)
Description Value Parameter
iterations 1000000  --i1000000
maximum blocks 8  --mb8
maximum length score 4096  --mls4096
block splitting recursion 18  --bsr18
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 2 more bytes (131705 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/r99/build/three.min.js --location | md5sum
87d6318ab6cc24f8af79d4375bbe0797  -
curl --silent --compressed https://minime.stephan-brumme.com/files/threejs/three-r99.min.zopfli.js.gz | md5sum
87d6318ab6cc24f8af79d4375bbe0797  -

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

All listed CDNs deliver identical contents:
CDN Size (compressed) MD5 (uncompressed) Timestamp
cdnjs 138855 bytes 87d6318ab6cc24f8af79d4375bbe0797 (invalid)
unpkg 137668 bytes 87d6318ab6cc24f8af79d4375bbe0797 (invalid)
jsdelivr 137273 bytes 87d6318ab6cc24f8af79d4375bbe0797 December 3, 2018 @ 15:05

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

Other Versions

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

148, 147, 146, 145, 144, 143, 142, 141, 140, 139, 138, 137, 136, 135, 134, 133, 132, 131, 130, 129, 128, 127, 126, 125, 124, 123, 122, 121, 120, 119, 118, 117, 116, 115, 114, 113, 112, 111, 110, 109, 108, 107, 106, 105, 104, 103, 102, 101, 100, 99, 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, 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
131707 bytes -4 bytes zopfli --i1000000 --mls4096 --bsr18 --lazy --ohh December 5, 2018 @ 00:04
131711 bytes -6 bytes zopfli --i100000 --mls4096 --bsr18 --lazy --ohh December 3, 2018 @ 21:23
131717 bytes -11 bytes zopfli --i10000 --mls4096 --bsr18 --lazy --ohh December 3, 2018 @ 17:43
131728 bytes -6 bytes zopfli --i1000 --mls4096 --bsr18 --lazy --ohh December 3, 2018 @ 15:33
131734 bytes -24 bytes zopfli --i1000 --mls4096 --bsr15 --lazy --ohh December 3, 2018 @ 15:33
131758 bytes zopfli --i100 --mls4096 --bsr15 --lazy --ohh December 3, 2018 @ 15:21

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:48.

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
131942 131944 131960 131964 131978 131968 131958 132102 131954 131955 131985 131974 131965 131935 131953
132018 132005 131972 132040 132017 131783 132025 131858 132036 132032 131917 132013 131945 131880 131928
131862 132056 131881 132037 132027 131965 131978 131790 131889 132053 132033 131765 131981 131806 131779
131763 132012 131979 132003 131857 132011 132017 131837 131845 132045 131989 131732 131824 132006 131960
131986 131983 131988 132007 132002 131968 132001 131823 132032 132029 131866 131923 131831 131811 131947
131999 131999 131986 131989 131980 131984 131854 131811 131782 131979 131756 131738 131996 131980 131955
132004 132012 131989 131990 131963 131960 131959 131825 131930 131925 131749 131736 131742 132006 131952
131972 131964 132012 131992 131960 131961 131979 131836 131980 131975 131747 131729 131959 131967 131953
132007 131973 131990 131973 131985 131975 131963 131848 132043 131974 132029 131950 131998 131966 131950
131983 131977 131987 132016 131972 131785 131982 131827 132017 132012 131741 131784 131987 131797 131969
131985 132014 131981 132001 131961 131966 131849 131828 131796 132009 132048 131999 132028 131995 131952
131979 131996 131979 131988 132027 131976 132021 131814 131991 132007 131744 131723 132040 132005 131904
131994 131997 131979 131979 131990 131792 131831 131835 131814 132002 132021 131967 132007 131812 131919
131994 131996 131981 131984 132005 131801 131976 131819 131786 131999 132001 131760 131965 132001 131951
131995 131999 131975 131982 132005 131792 131988 132024 131974 132021 131787 131707 131964 131983 131901
132012 131992 131968 131968 131999 131978 131975 131822 131818 132007 131743 131750 131963 132021 131950
132036 132009 131986 131988 131992 131970 131857 131827 131984 132002 131977 131968 131785 132010 131926
131992 131999 131968 131973 131954 131965 131957 131836 131976 132007 132015 131750 131959 131792 131905
131995 132000 131983 131979 132007 131983 131991 131833 131973 132007 131830 131713 131737 131796 131952
131988 131989 131969 131968 131790 131793 132011 131833 131977 131968 131740 131739 131969 132000 131953
131992 131995 131970 131970 132005 131790 131958 131827 131973 132004 131747 131730 131962 131983 131947
131971 131960 131979 131982 132026 131789 131980 131882 132001 131925 131748 131733 131995 131801 131904
131983 131972 131980 131981 132001 131966 131976 131832 131984 132000 131776 131777 131966 132001 131905

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 131758 bytes 100%
1,000 131728 bytes -30 bytes 100%
10,000 131717 bytes -11 bytes 100%
100,000 131711 bytes -6 bytes 0.58%
1,000,000 131707 bytes -4 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
131833 bytes +126 bytes (+0.10%)
132469 bytes +762 bytes (+0.58%) +636 bytes
132428 bytes +721 bytes (+0.55%) +595 bytes
132274 bytes +567 bytes (+0.43%) +441 bytes
132149 bytes +442 bytes (+0.34%) +316 bytes
131979 bytes +272 bytes (+0.21%) +146 bytes
131982 bytes +275 bytes (+0.21%) +149 bytes
131933 bytes +226 bytes (+0.17%) +100 bytes
131896 bytes +189 bytes (+0.14%) +63 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 - for example, your browser actually supports it !
Algorithm Program Parameters Size Compared To Best Zopfli
ZPAQ (Wikipedia) zpaq zpaq -method 69 88743 bytes -42964 bytes (-32.62%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 102171 bytes -29536 bytes (-22.43%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 105756 bytes -25951 bytes (-19.70%)
Brotli (Wikipedia) brotli brotli -q 11 112111 bytes -19596 bytes (-14.88%)
LZMA2 (Wikipedia) xz xz -9 112892 bytes -18815 bytes (-14.29%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 117571 bytes -14136 bytes (-10.73%)
Zstandard (Wikipedia) zstd zstd -19 118839 bytes -12868 bytes (-9.77%)

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.