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

After GZIP compression these minified files vary in size:
unpkg
  204989 bytes (200.2k)
CDN
gzip -6 (default)
  151530 bytes (148.0k)
local copy
jsdelivr
  151357 bytes (147.8k)
CDN
gzip -9
  151006 bytes (147.5k)
local copy
7zip -mx=9 -tgzip
  145723 bytes (142.3k)
local copy
libdeflate -12
  145720 bytes (142.3k)
local copy
zultra
  145488 bytes (142.1k)
local copy
pigz -11 -n
  145378 bytes (142.0k)
local copy
kzip -s0 -rn -b0
  145232 bytes (141.8k)
local copy
Zopfli
  145225 bytes (141.8k)
local copy
Zopfli (defluff)
  145220 bytes (141.8k)
local copy

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

You will automatically get the smallest ThreeJS 131 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 6132 bytes by using my ThreeJS 131 Zopfli version instead of the best available CDN (4.22% smaller than jsdelivr, 145225 vs. 151357 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 --mls8192 --bsr16 --lazy --ohh

(found August 4, 2021)
Description Value Parameter
iterations 1000000  --i1000000
maximum blocks 8  --mb8
maximum length score 8192  --mls8192
block splitting recursion 16  --bsr16
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 (145220 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/r131/build/three.min.js --location | md5sum
dcc3a5bfd7e233e56bc0bfa2e316c545  -
curl --silent --compressed https://minime.stephan-brumme.com/files/threejs/three-r131.min.zopfli.js.gz | md5sum
dcc3a5bfd7e233e56bc0bfa2e316c545  -

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

CDN Size (compressed) MD5 (uncompressed) Comment / Diff Timestamp
unpkg 204989 bytes 7f0962c7b686042fdf711c7843657732 < !function(t,e){"object"==typeof exports&&"undefined"!=type [...]
> !function(t,e){"object"==typeof exports&&"undefined"!=type [...]
(invalid)
jsdelivr 151357 bytes 7f0962c7b686042fdf711c7843657732 < !function(t,e){"object"==typeof exports&&"undefined"!=type [...]
> !function(t,e){"object"==typeof exports&&"undefined"!=type [...]
August 2, 2021 @ 17:03

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

Other Versions

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

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
145225 bytes -3 bytes zopfli --i1000000 --mls8192 --bsr16 --lazy --ohh August 4, 2021 @ 15:57
145228 bytes -7 bytes zopfli --i100000 --mls8192 --bsr16 --lazy --ohh August 2, 2021 @ 21:03
145235 bytes -18 bytes zopfli --i10000 --mls8192 --bsr16 --lazy --ohh August 2, 2021 @ 18:06
145253 bytes -20 bytes zopfli --i1000 --mls8192 --bsr16 --lazy --ohh August 2, 2021 @ 17:34
145273 bytes -19 bytes zopfli --i1000 --mls8192 --bsr4 --lazy --ohh August 2, 2021 @ 17:31
145292 bytes zopfli --i100 --mls8192 --bsr16 --lazy --ohh August 2, 2021 @ 17:12

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

Most recent activity on August 4, 2021 @ 17:50.

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
145459 145501 145510 145490 145467 145519 145464 145461 145437 145493 145448 145444 145439 145464 145454
145406 145404 145335 145337 145317 145326 145378 145485 145558 145439 145474 145365 145247 145361 145372
145430 145438 145442 145432 145447 145431 145310 145366 145399 145386 145362 145356 145306 145382 145298
145439 145434 145442 145431 145431 145443 145424 145436 145398 145377 145364 145371 145279 145336 145291
145406 145381 145463 145438 145433 145444 145431 145538 145438 145450 145362 145451 145344 145382 145381
145532 145437 145440 145431 145446 145426 145427 145431 145383 145392 145415 145392 145346 145354 145353
145409 145370 145372 145372 145312 145311 145440 145383 145381 145395 145365 145362 145273 145348 145311
145515 145498 145431 145437 145430 145433 145434 145382 145380 145402 145440 145359 145390 145276 145396
145393 145439 145443 145451 145439 145439 145359 145371 145438 145380 145369 145364 145365 145376 145396
145427 145436 145355 145316 145424 145430 145440 145388 145418 145397 145369 145383 145390 145353 145364
145346 145432 145438 145440 145303 145426 145429 145434 145407 145383 145361 145352 145375 145375 145377
145433 145431 145447 145424 145428 145430 145431 145434 145435 145386 145388 145369 145351 145356 145359
145440 145435 145439 145432 145433 145426 145412 145438 145440 145513 145384 145372 145225 145371 145374
145431 145433 145435 145438 145519 145431 145438 145428 145410 145414 145375 145385 145299 145365 145374
145447 145438 145434 145439 145431 145434 145360 145370 145382 145375 145382 145372 145293 145385 145367
145432 145508 145326 145338 145428 145435 145409 145367 145353 145351 145375 145371 145409 145359 145359
145446 145370 145426 145530 145426 145431 145429 145363 145342 145376 145407 145389 145382 145359 145381
145519 145421 145450 145430 145425 145440 145433 145433 145378 145374 145416 145375 145386 145344 145381
145432 145439 145439 145436 145431 145432 145427 145433 145380 145362 145384 145373 145349 145360 145350
145520 145432 145445 145439 145424 145432 145430 145393 145383 145359 145386 145400 145390 145393 145374
145451 145452 145439 145426 145404 145434 145427 145378 145366 145338 145410 145373 145383 145351 145370
145524 145436 145446 145437 145431 145430 145429 145407 145378 145357 145374 145374 145379 145362 145368
145443 145433 145442 145435 145427 145433 145353 145436 145430 145424 145375 145376 145381 145353 145352

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 145292 bytes 100%
1,000 145253 bytes -39 bytes 100%
10,000 145235 bytes -18 bytes 100%
100,000 145228 bytes -7 bytes 0.58%
1,000,000 145225 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
145232 bytes +7 bytes (0.00%)
145764 bytes +539 bytes (+0.37%) +532 bytes
145730 bytes +505 bytes (+0.35%) +498 bytes
145645 bytes +420 bytes (+0.29%) +413 bytes
145501 bytes +276 bytes (+0.19%) +269 bytes
145514 bytes +289 bytes (+0.20%) +282 bytes
145500 bytes +275 bytes (+0.19%) +268 bytes
145439 bytes +214 bytes (+0.15%) +207 bytes
145475 bytes +250 bytes (+0.17%) +243 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 98277 bytes -46948 bytes (-32.33%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 113300 bytes -31925 bytes (-21.98%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 116908 bytes -28317 bytes (-19.50%)
Brotli (Wikipedia) brotli brotli -q 11 123107 bytes -22118 bytes (-15.23%)
LZMA2 (Wikipedia) xz xz -9 123512 bytes -21713 bytes (-14.95%)
Zstandard (Wikipedia) zstd zstd -19 129693 bytes -15532 bytes (-10.70%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 130930 bytes -14295 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 2021.
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.