Choose a version:
52% The original file has 966900 bytes (944.2k) and is available from the project website.
There you can find the official minified version, too, which brings down the size to 507498 bytes (495.6k, 52%).

After GZIP compression these minified files vary in size:
Boot
  145671 bytes (142.3k)
CDN
cdnjs
  120917 bytes (118.1k)
CDN
unpkg
  120390 bytes (117.6k)
CDN
gzip -6 (default)
  119637 bytes (116.8k)
local copy
Google
  119549 bytes (116.7k)
CDN
gzip -9
  119203 bytes (116.4k)
local copy
libdeflate -12
  114958 bytes (112.3k)
local copy
7zip -mx=9 -tgzip
  114878 bytes (112.2k)
local copy
zultra
  114877 bytes (112.2k)
local copy
pigz -11 -n
  114543 bytes (111.9k)
local copy
kzip -s0 -rn -b0
  114510 bytes (111.8k)
local copy
Zopfli
  114483 bytes (111.8k)
local copy
Zopfli (defluff)
  114481 bytes (111.8k)
local copy

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

You will automatically get the smallest ThreeJS 77 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 5066 bytes by using my ThreeJS 77 Zopfli version instead of the best available CDN (4.43% smaller than Google, 114483 vs. 119549 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 --bsr21 --lazy --ohh

(found May 24, 2016)
Description Value Parameter
iterations 1000000  --i1000000
maximum blocks 8  --mb8
maximum length score 8192  --mls8192
block splitting recursion 21  --bsr21
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 (114481 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/r77/build/three.min.js --location | md5sum
f0e8cccfb631c5b5571889c857d6600a  -
curl --silent --compressed https://minime.stephan-brumme.com/files/threejs/three-r77.min.zopfli.js.gz | md5sum
f0e8cccfb631c5b5571889c857d6600a  -

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

These CDNs send you the original file:
CDN Size (compressed) MD5 (uncompressed) Timestamp
Google 119549 bytes f0e8cccfb631c5b5571889c857d6600a December 20, 2016 @ 14:06

And some CDNs send you a different file:
CDN Size (compressed) MD5 (uncompressed) Comment / Diff Timestamp
Boot 145671 bytes 5751a8e036c643ab20312ac8845f9c87 < g;++f)b[f].evaluate(c),e[f].accumulate(d,a)}},_updateWeigh [...]
< this.timeScale=b)}}return this._effectiveTimeScale=b},_upd [...]
> g;++f)b[f].evaluate(c),e[f].accumulate(d,a)}},_updateWeigh [...]
> this.timeScale=b)}}return this._effectiveTimeScale=b},_upd [...]
< THREE.WebGLExtensions=function(a){var b={};this.get=functi [...]
> THREE.WebGLExtensions=function(a){var b={};this.get=functi [...]
(invalid)
cdnjs 120917 bytes 5751a8e036c643ab20312ac8845f9c87 < g;++f)b[f].evaluate(c),e[f].accumulate(d,a)}},_updateWeigh [...]
< this.timeScale=b)}}return this._effectiveTimeScale=b},_upd [...]
> g;++f)b[f].evaluate(c),e[f].accumulate(d,a)}},_updateWeigh [...]
> this.timeScale=b)}}return this._effectiveTimeScale=b},_upd [...]
< THREE.WebGLExtensions=function(a){var b={};this.get=functi [...]
> THREE.WebGLExtensions=function(a){var b={};this.get=functi [...]
(invalid)
unpkg 120390 bytes ae0d7d3323c69bdfcb6872bedeada8b0 < // threejs.org/license
> var self = self || {};// threejs.org/license
>
> // Export the THREE object for **Node.js**, with
> // backwards-compatibility for the old `require()` API. If [...]
> // the browser, add `_` as a global object via a string id [...]
> // for Closure Compiler "advanced" mode.
> if (typeof exports !== 'undefined') {
> if (typeof module !== 'undefined' && module.exports) {
> exports = module.exports = THREE;
[...]
July 11, 2016 @ 15:49

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
114483 bytes -4 bytes zopfli --i1000000 --mls8192 --bsr21 --lazy --ohh May 24, 2016 @ 09:54
114487 bytes -6 bytes zopfli --i100000 --mls8192 --bsr21 --lazy --ohh May 21, 2016 @ 04:09
114493 bytes -14 bytes zopfli --i10000 --mls8192 --bsr21 --lazy --ohh May 21, 2016 @ 01:26
114507 bytes -17 bytes zopfli --i1000 --mls8192 --bsr21 --lazy --ohh May 20, 2016 @ 23:05
114524 bytes zopfli --i100 --mls8192 --bsr21 --lazy --ohh May 20, 2016 @ 22:51

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 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
114668 114668 114669 114670 114670 114641 114664 114629 114771 114626 114656 114631 114612 114650 114731
114557 114547 114597 114566 114596 114545 114578 114568 114579 114578 114572 114559 114562 114560 114596
114550 114554 114537 114686 114646 114685 114679 114551 114667 114583 114555 114532 114554 114560 114558
114545 114572 114589 114540 114537 114547 114536 114504 114537 114563 114532 114530 114543 114543 114536
114548 114546 114551 114548 114544 114545 114543 114544 114554 114549 114536 114544 114539 114555 114572
114656 114658 114655 114669 114650 114665 114666 114643 114650 114649 114542 114542 114536 114591 114568
114546 114566 114665 114660 114661 114665 114667 114672 114642 114550 114555 114538 114533 114538 114587
114553 114552 114552 114652 114662 114648 114668 114551 114534 114551 114543 114545 114524 114555 114580
114563 114564 114566 114653 114635 114542 114666 114552 114546 114533 114535 114537 114540 114535 114577
114541 114558 114537 114535 114556 114554 114546 114534 114545 114586 114541 114532 114540 114545 114577
114542 114548 114546 114543 114538 114546 114540 114550 114541 114553 114558 114532 114536 114539 114533
114545 114548 114546 114530 114548 114547 114542 114516 114530 114548 114546 114526 114554 114543 114530
114542 114547 114541 114534 114574 114569 114569 114540 114534 114552 114545 114527 114520 114560 114592
114550 114552 114544 114543 114533 114556 114554 114565 114531 114530 114538 114534 114533 114551 114572
114558 114550 114551 114531 114543 114542 114556 114515 114503 114551 114541 114532 114538 114542 114572
114537 114547 114547 114530 114535 114538 114527 114540 114535 114535 114535 114552 114542 114566 114580
114542 114540 114539 114653 114543 114667 114668 114546 114547 114544 114544 114538 114533 114539 114576
114544 114537 114656 114658 114655 114666 114668 114499 114533 114546 114535 114530 114483 114544 114559
114553 114551 114658 114653 114645 114663 114663 114533 114644 114642 114544 114528 114542 114552 114538
114543 114549 114550 114652 114656 114663 114662 114545 114555 114548 114541 114527 114537 114550 114559
114548 114544 114542 114525 114651 114553 114542 114546 114526 114530 114544 114519 114522 114539 114574
114527 114538 114533 114530 114536 114546 114540 114499 114531 114549 114543 114530 114540 114537 114573
114544 114543 114548 114527 114538 114546 114544 114532 114519 114523 114529 114536 114541 114557 114570

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 114524 bytes 100%
1,000 114507 bytes -17 bytes 100%
10,000 114493 bytes -14 bytes 100%
100,000 114487 bytes -6 bytes 0.29%
1,000,000 114483 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
114510 bytes +27 bytes (+0.02%)
115106 bytes +623 bytes (+0.54%) +596 bytes
115095 bytes +612 bytes (+0.53%) +585 bytes
114954 bytes +471 bytes (+0.41%) +444 bytes
114793 bytes +310 bytes (+0.27%) +283 bytes
114754 bytes +271 bytes (+0.24%) +244 bytes
114769 bytes +286 bytes (+0.25%) +259 bytes
114631 bytes +148 bytes (+0.13%) +121 bytes
114578 bytes +95 bytes (+0.08%) +68 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 77952 bytes -36531 bytes (-31.91%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 89411 bytes -25072 bytes (-21.90%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 94268 bytes -20215 bytes (-17.66%)
Brotli (Wikipedia) brotli brotli -q 11 99630 bytes -14853 bytes (-12.97%)
LZMA2 (Wikipedia) xz xz -9 100428 bytes -14055 bytes (-12.28%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 103603 bytes -10880 bytes (-9.50%)
Zstandard (Wikipedia) zstd zstd -19 105963 bytes -8520 bytes (-7.44%)

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.