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

After GZIP compression these minified files vary in size:
unpkg
  195398 bytes (190.8k)
CDN
Boot
  159759 bytes (156.0k)
CDN
gzip -6 (default)
  159061 bytes (155.3k)
local copy
jsdelivr
  159041 bytes (155.3k)
CDN
gzip -9
  158479 bytes (154.8k)
local copy
libdeflate -12
  153230 bytes (149.6k)
local copy
7zip -mx=9 -tgzip
  153003 bytes (149.4k)
local copy
zultra
  152892 bytes (149.3k)
local copy
kzip -s0 -rn -b0
  152802 bytes (149.2k)
local copy
Zopfli
  152689 bytes (149.1k)
local copy
pigz -11 -n
  152572 bytes (149.0k)
local copy

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

You will automatically get the smallest ThreeJS 123 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 6352 bytes by using my ThreeJS 123 Zopfli version instead of the best available CDN (4.16% smaller than jsdelivr, 152689 vs. 159041 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 --mls16384 --bsr40 --lazy --ohh

(found December 3, 2020)
Description Value Parameter
iterations 1000000  --i1000000
maximum blocks 8  --mb8
maximum length score 16384  --mls16384
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 2 more bytes (152687 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/r123/build/three.min.js --location | md5sum
cd15961ecdf05d81951a618aab62bee1  -
curl --silent --compressed https://minime.stephan-brumme.com/files/threejs/three-r123.min.zopfli.js.gz | md5sum
cd15961ecdf05d81951a618aab62bee1  -

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

All listed CDNs deliver identical contents:
CDN Size (compressed) MD5 (uncompressed) Timestamp
unpkg 195398 bytes cd15961ecdf05d81951a618aab62bee1 (invalid)
Boot 159759 bytes cd15961ecdf05d81951a618aab62bee1 (invalid)
jsdelivr 159041 bytes cd15961ecdf05d81951a618aab62bee1 December 1, 2020 @ 14: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
152689 bytes -3 bytes zopfli --i1000000 --mls16384 --bsr40 --lazy --ohh December 3, 2020 @ 19:22
152692 bytes -13 bytes zopfli --i100000 --mls16384 --bsr40 --lazy --ohh December 2, 2020 @ 15:06
152705 bytes -7 bytes zopfli --i10000 --mls16384 --bsr40 --lazy --ohh December 1, 2020 @ 19:27
152712 bytes -2 bytes zopfli --i10000 --mls64 --bsr2 --lazy --ohh December 1, 2020 @ 19:20
152714 bytes -5 bytes zopfli --i10000 --mls16384 --bsr19 --lazy --ohh December 1, 2020 @ 19:01
152719 bytes -5 bytes zopfli --i1000 --mls16384 --bsr40 --lazy --ohh December 1, 2020 @ 14:53
152724 bytes -27 bytes zopfli --i1000 --mls256 --bsr6 --lazy --ohh December 1, 2020 @ 14:53
152751 bytes zopfli --i100 --mls4 --bsr2 --lazy --ohh December 1, 2020 @ 14:36

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

Most recent activity on December 3, 2020 @ 19:35.

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
152711 152710 152823 152846 152824 152712 152830 152709 152809 152852 152719 152803 152791 152777 152746
152900 152882 152902 152902 152869 152952 152937 152837 152836 152941 152749 152791 152926 152737 152775
152918 152914 152906 152920 152912 152898 152926 152708 152887 152882 152750 152736 152750 152755 152741
152896 152893 152906 152955 152891 152901 152774 152725 152848 152793 152738 152802 152719 152727 152734
152884 152746 152903 152888 152768 152805 152830 152761 152767 152816 152770 152761 152728 152758 152769
152900 152896 152906 152912 152893 152913 152904 152778 152889 152881 152738 152750 152732 152735 152747
152898 152905 152939 152901 152906 152896 152892 152885 152887 152775 152741 152749 152759 152730 152733
152771 152910 152917 152903 152903 152916 152902 152876 152760 152788 152735 152730 152758 152721 152750
152917 152897 152914 152912 152900 152912 152914 152877 152890 152881 152760 152764 152756 152763 152889
152901 152903 152914 152911 152899 152918 152910 152873 152889 152896 152725 152765 152757 152725 152734
152919 152769 152749 152917 152743 152750 152755 152722 152737 152789 152724 152733 152728 152749 152747
152923 152909 152913 152919 152902 152913 152913 152877 152943 152930 152734 152755 152729 152731 152746
152907 152901 152911 152906 152906 152900 152909 152770 152747 152772 152725 152756 152730 152716 152730
152895 152914 152911 152910 152899 152903 152899 152868 152880 152872 152743 152759 152726 152721 152732
152911 152919 152910 152909 152903 152909 152915 152877 152872 152877 152732 152735 152760 152724 152747
152913 152909 152906 152910 152898 152905 152900 152723 152913 152871 152736 152734 152728 152709 152719
152894 152876 152899 152907 152910 152770 152899 152884 152761 152875 152732 152738 152734 152719 152754
152891 152899 152901 152908 152900 152901 152895 152726 152746 152749 152743 152733 152723 152744 152729
152902 152904 152897 152900 152890 152895 152898 152871 152742 152747 152735 152737 152733 152718 152719
152896 152897 152924 152919 152906 152775 152899 152878 152754 152764 152719 152766 152730 152767 152734
152901 152903 152909 152907 152898 152911 152896 152770 152912 152874 152755 152756 152727 152740 152776
152897 152902 152908 152908 152899 152773 152899 152877 152762 152878 152736 152737 152734 152718 152743
152906 152903 152917 152906 152894 152903 152905 152880 152893 152874 152735 152738 152733 152689 152749

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 152751 bytes 100%
1,000 152719 bytes -32 bytes 100%
10,000 152705 bytes -14 bytes 100%
100,000 152692 bytes -13 bytes 0.58%
1,000,000 152689 bytes -3 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
152802 bytes +113 bytes (+0.07%)
153233 bytes +544 bytes (+0.36%) +431 bytes
153221 bytes +532 bytes (+0.35%) +419 bytes
152979 bytes +290 bytes (+0.19%) +177 bytes
152930 bytes +241 bytes (+0.16%) +128 bytes
152928 bytes +239 bytes (+0.16%) +126 bytes
152874 bytes +185 bytes (+0.12%) +72 bytes
152867 bytes +178 bytes (+0.12%) +65 bytes
152889 bytes +200 bytes (+0.13%) +87 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 102934 bytes -49755 bytes (-32.59%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 118591 bytes -34098 bytes (-22.33%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 122819 bytes -29870 bytes (-19.56%)
Brotli (Wikipedia) brotli brotli -q 11 128683 bytes -24006 bytes (-15.72%)
LZMA2 (Wikipedia) xz xz -9 129020 bytes -23669 bytes (-15.50%)
Zstandard (Wikipedia) zstd zstd -19 135683 bytes -17006 bytes (-11.14%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 137224 bytes -15465 bytes (-10.13%)

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.