Choose a version:
52% The original file has 1166386 bytes (1,139.0k) and is available from the project website.
There you can find the official minified version, too, which brings down the size to 606296 bytes (592.1k, 52%).

After GZIP compression these minified files vary in size:
unpkg
  223130 bytes (217.9k)
CDN
gzip -6 (default)
  152430 bytes (148.9k)
local copy
jsdelivr
  152322 bytes (148.8k)
CDN
gzip -9
  151938 bytes (148.4k)
local copy
libdeflate -12
  146699 bytes (143.3k)
local copy
zultra
  146388 bytes (143.0k)
local copy
7zip -mx=9 -tgzip
  146347 bytes (142.9k)
local copy
kzip -s0 -rn -b0
  146099 bytes (142.7k)
local copy
pigz -11 -n
  145980 bytes (142.6k)
local copy
Zopfli
  145964 bytes (142.5k)
local copy
Zopfli (defluff)
  145963 bytes (142.5k)
local copy

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

You will automatically get the smallest ThreeJS 146 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 6358 bytes by using my ThreeJS 146 Zopfli version instead of the best available CDN (4.36% smaller than jsdelivr, 145964 vs. 152322 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 --bsr40 --lazy --ohh

(found January 10, 2023)
Description Value Parameter
iterations 1000000  --i1000000
maximum blocks 8  --mb8
maximum length score 8192  --mls8192
block splitting recursion 40  --bsr40
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 1 more byte (145963 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/r146/build/three.min.js --location | md5sum
17dc693e3b7b4b28a5b743ab9a799945  -
curl --silent --compressed https://minime.stephan-brumme.com/files/threejs/three-r146.min.zopfli.js.gz | md5sum
17dc693e3b7b4b28a5b743ab9a799945  -

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

All listed CDNs deliver identical contents:
CDN Size (compressed) MD5 (uncompressed) Timestamp
unpkg 223130 bytes 17dc693e3b7b4b28a5b743ab9a799945 (invalid)
jsdelivr 152322 bytes 17dc693e3b7b4b28a5b743ab9a799945 January 3, 2023 @ 16:22

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
145964 bytes -4 bytes zopfli --i1000000 --mls8192 --bsr40 --lazy --ohh January 10, 2023 @ 13:14
145968 bytes -6 bytes zopfli --i100000 --mls8192 --bsr40 --lazy --ohh January 6, 2023 @ 20:31
145974 bytes -3 bytes zopfli --i10000 --mls8192 --bsr40 --lazy --ohh January 6, 2023 @ 16:04
145977 bytes -21 bytes zopfli --i10000 --mls16384 --bsr9 --lazy --ohh January 6, 2023 @ 05:51
145998 bytes -23 bytes zopfli --i1000 --mls8192 --bsr40 --lazy --ohh January 3, 2023 @ 20:33
146021 bytes zopfli --i100 --mls8192 --bsr40 --lazy --ohh January 3, 2023 @ 17:51

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

Most recent activity on January 10, 2023 @ 13:24.

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
146172 146148 146137 146200 146140 146126 146174 146196 146141 146134 146126 146119 146090 146032 146156
146124 146146 146120 146113 146095 146147 146111 146112 146110 146113 146113 146116 146011 146115 146148
146093 146089 146089 146118 146083 146114 146086 146104 146081 146083 146048 146022 146089 146083 146126
146137 146094 146085 146082 146102 146086 146271 146082 146092 146095 146068 146070 145989 145995 146142
146111 146108 146104 146097 146085 146112 146108 146085 146088 146115 145985 146082 146085 146107 146107
146099 146100 146100 146096 146096 146073 146098 146082 146088 146081 146067 146028 146104 145977 146127
146097 146155 146133 146110 146137 146136 146101 146130 146077 146245 146067 146093 146083 146035 146108
146120 146110 146098 146074 146083 146088 146113 146080 146084 146097 146070 146070 146079 146080 146078
146104 146083 146093 146076 146076 146094 146081 146079 146075 146083 146066 146077 146094 146082 146107
146093 146096 146099 146095 146099 146093 146122 146078 146085 146108 146074 146097 146114 146078 146088
146141 146097 146102 146081 146087 146095 146078 146087 146087 146081 146077 146064 145987 146106 146095
146120 146081 146114 146080 146079 146080 146095 146076 146074 146071 146069 146007 146086 146078 146106
146134 146089 146090 146083 146091 146096 146088 146086 146083 146086 146068 146084 146119 146075 146101
146101 146092 146083 146088 146097 146094 146080 146080 146090 146087 146083 146055 146091 146089 146086
146115 146096 146112 146088 146124 146116 146089 146085 146083 146081 146089 146065 146072 146101 146106
146100 146108 146113 146085 146079 146095 146080 146065 146096 146098 146064 146093 146071 146081 146109
146093 146089 146105 146073 146080 146096 146108 146078 146081 146090 146082 146095 146120 146081 146083
146117 146083 146095 146106 146108 146089 146084 146080 146075 146091 146060 146081 146109 146084 146086
146111 146091 146108 146085 146078 146113 146092 146088 146082 146083 146066 146080 146084 146080 146107
146123 146097 146088 146079 146104 146081 146097 146080 146095 146079 146073 146008 146083 146136 146103
146121 146091 146098 146092 146099 146098 146079 146082 146075 146078 146072 146085 146118 146085 146108
146123 146101 146096 146084 146099 146088 146094 146068 146101 146096 146067 146065 146080 146090 146112
146110 146096 146106 146079 146081 146081 146092 146067 146075 146092 146063 146065 145964 146032 146081

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 146021 bytes 100%
1,000 145998 bytes -23 bytes 100%
10,000 145974 bytes -24 bytes 100%
100,000 145968 bytes -6 bytes 0.29%
1,000,000 145964 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
146099 bytes +135 bytes (+0.09%)
146766 bytes +802 bytes (+0.55%) +667 bytes
146722 bytes +758 bytes (+0.52%) +623 bytes
146423 bytes +459 bytes (+0.31%) +324 bytes
146437 bytes +473 bytes (+0.32%) +338 bytes
146407 bytes +443 bytes (+0.30%) +308 bytes
146325 bytes +361 bytes (+0.25%) +226 bytes
146307 bytes +343 bytes (+0.23%) +208 bytes
146143 bytes +179 bytes (+0.12%) +44 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 99283 bytes -46681 bytes (-31.98%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 117901 bytes -28063 bytes (-19.23%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 118363 bytes -27601 bytes (-18.91%)
Brotli (Wikipedia) brotli brotli -q 11 124095 bytes -21869 bytes (-14.98%)
LZMA2 (Wikipedia) xz xz -9 124584 bytes -21380 bytes (-14.65%)
Zstandard (Wikipedia) zstd zstd -19 131094 bytes -14870 bytes (-10.19%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 132114 bytes -13850 bytes (-9.49%)

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.