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

After GZIP compression these minified files vary in size:
unpkg
  184760 bytes (180.4k)
CDN
Boot
  150637 bytes (147.1k)
CDN
gzip -6 (default)
  150139 bytes (146.6k)
local copy
jsdelivr
  149998 bytes (146.5k)
CDN
gzip -9
  149663 bytes (146.2k)
local copy
libdeflate -12
  144602 bytes (141.2k)
local copy
7zip -mx=9 -tgzip
  144424 bytes (141.0k)
local copy
zultra
  144249 bytes (140.9k)
local copy
kzip -s0 -rn -b0
  144154 bytes (140.8k)
local copy
pigz -11 -n
  144104 bytes (140.7k)
local copy
Zopfli
  144047 bytes (140.7k)
local copy
Zopfli (defluff)
  144041 bytes (140.7k)
local copy

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

You will automatically get the smallest ThreeJS 127 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 5951 bytes by using my ThreeJS 127 Zopfli version instead of the best available CDN (4.13% smaller than jsdelivr, 144047 vs. 149998 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 --bsr4 --lazy --ohh

(found April 9, 2021)
Description Value Parameter
iterations 1000000  --i1000000
maximum blocks 8  --mb8
maximum length score 8192  --mls8192
block splitting recursion 4  --bsr4
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 6 more bytes (144041 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/r127/build/three.min.js --location | md5sum
7ef8dcaa819755df7eb962b547bf76b8  -
curl --silent --compressed https://minime.stephan-brumme.com/files/threejs/three-r127.min.zopfli.js.gz | md5sum
7ef8dcaa819755df7eb962b547bf76b8  -

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

All listed CDNs deliver identical contents:
CDN Size (compressed) MD5 (uncompressed) Timestamp
unpkg 184760 bytes 7ef8dcaa819755df7eb962b547bf76b8 (invalid)
Boot 150637 bytes 7ef8dcaa819755df7eb962b547bf76b8 (invalid)
jsdelivr 149998 bytes 7ef8dcaa819755df7eb962b547bf76b8 April 6, 2021 @ 16:17

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
144047 bytes -5 bytes zopfli --i1000000 --mls8192 --bsr4 --lazy --ohh April 9, 2021 @ 20:19
144052 bytes -3 bytes zopfli --i100000 --mls8192 --bsr4 --lazy --ohh April 8, 2021 @ 14:54
144055 bytes -3 bytes zopfli --i100000 --mls2048 --bsr21 --lazy --ohh April 8, 2021 @ 14:36
144058 bytes -12 bytes zopfli --i10000 --mls8192 --bsr4 --lazy --ohh April 7, 2021 @ 09:08
144070 bytes -2 bytes zopfli --i10000 --mls2048 --bsr25 --lazy --ohh April 7, 2021 @ 08:29
144072 bytes -9 bytes zopfli --i1000 --mls8192 --bsr4 --lazy --ohh April 6, 2021 @ 19:05
144081 bytes -4 bytes zopfli --i1000 --mls8192 --bsr18 --lazy --ohh April 6, 2021 @ 18:19
144085 bytes -1 byte zopfli --i1000 --mls8192 --bsr16 --lazy --ohh April 6, 2021 @ 17:43
144086 bytes -3 bytes zopfli --i1000 --mls8192 --bsr17 --lazy --ohh April 6, 2021 @ 17:38
144089 bytes -2 bytes zopfli --i1000 --mls2048 --bsr19 --lazy --ohh April 6, 2021 @ 17:34
144091 bytes -26 bytes zopfli --i1000 --mls2048 --bsr40 --lazy --ohh April 6, 2021 @ 17:26
144117 bytes zopfli --i100 --mls2048 --bsr19 --lazy --ohh April 6, 2021 @ 16:37

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

Most recent activity on April 12, 2021 @ 12:18.

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
144308 144314 144307 144305 144257 144262 144276 144273 144273 144281 144239 144213 144224 144242 144186
144189 144171 144156 144149 144161 144274 144259 144267 144280 144212 144248 144186 144047 144108 144143
144169 144159 144301 144300 144198 144271 144193 144172 144262 144193 144168 144196 144085 144099 144133
144168 144173 144167 144133 144176 144087 144080 144157 144146 144162 144161 144156 144157 144083 144135
144150 144146 144241 144204 144160 144103 144110 144177 144159 144170 144166 144217 144126 144095 144117
144272 144156 144191 144186 144160 144197 144197 144164 144138 144157 144189 144188 144088 144098 144128
144177 144252 144226 144243 144109 144188 144097 144142 144190 144210 144207 144189 144156 144168 144136
144144 144164 144154 144158 144150 144147 144107 144145 144206 144178 144151 144170 144212 144074 144120
144243 144239 144300 144097 144190 144194 144187 144189 144168 144174 144154 144162 144078 144091 144121
144298 144188 144193 144202 144194 144188 144189 144301 144255 144211 144142 144199 144083 144093 144177
144263 144261 144253 144221 144194 144276 144194 144183 144155 144159 144159 144155 144081 144097 144137
144235 144235 144285 144197 144190 144190 144193 144195 144194 144285 144163 144154 144165 144097 144165
144146 144160 144253 144197 144192 144190 144186 144248 144265 144297 144155 144153 144070 144133 144122
144263 144313 144143 144220 144085 144193 144187 144193 144150 144151 144150 144150 144075 144166 144162
144143 144253 144201 144161 144249 144244 144204 144142 144192 144201 144070 144159 144073 144146 144140
144321 144295 144181 144183 144311 144321 144316 144261 144163 144194 144069 144253 144125 144149 144123
144243 144236 144244 144168 144136 144233 144310 144152 144143 144142 144073 144173 144080 144176 144112
144154 144259 144167 144168 144292 144204 144186 144187 144182 144168 144055 144151 144073 144165 144153
144209 144303 144328 144208 144188 144273 144211 144158 144150 144188 144160 144149 144117 144069 144119
144262 144319 144253 144259 144189 144216 144286 144152 144152 144153 144153 144133 144121 144160 144158
144166 144157 144164 144232 144189 144146 144159 144153 144155 144144 144070 144156 144074 144161 144177
144260 144216 144259 144191 144292 144284 144314 144153 144168 144143 144140 144151 144156 144172 144128
144263 144167 144311 144167 144187 144293 144328 144193 144150 144189 144071 144144 144117 144170 144126

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 144117 bytes 100%
1,000 144072 bytes -45 bytes 100%
10,000 144058 bytes -14 bytes 100%
100,000 144052 bytes -6 bytes 0.58%
1,000,000 144047 bytes -5 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
144154 bytes +107 bytes (+0.07%)
144518 bytes +471 bytes (+0.33%) +364 bytes
144525 bytes +478 bytes (+0.33%) +371 bytes
144269 bytes +222 bytes (+0.15%) +115 bytes
144260 bytes +213 bytes (+0.15%) +106 bytes
144255 bytes +208 bytes (+0.14%) +101 bytes
144242 bytes +195 bytes (+0.14%) +88 bytes
144228 bytes +181 bytes (+0.13%) +74 bytes
144166 bytes +119 bytes (+0.08%) +12 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 97113 bytes -46934 bytes (-32.58%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 111763 bytes -32284 bytes (-22.41%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 115716 bytes -28331 bytes (-19.67%)
Brotli (Wikipedia) brotli brotli -q 11 121545 bytes -22502 bytes (-15.62%)
LZMA2 (Wikipedia) xz xz -9 121976 bytes -22071 bytes (-15.32%)
Zstandard (Wikipedia) zstd zstd -19 128045 bytes -16002 bytes (-11.11%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 129255 bytes -14792 bytes (-10.27%)

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.