Choose a version:
50% The original file has 1121507 bytes (1,095.2k) and is available from the project website.
There you can find the official minified version, too, which brings down the size to 555650 bytes (542.6k, 50%).

After GZIP compression these minified files vary in size:
cdnjs
  140309 bytes (137.0k)
CDN
unpkg
  139146 bytes (135.9k)
CDN
gzip -6 (default)
  138843 bytes (135.6k)
local copy
jsdelivr
  138695 bytes (135.4k)
CDN
gzip -9
  138358 bytes (135.1k)
local copy
libdeflate -12
  133661 bytes (130.5k)
local copy
7zip -mx=9 -tgzip
  133624 bytes (130.5k)
local copy
zultra
  133446 bytes (130.3k)
local copy
kzip -s0 -rn -b6
  133305 bytes (130.2k)
local copy
pigz -11 -n
  133284 bytes (130.2k)
local copy
Zopfli
  133148 bytes (130.0k)
local copy
Zopfli (defluff)
  133146 bytes (130.0k)
local copy

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

You will automatically get the smallest ThreeJS 97 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 5547 bytes by using my ThreeJS 97 Zopfli version instead of the best available CDN (4.17% smaller than jsdelivr, 133148 vs. 138695 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 --bsr12 --lazy --ohh

(found September 28, 2018)
Description Value Parameter
iterations 1000000  --i1000000
maximum blocks 8  --mb8
maximum length score 4096  --mls4096
block splitting recursion 12  --bsr12
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 2 more bytes (133146 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/r97/build/three.min.js --location | md5sum
7ff632b03a827fd3539ff3c23a469300  -
curl --silent --compressed https://minime.stephan-brumme.com/files/threejs/three-r97.min.zopfli.js.gz | md5sum
7ff632b03a827fd3539ff3c23a469300  -

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

All listed CDNs deliver identical contents:
CDN Size (compressed) MD5 (uncompressed) Timestamp
cdnjs 140309 bytes 7ff632b03a827fd3539ff3c23a469300 (invalid)
unpkg 139146 bytes 7ff632b03a827fd3539ff3c23a469300 (invalid)
jsdelivr 138695 bytes 7ff632b03a827fd3539ff3c23a469300 September 27, 2018 @ 08:08

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
133148 bytes -2 bytes zopfli --i1000000 --mls4096 --bsr12 --lazy --ohh September 28, 2018 @ 19:26
133150 bytes -7 bytes zopfli --i100000 --mls4096 --bsr12 --lazy --ohh September 27, 2018 @ 15:33
133157 bytes -16 bytes zopfli --i10000 --mls4096 --bsr12 --lazy --ohh September 27, 2018 @ 11:06
133173 bytes -4 bytes zopfli --i1000 --mls4096 --bsr9 --lazy --ohh September 27, 2018 @ 08:51
133177 bytes -7 bytes zopfli --i1000 --mls4096 --bsr12 --lazy --ohh September 27, 2018 @ 08:51
133184 bytes -25 bytes zopfli --i1000 --mls4096 --bsr8 --lazy --ohh September 27, 2018 @ 08:51
133209 bytes zopfli --i100 --mls4096 --bsr8 --lazy --ohh September 27, 2018 @ 08:18

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

Most recent activity on July 20, 2020 @ 12:49.

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
133410 133411 133291 133411 133292 133308 133401 133459 133275 133421 133341 133284 133369 133221 133337
133436 133435 133432 133378 133442 133437 133431 133441 133227 133296 133421 133182 133357 133274 133457
133424 133284 133420 133397 133394 133412 133450 133172 133394 133261 133450 133219 133241 133311 133538
133377 133376 133353 133354 133374 133242 133376 133388 133378 133267 133423 133413 133252 133231 133387
133218 133217 133215 133373 133376 133382 133391 133381 133396 133437 133425 133161 133245 133224 133377
133221 133214 133236 133225 133416 133255 133390 133390 133368 133422 133289 133158 133251 133394 133419
133218 133395 133392 133222 133388 133215 133390 133401 133391 133399 133230 133232 133413 133409 133384
133392 133375 133256 133252 133414 133397 133378 133431 133398 133413 133386 133254 133424 133429 133421
133375 133379 133398 133385 133328 133377 133335 133336 133400 133388 133421 133148 133504 133416 133417
133396 133387 133391 133376 133385 133390 133384 133414 133399 133400 133386 133215 133385 133417 133403
133391 133388 133395 133390 133415 133395 133388 133417 133386 133400 133392 133209 133409 133422 133409
133387 133390 133213 133381 133378 133377 133384 133302 133400 133394 133423 133199 133482 133424 133400
133385 133380 133336 133382 133381 133244 133379 133416 133346 133395 133285 133192 133277 133412 133401
133333 133369 133373 133380 133379 133400 133400 133414 133381 133269 133395 133221 133442 133405 133414
133377 133370 133379 133376 133369 133243 133416 133274 133394 133255 133219 133202 133421 133393 133343
133365 133227 133389 133380 133389 133228 133415 133386 133384 133269 133421 133385 133416 133406 133405
133390 133389 133394 133419 133396 133389 133392 133412 133373 133426 133284 133219 133415 133409 133514
133217 133211 133222 133394 133368 133376 133386 133410 133372 133391 133286 133190 133387 133396 133522
133216 133373 133393 133388 133379 133376 133388 133414 133374 133256 133220 133190 133415 133409 133406
133373 133397 133379 133380 133379 133374 133391 133409 133329 133396 133421 133383 133386 133401 133409
133224 133380 133241 133236 133329 133383 133378 133230 133337 133425 133422 133208 133389 133406 133396
133217 133228 133218 133434 133380 133382 133395 133274 133384 133393 133368 133197 133386 133403 133349
133215 133227 133377 133382 133384 133381 133400 133422 133329 133420 133385 133223 133385 133394 133343

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 133209 bytes 100%
1,000 133173 bytes -36 bytes 100%
10,000 133157 bytes -16 bytes 100%
100,000 133150 bytes -7 bytes 0.87%
1,000,000 133148 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
133368 bytes +220 bytes (+0.17%) +63 bytes
133883 bytes +735 bytes (+0.55%) +578 bytes
133851 bytes +703 bytes (+0.53%) +546 bytes
133720 bytes +572 bytes (+0.43%) +415 bytes
133637 bytes +489 bytes (+0.37%) +332 bytes
133538 bytes +390 bytes (+0.29%) +233 bytes
133305 bytes +157 bytes (+0.12%)
133342 bytes +194 bytes (+0.15%) +37 bytes
133320 bytes +172 bytes (+0.13%) +15 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 89453 bytes -43695 bytes (-32.82%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 103060 bytes -30088 bytes (-22.60%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 106681 bytes -26467 bytes (-19.88%)
Brotli (Wikipedia) brotli brotli -q 11 113084 bytes -20064 bytes (-15.07%)
LZMA2 (Wikipedia) xz xz -9 113920 bytes -19228 bytes (-14.44%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 118875 bytes -14273 bytes (-10.72%)
Zstandard (Wikipedia) zstd zstd -19 119857 bytes -13291 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 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.