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

After GZIP compression these minified files vary in size:
unpkg
  223616 bytes (218.4k)
CDN
gzip -6 (default)
  152835 bytes (149.3k)
local copy
jsdelivr
  152721 bytes (149.1k)
CDN
gzip -9
  152348 bytes (148.8k)
local copy
libdeflate -12
  147035 bytes (143.6k)
local copy
zultra
  146728 bytes (143.3k)
local copy
7zip -mx=9 -tgzip
  146693 bytes (143.3k)
local copy
kzip -s0 -rn -b0
  146411 bytes (143.0k)
local copy
pigz -11 -n
  146344 bytes (142.9k)
local copy
Zopfli
  146326 bytes (142.9k)
local copy
Zopfli (defluff)
  146321 bytes (142.9k)
local copy

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

You will automatically get the smallest ThreeJS 147 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 6395 bytes by using my ThreeJS 147 Zopfli version instead of the best available CDN (4.37% smaller than jsdelivr, 146326 vs. 152721 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 --bsr10 --lazy --ohh

(found January 10, 2023)
Description Value Parameter
iterations 1000000  --i1000000
maximum blocks 8  --mb8
maximum length score 8192  --mls8192
block splitting recursion 10  --bsr10
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 (146321 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/r147/build/three.min.js --location | md5sum
ac4679b19c6ac6b2827182dc0c988471  -
curl --silent --compressed https://minime.stephan-brumme.com/files/threejs/three-r147.min.zopfli.js.gz | md5sum
ac4679b19c6ac6b2827182dc0c988471  -

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

All listed CDNs deliver identical contents:
CDN Size (compressed) MD5 (uncompressed) Timestamp
unpkg 223616 bytes ac4679b19c6ac6b2827182dc0c988471 (invalid)
jsdelivr 152721 bytes ac4679b19c6ac6b2827182dc0c988471 January 3, 2023 @ 16:24

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
146326 bytes -4 bytes zopfli --i1000000 --mls8192 --bsr10 --lazy --ohh January 10, 2023 @ 13:16
146330 bytes -6 bytes zopfli --i100000 --mls8192 --bsr10 --lazy --ohh January 7, 2023 @ 00:49
146336 bytes -1 byte zopfli --i10000 --mls8192 --bsr10 --lazy --ohh January 6, 2023 @ 06:46
146337 bytes -15 bytes zopfli --i10000 --mls4096 --bsr40 --lazy --ohh January 5, 2023 @ 02:56
146352 bytes -7 bytes zopfli --i1000 --mls4096 --bsr40 --lazy --ohh January 3, 2023 @ 21:15
146359 bytes -14 bytes zopfli --i1000 --mls8192 --bsr10 --lazy --ohh January 3, 2023 @ 20:08
146373 bytes zopfli --i100 --mls8192 --bsr10 --lazy --ohh January 3, 2023 @ 17:57

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

Most recent activity on January 10, 2023 @ 13:24.

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 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
146561 146738 146579 146536 146483 146545 146484 146504 146560 146501 146438 146518 146518 146363 146507
146478 146518 146520 146496 146474 146506 146454 146437 146452 146467 146450 146346 146468 146355 146509
146445 146442 146438 146469 146438 146455 146431 146427 146433 146433 146349 146470 146473 146432 146499
146444 146434 146467 146444 146461 146427 146612 146431 146434 146437 146429 146451 146437 146427 146514
146473 146446 146430 146451 146499 146440 146471 146437 146438 146457 146416 146466 146432 146478 146478
146440 146441 146438 146452 146463 146430 146467 146429 146419 146424 146452 146449 146432 146465 146478
146479 146443 146487 146447 146506 146503 146587 146498 146419 146429 146419 146432 146326 146361 146469
146445 146443 146447 146433 146443 146429 146428 146434 146417 146437 146435 146430 146471 146451 146447
146429 146444 146443 146431 146447 146435 146435 146421 146421 146429 146431 146420 146438 146431 146475
146449 146476 146438 146439 146444 146448 146428 146438 146433 146442 146413 146449 146434 146430 146435
146437 146447 146458 146436 146435 146428 146433 146428 146428 146419 146416 146429 146443 146460 146448
146443 146445 146460 146438 146443 146425 146428 146437 146414 146432 146427 146430 146467 146464 146455
146436 146439 146452 146460 146454 146443 146454 146432 146420 146433 146415 146440 146447 146436 146496
146441 146442 146447 146423 146443 146443 146445 146442 146418 146427 146422 146476 146459 146463 146455
146469 146442 146461 146448 146464 146451 146433 146432 146434 146445 146416 146470 146447 146465 146491
146452 146443 146444 146444 146431 146434 146437 146427 146424 146442 146415 146418 146443 146467 146467
146433 146424 146445 146443 146426 146443 146434 146430 146425 146424 146407 146465 146460 146447 146448
146441 146442 146446 146459 146438 146442 146435 146428 146421 146429 146414 146429 146442 146434 146487
146448 146444 146446 146462 146460 146456 146430 146438 146422 146430 146410 146459 146422 146467 146441
146450 146447 146433 146444 146439 146442 146430 146431 146416 146426 146411 146471 146457 146523 146441
146429 146445 146442 146442 146441 146441 146429 146429 146419 146436 146415 146435 146464 146470 146448
146439 146442 146427 146458 146436 146462 146438 146431 146417 146437 146416 146465 146448 146433 146449
146430 146445 146456 146454 146431 146456 146439 146429 146427 146433 146411 146337 146445 146413 146448

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 146373 bytes 100%
1,000 146352 bytes -21 bytes 100%
10,000 146336 bytes -16 bytes 100%
100,000 146330 bytes -6 bytes 0.29%
1,000,000 146326 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
146411 bytes +85 bytes (+0.06%)
147131 bytes +805 bytes (+0.55%) +720 bytes
147062 bytes +736 bytes (+0.50%) +651 bytes
146777 bytes +451 bytes (+0.31%) +366 bytes
146773 bytes +447 bytes (+0.31%) +362 bytes
146775 bytes +449 bytes (+0.31%) +364 bytes
146656 bytes +330 bytes (+0.23%) +245 bytes
146680 bytes +354 bytes (+0.24%) +269 bytes
146486 bytes +160 bytes (+0.11%) +75 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 99581 bytes -46745 bytes (-31.95%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 118181 bytes -28145 bytes (-19.23%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 118630 bytes -27696 bytes (-18.93%)
Brotli (Wikipedia) brotli brotli -q 11 124439 bytes -21887 bytes (-14.96%)
LZMA2 (Wikipedia) xz xz -9 124908 bytes -21418 bytes (-14.64%)
Zstandard (Wikipedia) zstd zstd -19 131435 bytes -14891 bytes (-10.18%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 132399 bytes -13927 bytes (-9.52%)

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.