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

After GZIP compression these minified files vary in size:
unpkg
  193317 bytes (188.8k)
CDN
Boot
  158168 bytes (154.5k)
CDN
gzip -6 (default)
  157638 bytes (153.9k)
local copy
jsdelivr
  157517 bytes (153.8k)
CDN
gzip -9
  157061 bytes (153.4k)
local copy
libdeflate -12
  151710 bytes (148.2k)
local copy
7zip -mx=9 -tgzip
  151609 bytes (148.1k)
local copy
zultra
  151382 bytes (147.8k)
local copy
kzip -s0 -rn -b0
  151308 bytes (147.8k)
local copy
Zopfli
  151151 bytes (147.6k)
local copy
pigz -11 -n
  151115 bytes (147.6k)
local copy

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

You will automatically get the smallest ThreeJS 121 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 6366 bytes by using my ThreeJS 121 Zopfli version instead of the best available CDN (4.21% smaller than jsdelivr, 151151 vs. 157517 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 --mls32768 --bsr15 --lazy --ohh

(found October 9, 2020)
Description Value Parameter
iterations 1000000  --i1000000
maximum blocks 8  --mb8
maximum length score 32768  --mls32768
block splitting recursion 15  --bsr15
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 (151148 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/r121/build/three.min.js --location | md5sum
765bf633ade83f80888c1921d51701db  -
curl --silent --compressed https://minime.stephan-brumme.com/files/threejs/three-r121.min.zopfli.js.gz | md5sum
765bf633ade83f80888c1921d51701db  -

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

All listed CDNs deliver identical contents:
CDN Size (compressed) MD5 (uncompressed) Timestamp
unpkg 193317 bytes 765bf633ade83f80888c1921d51701db (invalid)
Boot 158168 bytes 765bf633ade83f80888c1921d51701db (invalid)
jsdelivr 157517 bytes 765bf633ade83f80888c1921d51701db October 6, 2020 @ 16:21

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

Other Versions

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

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
151151 bytes -4 bytes zopfli --i1000000 --mls32768 --bsr15 --lazy --ohh October 9, 2020 @ 18:03
151155 bytes -7 bytes zopfli --i100000 --mls32768 --bsr15 --lazy --ohh October 8, 2020 @ 15:52
151162 bytes -6 bytes zopfli --i10000 --mls32768 --bsr15 --lazy --ohh October 6, 2020 @ 22:28
151168 bytes -52 bytes zopfli --i1000 --mls32768 --bsr15 --lazy --ohh October 6, 2020 @ 17:00
151220 bytes zopfli --i100 --mls32768 --bsr15 --lazy --ohh October 6, 2020 @ 16:43

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

Most recent activity on October 12, 2020 @ 13:08.

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
151310 151311 151378 151374 151367 151361 151357 151236 151242 151308 151335 151360 151310 151307 151370
151425 151426 151430 151432 151417 151395 151459 151395 151299 151464 151276 151300 151357 151260 151315
151301 151443 151447 151294 151428 151300 151301 151241 151241 151309 151263 151262 151263 151257 151272
151442 151435 151448 151291 151423 151294 151297 151294 151255 151304 151284 151249 151415 151259 151274
151418 151282 151439 151442 151327 151288 151285 151278 151296 151287 151251 151279 151252 151263 151267
151457 151426 151452 151459 151428 151293 151432 151226 151290 151283 151261 151278 151254 151239 151258
151299 151431 151436 151446 151445 151307 151302 151225 151294 151251 151249 151254 151294 151256 151273
151438 151312 151446 151448 151425 151416 151420 151408 151413 151289 151262 151249 151284 151272 151296
151445 151446 151445 151296 151435 151430 151296 151280 151406 151283 151295 151399 151286 151257 151249
151452 151442 151447 151431 151441 151299 151299 151300 151292 151279 151261 151282 151289 151259 151250
151462 151338 151339 151462 151282 151263 151264 151267 151264 151306 151266 151264 151252 151241 151261
151303 151434 151447 151436 151434 151295 151276 151276 151269 151293 151253 151277 151268 151257 151151
151450 151438 151431 151437 151437 151397 151285 151244 151299 151242 151304 151260 151237 151262 151268
151440 151453 151447 151458 151431 151423 151300 151290 151415 151379 151253 151270 151254 151265 151263
151435 151460 151434 151443 151433 151428 151293 151233 151401 151367 151303 151258 151244 151276 151259
151445 151433 151456 151444 151436 151401 151407 151238 151304 151365 151252 151253 151266 151273 151265
151417 151273 151451 151430 151435 151405 151383 151294 151245 151282 151248 151270 151259 151274 151248
151404 151408 151454 151459 151434 151298 151409 151256 151249 151252 151236 151242 151239 151260 151268
151434 151441 151432 151443 151436 151412 151411 151262 151262 151256 151261 151251 151258 151262 151264
151430 151437 151437 151436 151439 151415 151412 151249 151266 151242 151253 151246 151240 151269 151265
151435 151413 151449 151465 151424 151402 151412 151295 151300 151310 151251 151239 151269 151295 151266
151439 151458 151449 151430 151431 151394 151405 151292 151253 151279 151247 151269 151248 151264 151279
151472 151451 151418 151460 151438 151397 151406 151278 151257 151283 151256 151283 151255 151257 151269

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 151220 bytes 100%
1,000 151168 bytes -52 bytes 100%
10,000 151162 bytes -6 bytes 100%
100,000 151155 bytes -7 bytes 0.87%
1,000,000 151151 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
151308 bytes +157 bytes (+0.10%)
151732 bytes +581 bytes (+0.38%) +424 bytes
151747 bytes +596 bytes (+0.39%) +439 bytes
151493 bytes +342 bytes (+0.23%) +185 bytes
151459 bytes +308 bytes (+0.20%) +151 bytes
151453 bytes +302 bytes (+0.20%) +145 bytes
151401 bytes +250 bytes (+0.17%) +93 bytes
151393 bytes +242 bytes (+0.16%) +85 bytes
151410 bytes +259 bytes (+0.17%) +102 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 102031 bytes -49120 bytes (-32.50%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 117604 bytes -33547 bytes (-22.19%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 121868 bytes -29283 bytes (-19.37%)
Brotli (Wikipedia) brotli brotli -q 11 127422 bytes -23729 bytes (-15.70%)
LZMA2 (Wikipedia) xz xz -9 127952 bytes -23199 bytes (-15.35%)
Zstandard (Wikipedia) zstd zstd -19 134525 bytes -16626 bytes (-11.00%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 136103 bytes -15048 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 2020.
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.