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

After GZIP compression these minified files vary in size:
unpkg
  223739 bytes (218.5k)
CDN
gzip -6 (default)
  152999 bytes (149.4k)
local copy
jsdelivr
  152872 bytes (149.3k)
CDN
gzip -9
  152504 bytes (148.9k)
local copy
libdeflate -12
  147025 bytes (143.6k)
local copy
7zip -mx=9 -tgzip
  146888 bytes (143.4k)
local copy
zultra
  146826 bytes (143.4k)
local copy
kzip -s0 -rn -b0
  146529 bytes (143.1k)
local copy
Zopfli
  146456 bytes (143.0k)
local copy
pigz -11 -n
  146430 bytes (143.0k)
local copy

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

You will automatically get the smallest ThreeJS 148 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 6416 bytes by using my ThreeJS 148 Zopfli version instead of the best available CDN (4.38% smaller than jsdelivr, 146456 vs. 152872 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 --bsr10 --lazy --ohh

(found January 10, 2023)
Description Value Parameter
iterations 1000000  --i1000000
maximum blocks 8  --mb8
maximum length score 4096  --mls4096
block splitting recursion 10  --bsr10
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 4 more bytes (146452 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/r148/build/three.min.js --location | md5sum
5f41b1d732d35e1d0f6d8a452ed7cac5  -
curl --silent --compressed https://minime.stephan-brumme.com/files/threejs/three-r148.min.zopfli.js.gz | md5sum
5f41b1d732d35e1d0f6d8a452ed7cac5  -

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

All listed CDNs deliver identical contents:
CDN Size (compressed) MD5 (uncompressed) Timestamp
unpkg 223739 bytes 5f41b1d732d35e1d0f6d8a452ed7cac5 (invalid)
jsdelivr 152872 bytes 5f41b1d732d35e1d0f6d8a452ed7cac5 January 3, 2023 @ 16: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
146456 bytes -4 bytes zopfli --i1000000 --mls4096 --bsr10 --lazy --ohh January 10, 2023 @ 13:12
146460 bytes -7 bytes zopfli --i100000 --mls4096 --bsr10 --lazy --ohh January 7, 2023 @ 05:06
146467 bytes -12 bytes zopfli --i10000 --mls4096 --bsr10 --lazy --ohh January 6, 2023 @ 10:48
146479 bytes -2 bytes zopfli --i10000 --mls16384 --bsr4 --lazy --ohh January 6, 2023 @ 02:48
146481 bytes -17 bytes zopfli --i1000 --mls4096 --bsr10 --lazy --ohh January 4, 2023 @ 04:53
146498 bytes -21 bytes zopfli --i1000 --mls16384 --bsr4 --lazy --ohh January 4, 2023 @ 01:31
146519 bytes -6 bytes zopfli --i1000 --mls4096 --bsr4 --lazy --ohh January 4, 2023 @ 00:24
146525 bytes zopfli --i100 --mls4096 --bsr10 --lazy --ohh January 3, 2023 @ 17:52

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
146878 146693 146874 146666 146667 146653 146608 146607 146650 146693 146573 146604 146626 146552 146632
146614 146631 146622 146613 146596 146614 146596 146613 146592 146597 146591 146501 146596 146479 146596
146564 146561 146571 146571 146591 146591 146566 146564 146571 146593 146572 146588 146607 146567 146609
146579 146556 146571 146576 146577 146562 146725 146555 146565 146572 146563 146583 146610 146608 146629
146584 146577 146586 146586 146574 146572 146576 146577 146590 146594 146550 146596 146592 146627 146588
146554 146558 146562 146571 146569 146578 146560 146558 146590 146575 146549 146565 146602 146569 146594
146577 146585 146627 146582 146624 146620 146725 146607 146610 146720 146549 146456 146575 146500 146580
146562 146562 146575 146576 146564 146556 146588 146576 146574 146560 146553 146605 146571 146606 146579
146584 146555 146573 146573 146579 146573 146573 146574 146561 146577 146545 146555 146567 146583 146585
146571 146565 146560 146581 146588 146582 146585 146575 146581 146588 146563 146600 146591 146606 146568
146584 146568 146584 146573 146565 146567 146564 146556 146562 146561 146545 146590 146587 146598 146608
146581 146576 146569 146570 146573 146595 146585 146568 146574 146570 146560 146588 146595 146592 146605
146565 146568 146563 146608 146571 146572 146599 146573 146583 146577 146546 146611 146596 146631 146581
146573 146576 146581 146578 146565 146576 146577 146564 146570 146574 146550 146605 146596 146596 146596
146586 146579 146571 146581 146570 146553 146576 146560 146571 146574 146566 146586 146584 146595 146584
146556 146555 146568 146577 146573 146554 146587 146562 146563 146575 146565 146605 146588 146595 146586
146562 146552 146593 146586 146556 146590 146585 146574 146567 146572 146554 146605 146598 146599 146581
146583 146564 146569 146580 146574 146557 146574 146564 146570 146566 146546 146577 146585 146599 146573
146583 146565 146560 146585 146569 146589 146572 146562 146566 146569 146559 146583 146568 146601 146587
146586 146553 146558 146587 146559 146559 146563 146563 146563 146562 146550 146609 146588 146598 146580
146580 146554 146551 146580 146572 146554 146571 146559 146567 146571 146543 146610 146557 146586 146572
146557 146564 146558 146561 146564 146551 146575 146561 146565 146573 146550 146489 146601 146599 146567
146583 146562 146592 146596 146568 146589 146587 146560 146563 146564 146547 146586 146554 146511 146504

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 146525 bytes 100%
1,000 146481 bytes -44 bytes 100%
10,000 146467 bytes -14 bytes 100%
100,000 146460 bytes -7 bytes 0.29%
1,000,000 146456 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
146529 bytes +73 bytes (+0.05%)
147256 bytes +800 bytes (+0.55%) +727 bytes
147198 bytes +742 bytes (+0.51%) +669 bytes
146899 bytes +443 bytes (+0.30%) +370 bytes
146890 bytes +434 bytes (+0.30%) +361 bytes
146916 bytes +460 bytes (+0.31%) +387 bytes
146788 bytes +332 bytes (+0.23%) +259 bytes
146593 bytes +137 bytes (+0.09%) +64 bytes
146632 bytes +176 bytes (+0.12%) +103 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 99630 bytes -46826 bytes (-31.97%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 118229 bytes -28227 bytes (-19.27%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 118703 bytes -27753 bytes (-18.95%)
Brotli (Wikipedia) brotli brotli -q 11 124691 bytes -21765 bytes (-14.86%)
LZMA2 (Wikipedia) xz xz -9 124996 bytes -21460 bytes (-14.65%)
Zstandard (Wikipedia) zstd zstd -19 131517 bytes -14939 bytes (-10.20%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 132468 bytes -13988 bytes (-9.55%)

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.