Choose a version:
49% The original file has 1071307 bytes (1,046.2k) and is available from the project website.
There you can find the official minified version, too, which brings down the size to 528431 bytes (516.0k, 49%).

After GZIP compression these minified files vary in size:
cdnjs
  135060 bytes (131.9k)
CDN
unpkg
  133890 bytes (130.8k)
CDN
gzip -6 (default)
  133582 bytes (130.5k)
local copy
jsdelivr
  133570 bytes (130.4k)
CDN
gzip -9
  133148 bytes (130.0k)
local copy
libdeflate -12
  128629 bytes (125.6k)
local copy
7zip -mx=9 -tgzip
  128585 bytes (125.6k)
local copy
zultra
  128484 bytes (125.5k)
local copy
pigz -11 -n
  128289 bytes (125.3k)
local copy
kzip -s0 -rn -b0
  128228 bytes (125.2k)
local copy
Zopfli
  128202 bytes (125.2k)
local copy
Zopfli (defluff)
  128194 bytes (125.2k)
local copy

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

You will automatically get the smallest ThreeJS 90 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 5368 bytes by using my ThreeJS 90 Zopfli version instead of the best available CDN (4.19% smaller than jsdelivr, 128202 vs. 133570 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 February 21, 2018)
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 8 more bytes (128194 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/r90/build/three.min.js --location | md5sum
8b9b380f1a9bad85ad32e54df7231ab4  -
curl --silent --compressed https://minime.stephan-brumme.com/files/threejs/three-r90.min.zopfli.js.gz | md5sum
8b9b380f1a9bad85ad32e54df7231ab4  -

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

All listed CDNs deliver identical contents:
CDN Size (compressed) MD5 (uncompressed) Timestamp
cdnjs 135060 bytes 8b9b380f1a9bad85ad32e54df7231ab4 (invalid)
unpkg 133890 bytes 8b9b380f1a9bad85ad32e54df7231ab4 (invalid)
jsdelivr 133570 bytes 8b9b380f1a9bad85ad32e54df7231ab4 February 15, 2018 @ 11:59

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
128202 bytes -3 bytes zopfli --i1000000 --mls8192 --bsr10 --lazy --ohh February 21, 2018 @ 11:03
128205 bytes -4 bytes zopfli --i100000 --mls8192 --bsr10 --lazy --ohh February 15, 2018 @ 23:11
128209 bytes -13 bytes zopfli --i10000 --mls8192 --bsr10 --lazy --ohh February 15, 2018 @ 18:47
128222 bytes -18 bytes zopfli --i1000 --mls8192 --bsr10 --lazy --ohh February 15, 2018 @ 17:27
128240 bytes -5 bytes zopfli --i1000 --mls16384 --bsr4 --lazy --ohh February 15, 2018 @ 17:22
128245 bytes -7 bytes zopfli --i1000 --mls4096 --bsr20 --lazy --ohh February 15, 2018 @ 17:07
128252 bytes zopfli --i100 --mls8192 --bsr10 --lazy --ohh February 15, 2018 @ 15:50

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:51.

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
128326 128334 128331 128330 128438 128381 128357 128360 128262 128357 128299 128281 128323 128324 128366
128253 128269 128311 128274 128271 128251 128322 128282 128268 128273 128270 128290 128260 128224 128274
128270 128253 128252 128257 128295 128245 128250 128250 128255 128244 128322 128260 128264 128281 128317
128331 128258 128332 128321 128318 128327 128271 128293 128264 128254 128304 128260 128262 128267 128285
128287 128273 128260 128265 128317 128311 128279 128317 128344 128331 128327 128263 128322 128266 128273
128322 128323 128324 128323 128313 128310 128326 128309 128324 128261 128272 128270 128267 128277 128275
128318 128318 128324 128257 128311 128307 128308 128309 128329 128267 128325 128279 128202 128276 128268
128327 128322 128322 128325 128325 128306 128321 128316 128328 128259 128272 128263 128257 128265 128271
128322 128323 128319 128320 128321 128314 128309 128271 128277 128261 128261 128254 128256 128264 128269
128270 128324 128325 128317 128314 128309 128261 128265 128271 128263 128268 128277 128257 128263 128280
128320 128322 128323 128316 128316 128308 128307 128313 128336 128261 128323 128324 128262 128291 128273
128327 128328 128318 128313 128316 128311 128311 128320 128325 128278 128262 128290 128264 128272 128274
128318 128322 128324 128324 128314 128314 128307 128315 128325 128260 128311 128260 128265 128277 128270
128320 128319 128315 128321 128315 128311 128317 128309 128340 128259 128264 128276 128264 128270 128281
128345 128314 128318 128254 128319 128311 128313 128320 128322 128252 128329 128261 128266 128271 128273
128320 128318 128326 128312 128322 128310 128262 128267 128267 128260 128273 128263 128253 128270 128270
128269 128276 128276 128323 128315 128325 128257 128261 128267 128254 128265 128236 128265 128280 128279
128309 128320 128320 128316 128310 128323 128264 128266 128320 128257 128269 128275 128261 128266 128274
128317 128319 128316 128319 128314 128308 128306 128311 128324 128259 128276 128271 128257 128273 128264
128321 128316 128315 128317 128312 128307 128307 128325 128328 128265 128266 128265 128269 128260 128268
128317 128320 128321 128320 128317 128312 128273 128263 128266 128261 128264 128268 128257 128272 128271
128319 128318 128323 128324 128320 128327 128311 128321 128324 128257 128319 128249 128261 128267 128271
128317 128316 128318 128323 128320 128326 128264 128263 128266 128255 128260 128266 128260 128280 128265

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 128252 bytes 100%
1,000 128222 bytes -30 bytes 100%
10,000 128209 bytes -13 bytes 100%
100,000 128205 bytes -4 bytes 0.58%
1,000,000 128202 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
128228 bytes +26 bytes (+0.02%)
128861 bytes +659 bytes (+0.51%) +633 bytes
128835 bytes +633 bytes (+0.49%) +607 bytes
128559 bytes +357 bytes (+0.28%) +331 bytes
128490 bytes +288 bytes (+0.22%) +262 bytes
128369 bytes +167 bytes (+0.13%) +141 bytes
128331 bytes +129 bytes (+0.10%) +103 bytes
128325 bytes +123 bytes (+0.10%) +97 bytes
128328 bytes +126 bytes (+0.10%) +100 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 86318 bytes -41884 bytes (-32.67%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 99224 bytes -28978 bytes (-22.60%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 102971 bytes -25231 bytes (-19.68%)
Brotli (Wikipedia) brotli brotli -q 11 108833 bytes -19369 bytes (-15.11%)
LZMA2 (Wikipedia) xz xz -9 109736 bytes -18466 bytes (-14.40%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 114048 bytes -14154 bytes (-11.04%)
Zstandard (Wikipedia) zstd zstd -19 116028 bytes -12174 bytes (-9.50%)

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.