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

After GZIP compression these minified files vary in size:
cdnjs
  130585 bytes (127.5k)
CDN
unpkg
  129243 bytes (126.2k)
CDN
gzip -6 (default)
  129208 bytes (126.2k)
local copy
jsdelivr
  129119 bytes (126.1k)
CDN
gzip -9
  128743 bytes (125.7k)
local copy
libdeflate -12
  124395 bytes (121.5k)
local copy
7zip -mx=9 -tgzip
  124228 bytes (121.3k)
local copy
zultra
  124158 bytes (121.2k)
local copy
kzip -s0 -rn -b0
  123975 bytes (121.1k)
local copy
pigz -11 -n
  123924 bytes (121.0k)
local copy
Zopfli
  123804 bytes (120.9k)
local copy
Zopfli (defluff)
  123798 bytes (120.9k)
local copy

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

You will automatically get the smallest ThreeJS 85 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 5315 bytes by using my ThreeJS 85 Zopfli version instead of the best available CDN (4.29% smaller than jsdelivr, 123804 vs. 129119 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 --bsr8 --lazy --ohh

(found April 25, 2017)
Description Value Parameter
iterations 1000000  --i1000000
maximum blocks 8  --mb8
maximum length score 4096  --mls4096
block splitting recursion 8  --bsr8
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 (123798 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/r85/build/three.min.js --location | md5sum
d499fa19d58c9c81c0e64a79780dce43  -
curl --silent --compressed https://minime.stephan-brumme.com/files/threejs/three-r85.min.zopfli.js.gz | md5sum
d499fa19d58c9c81c0e64a79780dce43  -

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

All listed CDNs deliver identical contents:
CDN Size (compressed) MD5 (uncompressed) Timestamp
cdnjs 130585 bytes d499fa19d58c9c81c0e64a79780dce43 (invalid)
unpkg 129243 bytes d499fa19d58c9c81c0e64a79780dce43 (invalid)
jsdelivr 129119 bytes d499fa19d58c9c81c0e64a79780dce43 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:

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
123804 bytes -1 byte zopfli --i1000000 --mls4096 --bsr8 --lazy --ohh April 25, 2017 @ 09:22
123805 bytes -6 bytes zopfli --i100000 --mls4096 --bsr8 --lazy --ohh April 22, 2017 @ 11:51
123811 bytes -10 bytes zopfli --i10000 --mls4096 --bsr8 --lazy --ohh April 22, 2017 @ 09:20
123821 bytes -26 bytes zopfli --i1000 --mls4096 --bsr8 --lazy --ohh April 22, 2017 @ 09:00
123847 bytes zopfli --i100 --mls4096 --bsr8 --lazy --ohh April 22, 2017 @ 08: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:53.

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
124023 124024 124024 124094 124048 124013 124014 124020 124067 123986 124023 123985 124005 123997 124029
123954 123976 123981 123943 123945 123967 123978 123962 123960 123990 123961 123944 123911 124018 123974
124007 124005 123959 124011 123998 123994 123978 123936 123942 123943 123982 123947 123934 123994 123986
123941 123969 123944 123912 123995 123989 123989 123952 123922 123935 123960 123958 123959 123939 123946
123997 123971 123998 124000 124004 123999 123997 123999 123986 123915 123826 123804 123982 123969 123995
123940 123936 124047 123978 123983 123985 123988 123935 123935 123935 123975 123934 123929 123960 123986
124005 124000 123997 123993 123983 123985 123990 123915 123923 123925 123941 123932 123953 123979 123968
123945 123972 124030 123987 123975 123987 123986 123922 123916 123933 123959 123870 123949 123997 123972
123984 123969 123941 123933 123987 123986 123988 123915 123955 123918 123961 123933 123967 123991 123971
123946 123975 123942 123935 123986 123986 123989 123925 123915 123920 123939 123986 123950 123967 123954
123957 123998 123969 123944 123988 124001 123978 123947 123968 123935 123978 123962 123940 123937 123983
123945 123971 123937 123959 123983 123993 123987 123919 123914 123918 123959 123938 123937 123925 123955
124002 123999 123965 123967 123951 123985 123988 123934 123960 123940 123937 123935 123936 123962 123975
123973 123970 123979 123972 123982 123982 123986 123937 123953 123930 123979 123939 123939 124005 123965
123951 123979 123975 123975 123981 123976 123986 123914 123918 123933 123936 123985 123964 123989 123978
123990 123971 123972 123988 123987 123994 123985 123985 123915 123917 123957 123953 123945 123933 123950
123975 123973 124037 123973 123976 123993 123987 123915 123968 123918 123938 123961 123948 124014 123962
123989 123972 123974 123976 123972 123958 123987 123939 123936 123936 123938 123951 123949 123983 123959
123999 123970 123973 123971 123983 123990 123955 123957 123966 123920 123937 123949 123950 123973 123990
123992 123998 123995 124015 123984 123985 123987 123917 123917 123933 124000 123958 123936 123978 123957
123984 123972 123982 123982 123985 123988 123982 123917 123917 123915 123990 123987 123949 123972 123942
124001 123994 123956 123957 123987 123963 123934 123966 123981 123958 123959 123932 123947 123956 123972
123995 123970 123997 124088 123972 123986 123979 123964 123964 123934 123987 123948 123938 123953 123951

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 123847 bytes 100%
1,000 123821 bytes -26 bytes 100%
10,000 123811 bytes -10 bytes 100%
100,000 123805 bytes -6 bytes 0.87%
1,000,000 123804 bytes -1 byte 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
123975 bytes +171 bytes (+0.14%)
124504 bytes +700 bytes (+0.57%) +529 bytes
124474 bytes +670 bytes (+0.54%) +499 bytes
124234 bytes +430 bytes (+0.35%) +259 bytes
124198 bytes +394 bytes (+0.32%) +223 bytes
124058 bytes +254 bytes (+0.21%) +83 bytes
124076 bytes +272 bytes (+0.22%) +101 bytes
123991 bytes +187 bytes (+0.15%) +16 bytes
124009 bytes +205 bytes (+0.17%) +34 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 84230 bytes -39574 bytes (-31.97%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 96953 bytes -26851 bytes (-21.69%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 102521 bytes -21283 bytes (-17.19%)
Brotli (Wikipedia) brotli brotli -q 11 105910 bytes -17894 bytes (-14.45%)
LZMA2 (Wikipedia) xz xz -9 106816 bytes -16988 bytes (-13.72%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 111394 bytes -12410 bytes (-10.02%)
Zstandard (Wikipedia) zstd zstd -19 112952 bytes -10852 bytes (-8.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.