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

After GZIP compression these minified files vary in size:
unpkg
  178816 bytes (174.6k)
CDN
cdnjs
  145153 bytes (141.8k)
CDN
gzip -6 (default)
  143558 bytes (140.2k)
local copy
jsdelivr
  143547 bytes (140.2k)
CDN
gzip -9
  143034 bytes (139.7k)
local copy
libdeflate -12
  138311 bytes (135.1k)
local copy
7zip -mx=9 -tgzip
  138245 bytes (135.0k)
local copy
zultra
  138186 bytes (134.9k)
local copy
kzip -s0 -rn -b0
  137863 bytes (134.6k)
local copy
pigz -11 -n
  137821 bytes (134.6k)
local copy
Zopfli
  137789 bytes (134.6k)
local copy
Zopfli (defluff)
  137784 bytes (134.6k)
local copy

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

You will automatically get the smallest ThreeJS 106 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 5758 bytes by using my ThreeJS 106 Zopfli version instead of the best available CDN (4.18% smaller than jsdelivr, 137789 vs. 143547 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 --mls64 --bsr12 --lazy --ohh

(found July 6, 2019)
Description Value Parameter
iterations 1000000  --i1000000
maximum blocks 8  --mb8
maximum length score 64  --mls64
block splitting recursion 12  --bsr12
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 5 more bytes (137784 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/r106/build/three.min.js --location | md5sum
d00b814cdae08accee7b575bbdb0f330  -
curl --silent --compressed https://minime.stephan-brumme.com/files/threejs/three-r106.min.zopfli.js.gz | md5sum
d00b814cdae08accee7b575bbdb0f330  -

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

All listed CDNs deliver identical contents:
CDN Size (compressed) MD5 (uncompressed) Timestamp
unpkg 178816 bytes d00b814cdae08accee7b575bbdb0f330 (invalid)
cdnjs 145153 bytes d00b814cdae08accee7b575bbdb0f330 (invalid)
jsdelivr 143547 bytes d00b814cdae08accee7b575bbdb0f330 July 2, 2019 @ 11:34

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
137789 bytes -5 bytes zopfli --i1000000 --mls64 --bsr12 --lazy --ohh July 6, 2019 @ 18:13
137794 bytes -10 bytes zopfli --i100000 --mls64 --bsr12 --lazy --ohh July 5, 2019 @ 14:25
137804 bytes -5 bytes zopfli --i10000 --mls64 --bsr12 --lazy --ohh July 2, 2019 @ 21:42
137809 bytes -6 bytes zopfli --i10000 --mls64 --bsr22 --lazy --ohh July 2, 2019 @ 19:39
137815 bytes -4 bytes zopfli --i10000 --mls64 --bsr11 --lazy --ohh July 2, 2019 @ 18:40
137819 bytes -3 bytes zopfli --i1000 --mls64 --bsr12 --lazy --ohh July 2, 2019 @ 13:00
137822 bytes -9 bytes zopfli --i1000 --mls64 --bsr22 --lazy --ohh July 2, 2019 @ 12:51
137831 bytes -23 bytes zopfli --i1000 --mls64 --bsr11 --lazy --ohh July 2, 2019 @ 12:44
137854 bytes zopfli --i100 --mls64 --bsr12 --lazy --ohh July 2, 2019 @ 11:42

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

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
137994 138005 137969 138011 138025 137988 138008 138052 138019 137900 138040 137999 138000 138005 138016
137956 137950 137911 137961 137928 137908 137921 137831 137840 137856 137900 137956 137918 137986 137990
137934 137986 137935 137925 137903 137918 137911 137872 137890 137829 137847 137911 137972 137953 137977
137937 137916 137928 137931 137877 137932 137837 137835 137861 138013 137908 137888 138009 137980 137925
137933 138000 137946 137898 137933 137946 137904 137861 137848 137858 137898 137882 137889 137879 137953
137939 137940 137914 137930 137895 137942 137890 137853 137862 137897 137907 137914 138004 137994 138060
137944 137987 137952 137907 137945 137946 137904 137860 137895 137904 137888 138025 138036 138025 137942
137911 137911 137935 137896 137948 137815 137939 137913 137901 137828 137899 137899 137984 138004 137971
137959 137894 137894 137895 137942 137789 137902 137855 137996 137889 137883 137917 137924 137923 137934
137901 137949 137919 137909 137898 137915 137932 137888 137890 138006 137887 138036 137958 138000 137935
137942 137929 137935 137899 137896 137902 137881 137888 137897 137922 137881 137905 137947 137952 137939
137933 137948 137899 137895 137937 137903 137916 137861 137913 137825 137861 137911 137963 137972 137947
137954 137995 137951 137924 137941 137948 137934 137849 137895 137867 137889 137943 137902 137908 137911
137953 137894 137900 137895 137944 137895 137949 137865 137859 137963 137900 137978 137963 137969 137942
137939 137988 137950 137946 137943 137967 137951 137896 137862 137958 137877 137944 137945 137941 137942
137932 137945 137896 137939 137898 137895 137914 137855 137892 137954 137901 137998 137970 137967 137968
137934 137931 137933 137938 137906 137958 137890 137907 137906 137908 137898 137904 137973 137942 137933
137896 137938 137898 137944 137946 137942 137901 137901 137857 137964 137903 137899 137960 137967 137947
137953 137988 137939 137940 137945 137801 137901 137888 137894 137858 137892 138021 137912 137918 137944
137906 137896 137899 137898 137940 137949 137933 137899 137895 138009 137898 137856 138059 137997 137934
137905 137939 137899 137895 137943 137937 137890 137894 137888 138008 137898 137895 137963 137968 137922
137900 137996 137898 137950 137934 137862 137944 137858 137894 138001 137901 137996 137973 137963 137935
137951 137990 137955 137892 137937 137894 137945 137891 137931 137955 137891 137983 138055 137964 137933

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 137854 bytes 100%
1,000 137819 bytes -35 bytes 100%
10,000 137804 bytes -15 bytes 100%
100,000 137794 bytes -10 bytes 0.58%
1,000,000 137789 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
137863 bytes +74 bytes (+0.05%)
138395 bytes +606 bytes (+0.44%) +532 bytes
138397 bytes +608 bytes (+0.44%) +534 bytes
138208 bytes +419 bytes (+0.30%) +345 bytes
138102 bytes +313 bytes (+0.23%) +239 bytes
138089 bytes +300 bytes (+0.22%) +226 bytes
138054 bytes +265 bytes (+0.19%) +191 bytes
138032 bytes +243 bytes (+0.18%) +169 bytes
137976 bytes +187 bytes (+0.14%) +113 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 92157 bytes -45632 bytes (-33.12%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 105919 bytes -31870 bytes (-23.13%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 111170 bytes -26619 bytes (-19.32%)
Brotli (Wikipedia) brotli brotli -q 11 116697 bytes -21092 bytes (-15.31%)
LZMA2 (Wikipedia) xz xz -9 117444 bytes -20345 bytes (-14.77%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 122048 bytes -15741 bytes (-11.42%)
Zstandard (Wikipedia) zstd zstd -19 123313 bytes -14476 bytes (-10.51%)

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.