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

After GZIP compression these minified files vary in size:
cdnjs
  135025 bytes (131.9k)
CDN
unpkg
  133791 bytes (130.7k)
CDN
jsdelivr
  133554 bytes (130.4k)
CDN
gzip -6 (default)
  133527 bytes (130.4k)
local copy
gzip -9
  133046 bytes (129.9k)
local copy
libdeflate -12
  128604 bytes (125.6k)
local copy
7zip -mx=9 -tgzip
  128534 bytes (125.5k)
local copy
zultra
  128488 bytes (125.5k)
local copy
pigz -11 -n
  128218 bytes (125.2k)
local copy
kzip -s0 -rn -b0
  128187 bytes (125.2k)
local copy
Zopfli
  128151 bytes (125.1k)
local copy
Zopfli (defluff)
  128147 bytes (125.1k)
local copy

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

You will automatically get the smallest ThreeJS 89 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 5403 bytes by using my ThreeJS 89 Zopfli version instead of the best available CDN (4.22% smaller than jsdelivr, 128151 vs. 133554 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 --bsr23 --lazy --ohh

(found December 22, 2017)
Description Value Parameter
iterations 1000000  --i1000000
maximum blocks 8  --mb8
maximum length score 8192  --mls8192
block splitting recursion 23  --bsr23
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 4 more bytes (128147 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/r89/build/three.min.js --location | md5sum
659b77f6f5ce244863746281dd716762  -
curl --silent --compressed https://minime.stephan-brumme.com/files/threejs/three-r89.min.zopfli.js.gz | md5sum
659b77f6f5ce244863746281dd716762  -

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

All listed CDNs deliver identical contents:
CDN Size (compressed) MD5 (uncompressed) Timestamp
cdnjs 135025 bytes 659b77f6f5ce244863746281dd716762 (invalid)
unpkg 133791 bytes 659b77f6f5ce244863746281dd716762 (invalid)
jsdelivr 133554 bytes 659b77f6f5ce244863746281dd716762 December 19, 2017 @ 20:25

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
128151 bytes -4 bytes zopfli --i1000000 --mls8192 --bsr23 --lazy --ohh December 22, 2017 @ 01:19
128155 bytes -6 bytes zopfli --i100000 --mls8192 --bsr23 --lazy --ohh December 20, 2017 @ 03:46
128161 bytes -12 bytes zopfli --i10000 --mls8192 --bsr23 --lazy --ohh December 20, 2017 @ 00:22
128173 bytes -1 byte zopfli --i1000 --mls8192 --bsr23 --lazy --ohh December 19, 2017 @ 23:09
128174 bytes -4 bytes zopfli --i1000 --mls8192 --bsr15 --lazy --ohh December 19, 2017 @ 22:56
128178 bytes -2 bytes zopfli --i1000 --mls8192 --bsr19 --lazy --ohh December 19, 2017 @ 22:54
128180 bytes -15 bytes zopfli --i1000 --mls8192 --bsr40 --lazy --ohh December 19, 2017 @ 22:54
128195 bytes zopfli --i100 --mls8192 --bsr19 --lazy --ohh December 19, 2017 @ 20:42

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

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
128363 128351 128355 128300 128503 128339 128348 128354 128249 128413 128277 128298 128183 128259 128275
128283 128275 128278 128201 128270 128207 128196 128219 128278 128211 128234 128184 128237 128183 128285
128218 128266 128265 128215 128190 128198 128200 128205 128219 128211 128226 128219 128207 128295 128289
128275 128285 128277 128278 128213 128201 128216 128196 128222 128193 128218 128209 128166 128235 128224
128228 128290 128279 128213 128206 128292 128196 128220 128237 128233 128240 128202 128215 128220 128231
128268 128280 128282 128292 128266 128271 128275 128216 128297 128220 128220 128213 128209 128230 128296
128271 128281 128281 128210 128268 128202 128187 128222 128281 128220 128276 128220 128207 128237 128234
128217 128272 128284 128194 128268 128210 128196 128195 128279 128198 128217 128213 128166 128217 128220
128267 128265 128276 128277 128276 128271 128210 128216 128266 128191 128198 128228 128168 128233 128223
128216 128217 128218 128270 128211 128218 128206 128216 128222 128221 128215 128220 128158 128217 128219
128215 128276 128270 128272 128271 128195 128195 128194 128287 128292 128281 128228 128194 128228 128220
128269 128274 128280 128268 128267 128181 128282 128195 128281 128216 128218 128223 128164 128313 128222
128268 128274 128294 128276 128273 128275 128280 128213 128214 128192 128299 128186 128180 128231 128221
128275 128280 128274 128266 128261 128270 128191 128218 128281 128218 128219 128221 128208 128223 128224
128270 128275 128274 128272 128269 128272 128267 128220 128280 128193 128281 128216 128158 128272 128229
128218 128213 128274 128273 128214 128285 128209 128208 128274 128219 128220 128220 128166 128225 128219
128212 128218 128220 128195 128214 128217 128211 128221 128220 128220 128217 128219 128210 128222 128223
128210 128217 128273 128280 128211 128275 128189 128221 128277 128218 128219 128220 128209 128220 128224
128272 128279 128273 128197 128208 128183 128190 128219 128282 128222 128220 128196 128169 128219 128218
128272 128279 128270 128197 128270 128184 128270 128200 128278 128188 128216 128222 128151 128235 128222
128274 128273 128277 128194 128208 128201 128267 128199 128280 128199 128216 128217 128168 128230 128231
128267 128281 128272 128210 128267 128184 128269 128221 128279 128219 128278 128231 128173 128233 128221
128215 128214 128217 128212 128270 128183 128217 128193 128281 128221 128220 128222 128166 128218 128227

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 128195 bytes 100%
1,000 128173 bytes -22 bytes 100%
10,000 128161 bytes -12 bytes 100%
100,000 128155 bytes -6 bytes 0.87%
1,000,000 128151 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
128187 bytes +36 bytes (+0.03%)
128779 bytes +628 bytes (+0.49%) +592 bytes
128762 bytes +611 bytes (+0.48%) +575 bytes
128519 bytes +368 bytes (+0.29%) +332 bytes
128416 bytes +265 bytes (+0.21%) +229 bytes
128332 bytes +181 bytes (+0.14%) +145 bytes
128329 bytes +178 bytes (+0.14%) +142 bytes
128298 bytes +147 bytes (+0.11%) +111 bytes
128322 bytes +171 bytes (+0.13%) +135 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 86383 bytes -41768 bytes (-32.59%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 99400 bytes -28751 bytes (-22.44%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 102997 bytes -25154 bytes (-19.63%)
Brotli (Wikipedia) brotli brotli -q 11 109324 bytes -18827 bytes (-14.69%)
LZMA2 (Wikipedia) xz xz -9 110004 bytes -18147 bytes (-14.16%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 114381 bytes -13770 bytes (-10.75%)
Zstandard (Wikipedia) zstd zstd -19 116351 bytes -11800 bytes (-9.21%)

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.