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

After GZIP compression these minified files vary in size:
unpkg
  207550 bytes (202.7k)
CDN
gzip -6 (default)
  153349 bytes (149.8k)
local copy
jsdelivr
  153220 bytes (149.6k)
CDN
gzip -9
  152801 bytes (149.2k)
local copy
libdeflate -12
  147528 bytes (144.1k)
local copy
7zip -mx=9 -tgzip
  147358 bytes (143.9k)
local copy
zultra
  147336 bytes (143.9k)
local copy
pigz -11 -n
  147062 bytes (143.6k)
local copy
Zopfli
  147000 bytes (143.6k)
local copy
Zopfli (defluff)
  146999 bytes (143.6k)
local copy

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

You will automatically get the smallest ThreeJS 138 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 6220 bytes by using my ThreeJS 138 Zopfli version instead of the best available CDN (4.23% smaller than jsdelivr, 147000 vs. 153220 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 --mls4096 --bsr4 --lazy --ohh

(found March 2, 2022)
Description Value Parameter
iterations 1000000  --i1000000
maximum blocks 8  --mb8
maximum length score 4096  --mls4096
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 1 more byte (146999 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/r138/build/three.min.js --location | md5sum
1beda160a5e98598b2ef9e2651f68b3d  -
curl --silent --compressed https://minime.stephan-brumme.com/files/threejs/three-r138.min.zopfli.js.gz | md5sum
1beda160a5e98598b2ef9e2651f68b3d  -

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

All listed CDNs deliver identical contents:
CDN Size (compressed) MD5 (uncompressed) Timestamp
unpkg 207550 bytes 1beda160a5e98598b2ef9e2651f68b3d (invalid)
jsdelivr 153220 bytes 1beda160a5e98598b2ef9e2651f68b3d February 24, 2022 @ 15:01

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
147000 bytes -6 bytes zopfli --i1000000 --mls4096 --bsr4 --lazy --ohh March 2, 2022 @ 21:35
147006 bytes -6 bytes zopfli --i100000 --mls4096 --bsr4 --lazy --ohh March 1, 2022 @ 13:53
147012 bytes -20 bytes zopfli --i10000 --mls4096 --bsr4 --lazy --ohh February 25, 2022 @ 10:18
147032 bytes -26 bytes zopfli --i1000 --mls4096 --bsr4 --lazy --ohh February 24, 2022 @ 21:06
147058 bytes -20 bytes zopfli --i1000 --mls32768 --bsr15 --lazy --ohh February 24, 2022 @ 18:10
147078 bytes zopfli --i100 --mls4096 --bsr4 --lazy --ohh February 24, 2022 @ 16:24

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

Most recent activity on March 3, 2022 @ 09:59.

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
147125 147103 147156 147114 147311 147124 147106 147141 147164 147211 147106 147164 147121 147144 147116
147140 147086 147112 147117 147110 147146 147107 147151 147139 147138 147072 147000 147130 147054 147137
147106 147110 147112 147117 147107 147126 147130 147109 147092 147070 147075 147103 147090 147102 147076
147094 147119 147111 147108 147127 147107 147111 147114 147115 147118 147063 147111 147122 147150 147058
147063 147114 147100 147102 147208 147125 147104 147106 147097 147068 147057 147122 147089 147038 147119
147073 147095 147096 147109 147077 147085 147093 147118 147112 147068 147106 147099 147076 147116 147121
147228 147255 147122 147271 147102 147110 147084 147157 147246 147238 147094 147099 147121 147100 147116
147101 147081 147129 147129 147123 147121 147102 147086 147088 147088 147103 147103 147079 147096 147049
147074 147115 147118 147113 147102 147093 147108 147105 147117 147067 147108 147103 147094 147111 147110
147095 147119 147103 147111 147099 147103 147115 147111 147106 147071 147111 147082 147102 147127 147062
147106 147106 147095 147096 147103 147129 147113 147091 147081 147067 147042 147092 147081 147097 147109
147082 147117 147100 147123 147101 147116 147107 147120 147080 147063 147103 147108 147104 147094 147040
147072 147113 147111 147109 147097 147117 147101 147083 147117 147066 147112 147083 147094 147090 147119
147107 147075 147099 147105 147094 147123 147095 147114 147087 147064 147113 147095 147095 147091 147019
147086 147105 147112 147120 147104 147124 147106 147119 147087 147060 147107 147114 147093 147097 147098
147064 147070 147101 147079 147085 147094 147098 147108 147109 147067 147105 147097 147080 147094 147078
147245 147278 147114 147108 147098 147089 147104 147086 147094 147068 147113 147111 147106 147114 147105
147062 147097 147112 147094 147082 147093 147097 147096 147114 147059 147114 147109 147082 147095 147044
147063 147108 147110 147115 147102 147109 147102 147088 147107 147065 147114 147099 147095 147094 147102
147097 147103 147104 147105 147095 147105 147099 147113 147118 147066 147108 147103 147097 147099 147113
147070 147081 147096 147103 147120 147112 147108 147084 147119 147064 147107 147110 147107 147094 147040
147066 147078 147114 147109 147115 147107 147119 147105 147091 147059 147105 147106 147094 147106 147046
147063 147107 147098 147104 147099 147110 147094 147083 147109 147060 147107 147098 147079 147091 147102

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 147078 bytes 100%
1,000 147032 bytes -46 bytes 100%
10,000 147012 bytes -20 bytes 100%
100,000 147006 bytes -6 bytes 0.58%
1,000,000 147000 bytes -6 bytes 0.29%
10,000,000

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 99421 bytes -47579 bytes (-32.37%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 114642 bytes -32358 bytes (-22.01%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 118348 bytes -28652 bytes (-19.49%)
Brotli (Wikipedia) brotli brotli -q 11 124861 bytes -22139 bytes (-15.06%)
LZMA2 (Wikipedia) xz xz -9 125228 bytes -21772 bytes (-14.81%)
Zstandard (Wikipedia) zstd zstd -19 131487 bytes -15513 bytes (-10.55%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 132256 bytes -14744 bytes (-10.03%)

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.