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

After GZIP compression these minified files vary in size:
unpkg
  193658 bytes (189.1k)
CDN
Boot
  158415 bytes (154.7k)
CDN
gzip -6 (default)
  157872 bytes (154.2k)
local copy
jsdelivr
  157759 bytes (154.1k)
CDN
gzip -9
  157293 bytes (153.6k)
local copy
libdeflate -12
  151932 bytes (148.4k)
local copy
7zip -mx=9 -tgzip
  151822 bytes (148.3k)
local copy
zultra
  151741 bytes (148.2k)
local copy
kzip -s0 -rn -b0
  151530 bytes (148.0k)
local copy
Zopfli
  151454 bytes (147.9k)
local copy
pigz -11 -n
  151307 bytes (147.8k)
local copy

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

You will automatically get the smallest ThreeJS 122 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 6305 bytes by using my ThreeJS 122 Zopfli version instead of the best available CDN (4.16% smaller than jsdelivr, 151454 vs. 157759 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 --bsr19 --lazy --ohh

(found October 31, 2020)
Description Value Parameter
iterations 1000000  --i1000000
maximum blocks 8  --mb8
maximum length score 4096  --mls4096
block splitting recursion 19  --bsr19
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 (151449 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/r122/build/three.min.js --location | md5sum
f60109e77ddac65a608c9bf5d0898234  -
curl --silent --compressed https://minime.stephan-brumme.com/files/threejs/three-r122.min.zopfli.js.gz | md5sum
f60109e77ddac65a608c9bf5d0898234  -

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

All listed CDNs deliver identical contents:
CDN Size (compressed) MD5 (uncompressed) Timestamp
unpkg 193658 bytes f60109e77ddac65a608c9bf5d0898234 (invalid)
Boot 158415 bytes f60109e77ddac65a608c9bf5d0898234 October 28, 2020 @ 16:22
jsdelivr 157759 bytes f60109e77ddac65a608c9bf5d0898234 October 28, 2020 @ 13:21

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

Other Versions

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

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
151454 bytes -2 bytes zopfli --i1000000 --mls4096 --bsr19 --lazy --ohh October 31, 2020 @ 15:44
151456 bytes -1 byte zopfli --i100000 --mls4096 --bsr19 --lazy --ohh October 30, 2020 @ 07:13
151457 bytes -7 bytes zopfli --i100000 --mls8192 --bsr20 --lazy --ohh October 29, 2020 @ 15:19
151464 bytes -9 bytes zopfli --i10000 --mls8192 --bsr20 --lazy --ohh October 29, 2020 @ 12:17
151473 bytes -8 bytes zopfli --i1000 --mls8192 --bsr20 --lazy --ohh October 29, 2020 @ 11:12
151481 bytes -1 byte zopfli --i1000 --mls4096 --bsr23 --lazy --ohh October 29, 2020 @ 11:08
151482 bytes -3 bytes zopfli --i1000 --mls4096 --bsr19 --lazy --ohh October 29, 2020 @ 11:07
151485 bytes -29 bytes zopfli --i1000 --mls256 --bsr19 --lazy --ohh October 29, 2020 @ 11:06
151514 bytes zopfli --i100 --mls8192 --bsr20 --lazy --ohh October 28, 2020 @ 14:21

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

Most recent activity on November 2, 2020 @ 10:40.

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
151607 151598 151606 151608 151599 151593 151590 151564 151467 151573 151563 151508 151574 151533 151596
151664 151710 151663 151682 151655 151695 151693 151679 151697 151689 151497 151507 151565 151491 151551
151550 151666 151672 151523 151654 151536 151539 151540 151644 151490 151474 151477 151487 151499 151510
151663 151660 151669 151654 151654 151522 151539 151532 151494 151461 151469 151481 151639 151492 151490
151650 151512 151644 151677 151550 151573 151524 151507 151540 151514 151505 151505 151476 151496 151563
151663 151669 151670 151657 151661 151658 151654 151536 151521 151514 151478 151477 151506 151484 151501
151540 151703 151683 151683 151703 151540 151639 151626 151637 151479 151479 151501 151522 151504 151537
151540 151670 151677 151684 151656 151652 151648 151640 151635 151475 151479 151481 151650 151496 151559
151674 151670 151676 151669 151663 151536 151528 151523 151622 151637 151520 151637 151517 151548 151536
151670 151668 151689 151672 151667 151527 151531 151508 151630 151635 151484 151510 151515 151503 151477
151674 151526 151587 151506 151511 151527 151478 151467 151468 151490 151493 151516 151498 151491 151493
151677 151670 151678 151537 151665 151663 151534 151506 151677 151661 151666 151490 151492 151502 151485
151673 151657 151667 151679 151666 151516 151511 151467 151531 151471 151538 151485 151471 151495 151485
151671 151673 151671 151676 151669 151534 151533 151626 151642 151611 151489 151487 151476 151495 151485
151668 151675 151668 151676 151664 151663 151537 151640 151629 151599 151552 151477 151490 151495 151493
151677 151665 151662 151679 151667 151662 151646 151460 151648 151616 151480 151454 151493 151491 151500
151656 151516 151667 151533 151508 151643 151613 151467 151636 151598 151478 151519 151457 151489 151484
151653 151666 151670 151683 151664 151635 151635 151475 151477 151509 151480 151488 151468 151491 151493
151660 151664 151668 151669 151671 151656 151641 151629 151478 151485 151480 151477 151500 151485 151496
151662 151665 151669 151675 151665 151654 151642 151487 151504 151473 151506 151472 151490 151527 151514
151660 151645 151688 151660 151670 151631 151627 151506 151541 151532 151503 151470 151512 151523 151527
151667 151670 151658 151659 151663 151621 151641 151528 151638 151616 151477 151475 151507 151497 151492
151693 151665 151665 151673 151656 151664 151641 151471 151630 151516 151468 151496 151485 151492 151502

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 151514 bytes 100%
1,000 151473 bytes -41 bytes 100%
10,000 151464 bytes -9 bytes 100%
100,000 151456 bytes -8 bytes 1.16%
1,000,000 151454 bytes -2 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
151530 bytes +76 bytes (+0.05%)
151975 bytes +521 bytes (+0.34%) +445 bytes
151992 bytes +538 bytes (+0.36%) +462 bytes
151733 bytes +279 bytes (+0.18%) +203 bytes
151690 bytes +236 bytes (+0.16%) +160 bytes
151651 bytes +197 bytes (+0.13%) +121 bytes
151645 bytes +191 bytes (+0.13%) +115 bytes
151647 bytes +193 bytes (+0.13%) +117 bytes
151622 bytes +168 bytes (+0.11%) +92 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 102204 bytes -49250 bytes (-32.52%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 117796 bytes -33658 bytes (-22.22%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 122025 bytes -29429 bytes (-19.43%)
Brotli (Wikipedia) brotli brotli -q 11 127652 bytes -23802 bytes (-15.72%)
LZMA2 (Wikipedia) xz xz -9 128148 bytes -23306 bytes (-15.39%)
Zstandard (Wikipedia) zstd zstd -19 134740 bytes -16714 bytes (-11.04%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 136339 bytes -15115 bytes (-9.98%)

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.