Choose a version:
50% The original file has 1255447 bytes (1,226.0k) and is available from the project website.
There you can find the official minified version, too, which brings down the size to 626274 bytes (611.6k, 50%).

After GZIP compression these minified files vary in size:
unpkg
  191184 bytes (186.7k)
CDN
Boot
  157904 bytes (154.2k)
CDN
gzip -6 (default)
  156165 bytes (152.5k)
local copy
jsdelivr
  156022 bytes (152.4k)
CDN
gzip -9
  155549 bytes (151.9k)
local copy
libdeflate -12
  150215 bytes (146.7k)
local copy
zultra
  150073 bytes (146.6k)
local copy
7zip -mx=9 -tgzip
  149953 bytes (146.4k)
local copy
Zopfli
  149703 bytes (146.2k)
local copy
kzip -s0 -rn -b0
  149632 bytes (146.1k)
local copy
pigz -11 -n
  149606 bytes (146.1k)
local copy

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

You will automatically get the smallest ThreeJS 118 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 6319 bytes by using my ThreeJS 118 Zopfli version instead of the best available CDN (4.22% smaller than jsdelivr, 149703 vs. 156022 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 --bsr18 --lazy --ohh

(found June 26, 2020)
Description Value Parameter
iterations 1000000  --i1000000
maximum blocks 8  --mb8
maximum length score 8192  --mls8192
block splitting recursion 18  --bsr18
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 (149698 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/r118/build/three.min.js --location | md5sum
a2dc8c48ca3d2b2708022f0fc1236649  -
curl --silent --compressed https://minime.stephan-brumme.com/files/threejs/three-r118.min.zopfli.js.gz | md5sum
a2dc8c48ca3d2b2708022f0fc1236649  -

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

CDN Size (compressed) MD5 (uncompressed) Comment / Diff Timestamp
unpkg 191184 bytes aa2da612f9427101657b06936ba2cd35 < var e=new df;e.setCrossOrigin(this.crossOrigin);a=e.load(a [...]
> var e=new df;e.setCrossOrigin(this.crossOrigin);a=e.load(a [...]
< k.PointCloudMaterial=function(a){console.warn("THREE.Point [...]
> k.PointCloudMaterial=function(a){console.warn("THREE.Point [...]
(invalid)
Boot 157904 bytes aa2da612f9427101657b06936ba2cd35 < var e=new df;e.setCrossOrigin(this.crossOrigin);a=e.load(a [...]
> var e=new df;e.setCrossOrigin(this.crossOrigin);a=e.load(a [...]
< k.PointCloudMaterial=function(a){console.warn("THREE.Point [...]
> k.PointCloudMaterial=function(a){console.warn("THREE.Point [...]
June 30, 2020 @ 14:46
jsdelivr 156022 bytes aa2da612f9427101657b06936ba2cd35 < var e=new df;e.setCrossOrigin(this.crossOrigin);a=e.load(a [...]
> var e=new df;e.setCrossOrigin(this.crossOrigin);a=e.load(a [...]
< k.PointCloudMaterial=function(a){console.warn("THREE.Point [...]
> k.PointCloudMaterial=function(a){console.warn("THREE.Point [...]
June 25, 2020 @ 10:24

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
149703 bytes -5 bytes zopfli --i1000000 --mls8192 --bsr18 --lazy --ohh June 26, 2020 @ 23:40
149708 bytes -7 bytes zopfli --i100000 --mls8192 --bsr18 --lazy --ohh June 25, 2020 @ 14:40
149715 bytes -15 bytes zopfli --i10000 --mls8192 --bsr18 --lazy --ohh June 25, 2020 @ 11:30
149730 bytes -10 bytes zopfli --i1000 --mls8192 --bsr18 --lazy --ohh June 25, 2020 @ 10:54
149740 bytes -5 bytes zopfli --i1000 --mls1024 --bsr10 --lazy --ohh June 25, 2020 @ 10:50
149745 bytes -17 bytes zopfli --i1000 --mls2048 --bsr20 --lazy --ohh June 25, 2020 @ 10:50
149762 bytes zopfli --i100 --mls8192 --bsr18 --lazy --ohh June 25, 2020 @ 10:29

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

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
149928 149924 149953 149907 149924 149853 149916 149923 149903 149867 149847 149851 149857 149892 149864
149890 149944 149901 149796 149808 149875 149907 149901 149869 149864 149879 149815 149822 149737 149809
149832 149830 149834 149827 149844 149837 149781 149788 149799 149783 149794 149791 149930 149832 149877
149777 149782 149771 149795 149785 149780 149771 149795 149789 149891 149779 149783 149880 149817 149945
149805 149795 149809 149787 149784 149781 149792 149781 149782 149777 149783 149735 149911 149817 149804
149790 149790 149787 149794 149786 149795 149801 149781 149817 149928 149792 149913 149895 149782 149804
149788 149792 149780 149784 149811 149792 149792 149783 149816 149727 149766 149782 149897 149806 149811
149806 149784 149770 149800 149810 149777 149776 149781 149782 149910 149810 149923 149900 149807 149718
149795 149809 149809 149803 149799 149793 149790 149789 149818 149777 149784 149780 149915 149778 149775
149793 149792 149778 149803 149779 149756 149789 149782 149789 149938 149784 149783 149920 149809 149812
149783 149785 149789 149850 149795 149789 149776 149783 149817 149793 149778 149789 149896 149792 149804
149806 149810 149772 149773 149820 149779 149783 149802 149809 149919 149774 149894 149894 149802 149932
149768 149780 149780 149775 149770 149789 149802 149788 149812 149791 149830 149796 149814 149763 149807
149890 149774 149775 149799 149785 149778 149801 149777 149775 149915 149790 149769 149897 149918 149923
149807 149815 149810 149802 149801 149756 149781 149787 149807 149760 149784 149743 149703 149772 149833
149883 149798 149793 149788 149782 149801 149797 149781 149813 149887 149776 149920 149893 149920 149828
149805 149775 149782 149785 149805 149780 149782 149782 149804 149844 149736 149913 149731 149803 149810
149816 149812 149779 149781 149802 149797 149780 149778 149902 149930 149800 149785 149894 149919 149877
149781 149786 149810 149781 149777 149778 149780 149784 149786 149763 149757 149785 149956 149770 149812
149781 149777 149811 149785 149770 149772 149772 149775 149776 149910 149781 149915 149894 149810 149803
149808 149783 149778 149804 149769 149767 149780 149784 149809 149909 149757 149766 149926 149804 149822
149807 149779 149806 149763 149803 149804 149801 149811 149817 149827 149761 149776 149810 149788 149818
149814 149790 149804 149814 149799 149773 149794 149788 149810 149765 149770 149899 149895 149805 149909

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 149762 bytes 100%
1,000 149730 bytes -32 bytes 100%
10,000 149715 bytes -15 bytes 100%
100,000 149708 bytes -7 bytes 0.58%
1,000,000 149703 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
149632 bytes -71 bytes (-0.05%)
150390 bytes +687 bytes (+0.46%) +758 bytes
150362 bytes +659 bytes (+0.44%) +730 bytes
150068 bytes +365 bytes (+0.24%) +436 bytes
149968 bytes +265 bytes (+0.18%) +336 bytes
149976 bytes +273 bytes (+0.18%) +344 bytes
149912 bytes +209 bytes (+0.14%) +280 bytes
149833 bytes +130 bytes (+0.09%) +201 bytes
149847 bytes +144 bytes (+0.10%) +215 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 99940 bytes -49763 bytes (-33.24%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 115594 bytes -34109 bytes (-22.78%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 121141 bytes -28562 bytes (-19.08%)
Brotli (Wikipedia) brotli brotli -q 11 126807 bytes -22896 bytes (-15.29%)
LZMA2 (Wikipedia) xz xz -9 127532 bytes -22171 bytes (-14.81%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 132876 bytes -16827 bytes (-11.24%)
Zstandard (Wikipedia) zstd zstd -19 133841 bytes -15862 bytes (-10.60%)

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.