Choose a version:
49% The original file has 1123387 bytes (1,097.1k) and is available from the project website.
There you can find the official minified version, too, which brings down the size to 555356 bytes (542.3k, 49%).

After GZIP compression these minified files vary in size:
cdnjs
  139995 bytes (136.7k)
CDN
unpkg
  138853 bytes (135.6k)
CDN
gzip -6 (default)
  138573 bytes (135.3k)
local copy
jsdelivr
  138425 bytes (135.2k)
CDN
gzip -9
  138095 bytes (134.9k)
local copy
7zip -mx=9 -tgzip
  133459 bytes (130.3k)
local copy
libdeflate -12
  133286 bytes (130.2k)
local copy
zultra
  133183 bytes (130.1k)
local copy
kzip -s0 -rn -b0
  133035 bytes (129.9k)
local copy
pigz -11 -n
  132965 bytes (129.8k)
local copy
Zopfli
  132847 bytes (129.7k)
local copy
Zopfli (defluff)
  132845 bytes (129.7k)
local copy

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

You will automatically get the smallest ThreeJS 98 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 5578 bytes by using my ThreeJS 98 Zopfli version instead of the best available CDN (4.20% smaller than jsdelivr, 132847 vs. 138425 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 --mls512 --bsr7 --lazy --ohh

(found November 4, 2018)
Description Value Parameter
iterations 1000000  --i1000000
maximum blocks 8  --mb8
maximum length score 512  --mls512
block splitting recursion 7  --bsr7
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 (132845 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/r98/build/three.min.js --location | md5sum
2c848ad39112070d185355a4224ab5d5  -
curl --silent --compressed https://minime.stephan-brumme.com/files/threejs/three-r98.min.zopfli.js.gz | md5sum
2c848ad39112070d185355a4224ab5d5  -

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

All listed CDNs deliver identical contents:
CDN Size (compressed) MD5 (uncompressed) Timestamp
cdnjs 139995 bytes 2c848ad39112070d185355a4224ab5d5 (invalid)
unpkg 138853 bytes 2c848ad39112070d185355a4224ab5d5 (invalid)
jsdelivr 138425 bytes 2c848ad39112070d185355a4224ab5d5 November 2, 2018 @ 15:51

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
132847 bytes -2 bytes zopfli --i1000000 --mls512 --bsr7 --lazy --ohh November 4, 2018 @ 00:15
132849 bytes -10 bytes zopfli --i100000 --mls512 --bsr7 --lazy --ohh November 2, 2018 @ 20:52
132859 bytes -16 bytes zopfli --i10000 --mls512 --bsr7 --lazy --ohh November 2, 2018 @ 16:53
132875 bytes -4 bytes zopfli --i1000 --mls512 --bsr7 --lazy --ohh November 2, 2018 @ 16:17
132879 bytes -12 bytes zopfli --i1000 --mls64 --bsr30 --lazy --ohh November 2, 2018 @ 16:17
132891 bytes zopfli --i100 --mls512 --bsr7 --lazy --ohh November 2, 2018 @ 15:57

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:53.

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
133124 133119 133120 133120 133119 132972 133137 133158 133134 133009 133141 133146 132966 132984 133063
133165 132933 133170 133159 132970 133014 133007 133017 132917 133018 132992 133101 133084 132982 132981
133113 133117 133114 133111 132988 133186 133164 132924 132922 133075 132964 132943 133089 133100 132964
133087 133089 133088 133122 132945 133100 132926 132911 132847 132949 133130 132944 133114 132922 133080
133104 133103 133100 133083 132930 133097 133135 132955 133092 133128 132961 132952 133098 132953 133091
132891 133101 133096 133118 133109 133131 133149 132911 132902 133116 133116 132905 133102 133120 133100
132902 133067 133066 133070 133091 133097 133095 133092 133060 133133 132922 132896 132940 133132 133129
132912 133124 133146 133117 132927 133115 133114 132926 133109 133128 133142 132906 133121 133122 133002
133117 132899 133116 133116 133096 132905 133140 133175 133127 132907 132908 132904 132972 133115 133095
133067 133064 133098 133122 132959 132889 133101 132971 133123 132912 132945 132912 133140 133098 133041
133097 133099 133112 133113 133109 132888 133097 132960 132907 133113 132919 132872 133120 133119 133096
133070 133064 133128 133123 132957 132876 133116 133164 133126 133117 133110 132908 133098 133131 133096
133131 132939 133133 133141 133151 133113 133141 133156 132933 133121 133127 132912 133118 133126 133085
132963 132946 133127 133128 133138 132900 132983 133157 133117 133110 132892 132899 133120 133115 133073
133099 133099 133100 133114 133138 132871 133164 132992 132948 133127 133132 132913 133103 133104 132998
133098 133097 133126 133120 133169 132870 133128 132972 132955 133142 133131 132912 133111 133099 133106
132907 132932 133135 133134 133125 132870 133091 132973 132874 132893 133093 132898 132922 133094 133101
132938 132902 133117 133146 133148 133115 133113 132953 133125 133128 133148 132961 133103 133103 132944
133094 132931 133119 133122 133134 133120 133126 132974 133109 132893 132916 132897 133100 133110 133095
132926 132937 133119 133111 133124 132902 133119 132952 133127 133148 133131 133089 133096 133098 133074
132900 133068 133097 133115 133134 132861 133116 132919 132923 133143 133134 133096 133096 133107 133100
132936 133116 133119 133115 133121 132859 133119 132988 132947 132954 132984 132876 133114 133112 133100
132910 132940 133129 133119 133112 132892 133103 132958 132925 133068 132904 132898 133111 133102 133046

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 132891 bytes 100%
1,000 132875 bytes -16 bytes 100%
10,000 132859 bytes -16 bytes 100%
100,000 132849 bytes -10 bytes 0.87%
1,000,000 132847 bytes -2 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
133035 bytes +188 bytes (+0.14%)
133580 bytes +733 bytes (+0.55%) +545 bytes
133564 bytes +717 bytes (+0.54%) +529 bytes
133406 bytes +559 bytes (+0.42%) +371 bytes
133291 bytes +444 bytes (+0.33%) +256 bytes
133087 bytes +240 bytes (+0.18%) +52 bytes
133122 bytes +275 bytes (+0.21%) +87 bytes
133063 bytes +216 bytes (+0.16%) +28 bytes
133038 bytes +191 bytes (+0.14%) +3 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 - for example, your browser actually supports it !
Algorithm Program Parameters Size Compared To Best Zopfli
ZPAQ (Wikipedia) zpaq zpaq -method 69 89478 bytes -43369 bytes (-32.65%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 102924 bytes -29923 bytes (-22.52%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 106537 bytes -26310 bytes (-19.80%)
Brotli (Wikipedia) brotli brotli -q 11 113089 bytes -19758 bytes (-14.87%)
LZMA2 (Wikipedia) xz xz -9 113940 bytes -18907 bytes (-14.23%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 118683 bytes -14164 bytes (-10.66%)
Zstandard (Wikipedia) zstd zstd -19 119863 bytes -12984 bytes (-9.77%)

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.