Choose a version:
52% The original file has 1179254 bytes (1,151.6k) and is available from the project website.
There you can find the official minified version, too, which brings down the size to 618904 bytes (604.4k, 52%).

After GZIP compression these minified files vary in size:
unpkg
  206453 bytes (201.6k)
CDN
gzip -6 (default)
  152493 bytes (148.9k)
local copy
jsdelivr
  152347 bytes (148.8k)
CDN
gzip -9
  151961 bytes (148.4k)
local copy
libdeflate -12
  146772 bytes (143.3k)
local copy
7zip -mx=9 -tgzip
  146553 bytes (143.1k)
local copy
zultra
  146407 bytes (143.0k)
local copy
kzip -s0 -rn -b0
  146217 bytes (142.8k)
local copy
pigz -11 -n
  146167 bytes (142.7k)
local copy
Zopfli
  146147 bytes (142.7k)
local copy
Zopfli (defluff)
  146144 bytes (142.7k)
local copy

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

You will automatically get the smallest ThreeJS 137 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 6200 bytes by using my ThreeJS 137 Zopfli version instead of the best available CDN (4.24% smaller than jsdelivr, 146147 vs. 152347 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 --bsr23 --lazy --ohh

(found January 28, 2022)
Description Value Parameter
iterations 1000000  --i1000000
maximum blocks 8  --mb8
maximum length score 2048  --mls2048
block splitting recursion 23  --bsr23
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 3 more bytes (146144 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/r137/build/three.min.js --location | md5sum
d1ffa1b39a104e31f94556806938780f  -
curl --silent --compressed https://minime.stephan-brumme.com/files/threejs/three-r137.min.zopfli.js.gz | md5sum
d1ffa1b39a104e31f94556806938780f  -

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

All listed CDNs deliver identical contents:
CDN Size (compressed) MD5 (uncompressed) Timestamp
unpkg 206453 bytes d1ffa1b39a104e31f94556806938780f (invalid)
jsdelivr 152347 bytes d1ffa1b39a104e31f94556806938780f January 27, 2022 @ 10: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
146147 bytes -3 bytes zopfli --i1000000 --mls2048 --bsr23 --lazy --ohh January 28, 2022 @ 23:02
146150 bytes -11 bytes zopfli --i100000 --mls2048 --bsr23 --lazy --ohh January 27, 2022 @ 14:40
146161 bytes -1 byte zopfli --i10000 --mls4096 --bsr6 --lazy --ohh January 27, 2022 @ 13:47
146162 bytes -13 bytes zopfli --i10000 --mls2048 --bsr23 --lazy --ohh January 27, 2022 @ 11:28
146175 bytes -2 bytes zopfli --i1000 --mls2048 --bsr23 --lazy --ohh January 27, 2022 @ 11:02
146177 bytes -6 bytes zopfli --i1000 --mls4096 --bsr6 --lazy --ohh January 27, 2022 @ 11:00
146183 bytes -16 bytes zopfli --i1000 --mls32768 --bsr13 --lazy --ohh January 27, 2022 @ 11:00
146199 bytes zopfli --i100 --mls4096 --bsr6 --lazy --ohh January 27, 2022 @ 10:40

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

Most recent activity on January 31, 2022 @ 05:36.

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
146276 146280 146292 146263 146321 146254 146265 146291 146289 146362 146314 146330 146280 146284 146338
146284 146286 146285 146292 146267 146294 146256 146259 146296 146256 146205 146220 146270 146271 146278
146238 146230 146267 146244 146252 146243 146249 146263 146226 146226 146258 146153 146218 146188 146258
146387 146237 146260 146279 146306 146256 146217 146240 146272 146224 146238 146222 146239 146199 146247
146279 146251 146251 146251 146323 146252 146228 146244 146206 146215 146245 146239 146253 146274 146252
146228 146231 146234 146241 146231 146233 146229 146245 146202 146204 146171 146238 146238 146249 146244
146373 146367 146369 146233 146269 146389 146250 146226 146358 146235 146230 146231 146256 146249 146280
146223 146232 146246 146229 146264 146244 146231 146235 146224 146223 146222 146231 146238 146247 146232
146234 146264 146245 146237 146264 146242 146240 146246 146237 146223 146233 146229 146197 146225 146251
146278 146253 146257 146276 146265 146262 146241 146237 146229 146223 146185 146230 146260 146221 146163
146229 146223 146233 146245 146232 146258 146255 146258 146219 146220 146167 146231 146235 146243 146245
146245 146261 146257 146252 146232 146234 146247 146285 146222 146214 146262 146219 146240 146238 146244
146225 146235 146254 146238 146222 146228 146236 146239 146231 146214 146248 146242 146238 146229 146187
146239 146235 146240 146240 146232 146244 146233 146228 146219 146209 146246 146227 146248 146244 146250
146233 146240 146247 146243 146256 146238 146248 146245 146210 146225 146251 146228 146247 146269 146255
146230 146231 146239 146232 146257 146235 146230 146241 146224 146218 146262 146233 146242 146255 146238
146389 146234 146259 146270 146259 146234 146228 146239 146227 146228 146250 146265 146250 146246 146233
146224 146235 146238 146244 146241 146240 146262 146247 146243 146207 146234 146237 146243 146244 146251
146230 146241 146229 146229 146226 146238 146229 146240 146227 146203 146254 146231 146260 146236 146243
146223 146212 146235 146222 146235 146235 146222 146236 146211 146226 146147 146230 146248 146242 146245
146227 146263 146253 146253 146268 146236 146261 146234 146235 146225 146248 146233 146239 146265 146251
146223 146233 146258 146224 146242 146235 146233 146234 146218 146209 146258 146222 146237 146246 146258
146221 146264 146256 146251 146231 146234 146229 146234 146234 146215 146263 146227 146240 146250 146248

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 146199 bytes 100%
1,000 146175 bytes -24 bytes 100%
10,000 146161 bytes -14 bytes 100%
100,000 146150 bytes -11 bytes 0.58%
1,000,000 146147 bytes -3 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
146217 bytes +70 bytes (+0.05%)
146721 bytes +574 bytes (+0.39%) +504 bytes
146736 bytes +589 bytes (+0.40%) +519 bytes
146608 bytes +461 bytes (+0.32%) +391 bytes
146477 bytes +330 bytes (+0.23%) +260 bytes
146481 bytes +334 bytes (+0.23%) +264 bytes
146432 bytes +285 bytes (+0.20%) +215 bytes
146397 bytes +250 bytes (+0.17%) +180 bytes
146374 bytes +227 bytes (+0.16%) +157 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 - but your browser doesn't support it.
Algorithm Program Parameters Size Compared To Best Zopfli
ZPAQ (Wikipedia) zpaq zpaq -method 69 98942 bytes -47205 bytes (-32.30%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 114009 bytes -32138 bytes (-21.99%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 117719 bytes -28428 bytes (-19.45%)
Brotli (Wikipedia) brotli brotli -q 11 124142 bytes -22005 bytes (-15.06%)
LZMA2 (Wikipedia) xz xz -9 124472 bytes -21675 bytes (-14.83%)
Zstandard (Wikipedia) zstd zstd -19 130666 bytes -15481 bytes (-10.59%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 131595 bytes -14552 bytes (-9.96%)

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.