Choose a version:
53% The original file has 1180461 bytes (1,152.8k) and is available from the project website.
There you can find the official minified version, too, which brings down the size to 623156 bytes (608.6k, 53%).

After GZIP compression these minified files vary in size:
unpkg
  208803 bytes (203.9k)
CDN
gzip -6 (default)
  154284 bytes (150.7k)
local copy
jsdelivr
  154191 bytes (150.6k)
CDN
gzip -9
  153720 bytes (150.1k)
local copy
libdeflate -12
  148526 bytes (145.0k)
local copy
7zip -mx=9 -tgzip
  148360 bytes (144.9k)
local copy
zultra
  148353 bytes (144.9k)
local copy
pigz -11 -n
  148078 bytes (144.6k)
local copy
kzip -s0 -rn -b0
  148060 bytes (144.6k)
local copy
Zopfli
  147996 bytes (144.5k)
local copy
Zopfli (defluff)
  147990 bytes (144.5k)
local copy

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

You will automatically get the smallest ThreeJS 139 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 6195 bytes by using my ThreeJS 139 Zopfli version instead of the best available CDN (4.19% smaller than jsdelivr, 147996 vs. 154191 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 --mls16384 --bsr8 --lazy --ohh

(found March 27, 2022)
Description Value Parameter
iterations 1000000  --i1000000
maximum blocks 8  --mb8
maximum length score 16384  --mls16384
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 (147990 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/r139/build/three.min.js --location | md5sum
0fa17d106285060153b12e90b5c0d4f4  -
curl --silent --compressed https://minime.stephan-brumme.com/files/threejs/three-r139.min.zopfli.js.gz | md5sum
0fa17d106285060153b12e90b5c0d4f4  -

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

All listed CDNs deliver identical contents:
CDN Size (compressed) MD5 (uncompressed) Timestamp
unpkg 208803 bytes 0fa17d106285060153b12e90b5c0d4f4 (invalid)
jsdelivr 154191 bytes 0fa17d106285060153b12e90b5c0d4f4 March 25, 2022 @ 10:35

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

Other Versions

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

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
147996 bytes -7 bytes zopfli --i1000000 --mls16384 --bsr8 --lazy --ohh March 27, 2022 @ 03:18
148003 bytes -7 bytes zopfli --i100000 --mls16384 --bsr8 --lazy --ohh March 25, 2022 @ 18:00
148010 bytes -14 bytes zopfli --i10000 --mls16384 --bsr8 --lazy --ohh March 25, 2022 @ 14:11
148024 bytes -16 bytes zopfli --i1000 --mls16384 --bsr8 --lazy --ohh March 25, 2022 @ 13:36
148040 bytes -20 bytes zopfli --i1000 --mls4096 --bsr8 --lazy --ohh March 25, 2022 @ 13:36
148060 bytes zopfli --i100 --mls2048 --bsr21 --lazy --ohh March 25, 2022 @ 10:45

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

Most recent activity on March 28, 2022 @ 12:29.

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
148072 148084 148110 148242 148200 148205 148193 148200 148211 148184 148127 148129 148141 148145 148132
148129 148149 148133 148100 148113 148123 148093 148102 148099 148127 148096 148067 148095 148094 148090
148053 148068 148072 148070 148089 148085 148071 148073 148077 148077 148075 148109 148068 148061 148117
148244 148087 148081 148091 148075 148101 148223 148086 148083 148241 148083 148089 148089 148072 148072
148130 148091 148090 148108 148090 148067 148060 148064 148085 148082 148064 148028 148063 147996 148100
148093 148055 148060 148061 148063 148067 148084 148050 148049 148070 148069 148087 148050 148062 148102
148100 148088 148271 148054 148086 148076 148212 148061 148073 148242 148059 148064 148222 148130 148086
148247 148084 148105 148062 148088 148088 148228 148084 148081 148071 148068 148095 148071 148063 148072
148091 148067 148070 148071 148078 148056 148070 148083 148089 148101 148070 148085 148066 148092 148080
148119 148116 148098 148076 148065 148067 148095 148072 148078 148081 148065 148086 148060 148064 148058
148089 148079 148077 148101 148095 148095 148082 148059 148083 148093 148065 148085 148050 148089 148089
148079 148072 148062 148063 148064 148068 148085 148098 148073 148077 148073 148084 148046 148061 148076
148111 148080 148083 148065 148064 148061 148054 148071 148076 148079 148072 148034 148054 148053 148077
148098 148123 148089 148068 148067 148065 148091 148082 148091 148061 148074 148099 148065 148074 148115
148084 148096 148096 148082 148072 148068 148069 148090 148068 148070 148074 148091 148093 148066 148071
148096 148064 148087 148069 148092 148076 148067 148054 148077 148077 148068 148090 148087 148063 148072
148213 148228 148081 148062 148064 148093 148236 148077 148082 148089 148049 148074 148097 148063 148115
148082 148086 148066 148088 148083 148055 148085 148053 148060 148093 148005 148079 148067 148070 148078
148057 148092 148055 148071 148085 148047 148061 148074 148086 148092 148065 148072 148081 148086 148075
148098 148077 148060 148088 148066 148066 148076 148054 148079 148100 148074 148036 148062 148062 148078
148061 148065 148050 148061 148072 148074 148082 148071 148078 148088 148069 148081 148066 148056 148072
148092 148067 148066 148066 148063 148067 148074 148077 148077 148095 148067 148076 148109 148081 148069
148091 148061 148062 148085 148068 148065 148067 148081 148073 148091 148024 148081 148052 148053 148077

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 148060 bytes 100%
1,000 148024 bytes -36 bytes 100%
10,000 148010 bytes -14 bytes 100%
100,000 148003 bytes -7 bytes 0.58%
1,000,000 147996 bytes -7 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
148060 bytes +64 bytes (+0.04%)
148534 bytes +538 bytes (+0.36%) +474 bytes
148532 bytes +536 bytes (+0.36%) +472 bytes
148290 bytes +294 bytes (+0.20%) +230 bytes
148287 bytes +291 bytes (+0.20%) +227 bytes
148303 bytes +307 bytes (+0.21%) +243 bytes
148275 bytes +279 bytes (+0.19%) +215 bytes
148205 bytes +209 bytes (+0.14%) +145 bytes
148218 bytes +222 bytes (+0.15%) +158 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 100222 bytes -47774 bytes (-32.28%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 115615 bytes -32381 bytes (-21.88%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 119305 bytes -28691 bytes (-19.39%)
Brotli (Wikipedia) brotli brotli -q 11 125868 bytes -22128 bytes (-14.95%)
LZMA2 (Wikipedia) xz xz -9 126208 bytes -21788 bytes (-14.72%)
Zstandard (Wikipedia) zstd zstd -19 132481 bytes -15515 bytes (-10.48%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 133428 bytes -14568 bytes (-9.84%)

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