Choose a version:
53% The original file has 1181185 bytes (1,153.5k) and is available from the project website.
There you can find the official minified version, too, which brings down the size to 623549 bytes (608.9k, 53%).

After GZIP compression these minified files vary in size:
unpkg
  208951 bytes (204.1k)
CDN
gzip -6 (default)
  154302 bytes (150.7k)
local copy
jsdelivr
  154215 bytes (150.6k)
CDN
gzip -9
  153749 bytes (150.1k)
local copy
libdeflate -12
  148589 bytes (145.1k)
local copy
zultra
  148275 bytes (144.8k)
local copy
7zip -mx=9 -tgzip
  148273 bytes (144.8k)
local copy
pigz -11 -n
  148021 bytes (144.6k)
local copy
kzip -s0 -rn -b0
  148017 bytes (144.5k)
local copy
Zopfli
  148002 bytes (144.5k)
local copy
Zopfli (defluff)
  147997 bytes (144.5k)
local copy

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

You will automatically get the smallest ThreeJS 140 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 6213 bytes by using my ThreeJS 140 Zopfli version instead of the best available CDN (4.20% smaller than jsdelivr, 148002 vs. 154215 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 --mls64 --bsr30 --lazy --ohh

(found May 5, 2022)
Description Value Parameter
iterations 1000000  --i1000000
maximum blocks 8  --mb8
maximum length score 64  --mls64
block splitting recursion 30  --bsr30
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 (147997 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/r140/build/three.min.js --location | md5sum
a26142391a19d57bd5745cf1cc159eca  -
curl --silent --compressed https://minime.stephan-brumme.com/files/threejs/three-r140.min.zopfli.js.gz | md5sum
a26142391a19d57bd5745cf1cc159eca  -

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

All listed CDNs deliver identical contents:
CDN Size (compressed) MD5 (uncompressed) Timestamp
unpkg 208951 bytes a26142391a19d57bd5745cf1cc159eca (invalid)
jsdelivr 154215 bytes a26142391a19d57bd5745cf1cc159eca May 2, 2022 @ 15:50

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
148002 bytes -4 bytes zopfli --i1000000 --mls64 --bsr30 --lazy --ohh May 5, 2022 @ 12:07
148006 bytes -7 bytes zopfli --i100000 --mls64 --bsr30 --lazy --ohh May 3, 2022 @ 18:00
148013 bytes -1 byte zopfli --i10000 --mls64 --bsr30 --lazy --ohh May 3, 2022 @ 10:28
148014 bytes -10 bytes zopfli --i10000 --mls64 --bsr22 --lazy --ohh May 3, 2022 @ 00:11
148024 bytes -2 bytes zopfli --i10000 --mls16 --bsr11 --lazy --ohh May 2, 2022 @ 21:41
148026 bytes -28 bytes zopfli --i1000 --mls64 --bsr16 --lazy --ohh May 2, 2022 @ 16:23
148054 bytes zopfli --i100 --mls4 --bsr18 --lazy --ohh May 2, 2022 @ 16:09

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

Most recent activity on May 5, 2022 @ 13:33.

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
148091 148040 148071 148203 148094 148180 148043 148055 148172 148051 148071 148093 148183 148129 148142
148103 148064 148066 148058 148066 148079 148047 148049 148058 148097 148060 148084 148051 148018 148088
148048 148025 148030 148018 148033 148038 148063 148056 148055 148058 148043 148063 148033 148025 148081
148078 148052 148068 148053 148062 148073 148191 148053 148046 148225 148025 148199 148052 148023 148040
148080 148083 148086 148053 148056 148038 148017 148019 148020 148026 148032 148060 148016 148026 148066
148037 148040 148020 148015 148040 148028 148036 148038 148042 148033 148030 148034 148044 148027 148039
148069 148061 148213 148059 148052 148032 148175 148196 148032 148055 148016 148027 148034 148093 148042
148194 148066 148053 148024 148038 148016 148031 148035 148015 148042 148023 148059 148043 148021 148058
148039 148026 148047 148047 148035 148033 148027 148026 148026 148065 148031 148038 148046 148065 148037
148048 148051 148054 148041 148044 148040 148035 148032 148037 148026 148029 148041 148043 148016 148073
148071 148043 148055 148049 148067 148054 148183 148034 148042 148063 148039 148058 148036 148018 148084
148034 148066 148026 148041 148043 148020 148057 148017 148016 148034 148030 148028 148033 148016 148031
148043 148047 148026 148016 148046 148014 148036 148031 148050 148021 148032 148037 148049 148023 148040
148068 148077 148040 148044 148048 148024 148048 148041 148034 148015 148028 148058 148035 148029 148075
148044 148020 148053 148041 148043 148029 148045 148039 148033 148044 148028 148055 148061 148033 148054
148034 148050 148026 148037 148045 148028 148038 148028 148040 148034 148033 148037 148054 148018 148033
148195 148047 148196 148025 148040 148042 148176 148032 148039 148021 148063 148037 148050 148062 148072
148046 148060 148034 148037 148040 148022 148025 148039 148016 148023 148025 148043 148049 148024 148044
148035 148053 148016 148031 148028 148014 148039 148018 148043 148058 148024 148032 148027 148068 148033
148062 148053 148025 148027 148043 148025 148033 148034 148039 148022 148030 148056 148055 148015 148071
148042 148024 148047 148032 148050 148024 148030 148039 148061 148020 148044 148036 148054 148020 148034
148036 148058 148027 148042 148043 148002 148021 148007 148044 148021 148030 148034 148031 148052 148045
148034 148053 148023 148026 148037 148025 148015 148040 148017 148022 148034 148039 148042 148046 148049

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 148054 bytes 100%
1,000 148026 bytes -28 bytes 100%
10,000 148013 bytes -13 bytes 100%
100,000 148006 bytes -7 bytes 0.58%
1,000,000 148002 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
148017 bytes +15 bytes (+0.01%)
148515 bytes +513 bytes (+0.35%) +498 bytes
148537 bytes +535 bytes (+0.36%) +520 bytes
148231 bytes +229 bytes (+0.15%) +214 bytes
148259 bytes +257 bytes (+0.17%) +242 bytes
148247 bytes +245 bytes (+0.17%) +230 bytes
148223 bytes +221 bytes (+0.15%) +206 bytes
148167 bytes +165 bytes (+0.11%) +150 bytes
148180 bytes +178 bytes (+0.12%) +163 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 100204 bytes -47798 bytes (-32.30%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 115617 bytes -32385 bytes (-21.88%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 119294 bytes -28708 bytes (-19.40%)
Brotli (Wikipedia) brotli brotli -q 11 125879 bytes -22123 bytes (-14.95%)
LZMA2 (Wikipedia) xz xz -9 126224 bytes -21778 bytes (-14.71%)
Zstandard (Wikipedia) zstd zstd -19 132434 bytes -15568 bytes (-10.52%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 133480 bytes -14522 bytes (-9.81%)

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.