Choose a version:
48% The original file has 514693 bytes (502.6k) and is available from the project website.
There you can find the official minified version, too, which brings down the size to 247845 bytes (242.0k, 48%).

After GZIP compression these minified files vary in size:
unpkg
  93526 bytes (91.3k)
CDN
Boot
  81933 bytes (80.0k)
CDN
cdnjs
  81933 bytes (80.0k)
CDN
gzip -6 (default)
  81260 bytes (79.4k)
local copy
gzip -9
  80967 bytes (79.1k)
local copy
libdeflate -12
  77756 bytes (75.9k)
local copy
7zip -mx=9 -tgzip
  77281 bytes (75.5k)
local copy
zultra
  76996 bytes (75.2k)
local copy
kzip -s0 -rn -b8
  76939 bytes (75.1k)
local copy
pigz -11 -n
  76818 bytes (75.0k)
local copy
Zopfli
  76774 bytes (75.0k)
local copy
Zopfli (defluff)
  76773 bytes (75.0k)
local copy

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

You will automatically get the smallest D3 5.15.1 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 5159 bytes by using my D3 5.15.1 Zopfli version instead of the best available CDN (6.72% smaller than cdnjs, 76774 vs. 81933 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 --bsr6 --lazy --ohh

(found April 16, 2020)
Description Value Parameter
iterations 1000000  --i1000000
maximum blocks 8  --mb8
maximum length score 4096  --mls4096
block splitting recursion 6  --bsr6
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 (76773 bytes).

Verify file integrity

After decompression, my uncompressed files are identical to the original ones:

MD5:
curl --silent --compressed https://raw.githubusercontent.com/mbostock/d3/v5.15.1/d3.zip --location | md5sum
9ed23813208b0065271427cf1e2b2e4c  -
curl --silent --compressed https://minime.stephan-brumme.com/files/d3/d3-5.15.1.min.zopfli.js.gz | md5sum
9ed23813208b0065271427cf1e2b2e4c  -

SHA1:
curl --silent --compressed https://raw.githubusercontent.com/mbostock/d3/v5.15.1/d3.zip --location | sha1sum
32789eae8d9a28078a9d022cd3982e4d45f7bfa1  -
curl --silent --compressed https://minime.stephan-brumme.com/files/d3/d3-5.15.1.min.zopfli.js.gz | sha1sum
32789eae8d9a28078a9d022cd3982e4d45f7bfa1  -

All listed CDNs deliver identical contents:
CDN Size (compressed) MD5 (uncompressed) Timestamp
unpkg 93526 bytes 9ed23813208b0065271427cf1e2b2e4c (invalid)
Boot 81933 bytes 9ed23813208b0065271427cf1e2b2e4c April 2, 2020 @ 02:44
cdnjs 81933 bytes 9ed23813208b0065271427cf1e2b2e4c April 2, 2020 @ 02:46

Note: only the MD5 hashes are shown to keep things simple.

Other Versions

Available D3 versions at minime.stephan-brumme.com:

6.7.0, 6.6.2, 6.6.1, 6.6.0, 6.5.0, 6.4.0, 6.3.1, 6.2.0, 6.1.1, 6.1.0, 6.0.0,
5.16.0, 5.15.1, 5.15.0, 5.14.2, 5.14.1, 5.14.0, 5.13.1, 5.13.0, 5.12.0, 5.11.0, 5.10.1, 5.10.0,
5.9.7, 5.9.6, 5.9.5, 5.9.4, 5.9.3, 5.9.2, 5.9.1, 5.9.0, 5.8.2, 5.8.1, 5.8.0, 5.7.0, 5.6.0, 5.5.0, 5.4.0, 5.3.0, 5.2.0, 5.1.0, 5.0.1, 5.0.0,
4.13.0, 4.12.2, 4.12.1, 4.12.0, 4.11.0, 4.10.2, 4.10.1, 4.10.0,
4.9.1, 4.9.0, 4.8.0, 4.7.4, 4.7.3, 4.7.2, 4.7.1, 4.7.0, 4.6.0, 4.5.0, 4.4.4, 4.4.3, 4.4.2, 4.4.1, 4.4.0, 4.3.0, 4.2.8, 4.2.7, 4.2.6, 4.2.5, 4.2.4, 4.2.3, 4.2.2, 4.2.1, 4.2.0, 4.1.1, 4.1.0, 4.0.0,
3.5.17, 3.5.16, 3.5.15, 3.5.14, 3.5.13, 3.5.12, 3.5.11, 3.5.10, 3.5.9, 3.5.8, 3.5.7, 3.5.6, 3.5.5, 3.5.4, 3.5.3, 3.5.2, 3.5.1, 3.5.0, 3.4.13, 3.4.12, 3.4.11, 3.4.10, 3.4.9, 3.4.8, 3.4.6, 3.4.5, 3.4.4, 3.4.3, 3.4.2, 3.4.1, 3.4.0, 3.3.13, 3.3.12, 3.3.11, 3.3.10, 3.3.9, 3.3.8, 3.3.7, 3.3.6, 3.3.5, 3.3.4, 3.3.3, 3.3.2, 3.3.1, 3.3.0, 3.2.8, 3.2.7, 3.2.6, 3.2.5, 3.2.4, 3.2.3, 3.2.2, 3.2.1, 3.2.0, 3.1.10, 3.1.9, 3.1.8, 3.1.7, 3.1.6, 3.1.5, 3.1.4, 3.1.3, 3.1.2, 3.1.1, 3.1.0, 3.0.8, 3.0.7, 3.0.6, 3.0.5, 3.0.4, 3.0.3, 3.0.2, 3.0.1, 3.0.0

The project site contains an overview how well these versions were compressed.
Other interesting projects are AngularJS, BackboneJS, Bootstrap, Dojo, Ember, jQuery, Knockout, lodash, React, Socket.IO, ThreeJS, UnderscoreJS and Vue.

Changelog

Best Zopfli parameters so far:
Size Improvement Parameters Found
76774 bytes -5 bytes zopfli --i1000000 --mls4096 --bsr6 --lazy --ohh April 16, 2020 @ 23:09
76779 bytes -3 bytes zopfli --i100000 --mls4096 --bsr6 --lazy --ohh April 16, 2020 @ 09:38
76782 bytes -4 bytes zopfli --i100000 --mls4096 --bsr14 --lazy --ohh April 16, 2020 @ 09:35
76786 bytes -5 bytes zopfli --i10000 --mls4096 --bsr6 --lazy --ohh April 14, 2020 @ 19:43
76791 bytes -4 bytes zopfli --i10000 --mls2048 --bsr9 --lazy --ohh April 14, 2020 @ 18:48
76795 bytes -1 byte zopfli --i1000 --mls4096 --bsr6 --lazy --ohh April 14, 2020 @ 16:00
76796 bytes -13 bytes zopfli --i1000 --mls4096 --bsr14 --lazy --ohh April 14, 2020 @ 15:54
76809 bytes zopfli --i100 --mls64 --bsr12 --lazy --ohh April 14, 2020 @ 15:33

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
77177 77170 77252 77242 77240 77246 77252 77227 77360 77387 77388 77381 77197 77155 76967
76846 76859 76893 76871 77069 76869 76873 76859 77252 76875 77028 76910 76979 77161 77041
76994 77006 77011 76995 76812 76812 77006 76808 76990 77018 76834 76774 76945 76966 76978
77180 77116 77000 77083 76811 76812 77001 77013 77012 77019 76823 76856 76964 76890 77024
77019 77019 77123 77119 76872 76872 77103 77098 77109 77150 76919 76798 76961 77029 76981
76798 77014 77022 77025 77000 76803 76802 77000 77000 77017 76791 76807 77024 76941 77057
77055 76796 77001 77108 76795 76797 76995 76807 77011 77012 76812 76804 76964 76898 77005
76988 77119 77001 77110 77020 76803 76998 77011 76995 77041 76984 76984 76947 77079 76973
76794 77007 77011 77128 76804 76789 76806 77000 76800 77021 77020 76790 76970 77083 76947
76992 77111 77007 76998 77014 76799 76994 77004 76998 77035 76810 76797 76961 76944 76987
77093 76989 76994 76997 77002 77087 76999 76998 77000 77012 76814 76782 76959 77050 76978
77100 76994 76805 77000 77015 76973 77001 76804 77000 77018 76816 76808 76956 76976 76964
76990 76986 76986 76993 76997 76805 77005 77000 76996 77021 76808 76808 76952 76877 76950
77022 77108 77002 76998 76994 76794 77002 76998 76994 77016 76819 76809 76949 77026 76895
76996 77001 77012 77004 77129 76791 76997 77003 76996 77016 76813 76790 76946 77083 76983
76980 77130 76987 76995 77004 77092 77107 76809 77111 77107 76803 76811 76955 76944 76950
76990 76987 76989 76996 77111 76792 76999 76998 76975 77015 76809 76791 76945 76957 76955
76998 77109 77002 76999 77014 76793 76995 77003 77000 77015 76811 76796 76955 77032 77034
77122 77095 77110 77125 77015 76997 76993 77007 77000 77012 76800 76798 76955 76826 76959
77098 77127 76801 76995 76806 76798 76995 76997 76997 77012 77005 76795 76957 76877 76976
76982 76989 76998 77000 76806 76797 76996 77000 77001 77018 76818 76812 76955 76889 76958
77100 77110 76996 77104 77001 77084 76995 77001 77000 77017 76815 76986 76948 76868 76942
76988 77000 77012 77007 77001 76803 76993 77002 77001 77017 76791 76809 76957 77009 76983

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 76809 bytes 100%
1,000 76795 bytes -14 bytes 100%
10,000 76786 bytes -9 bytes 100%
100,000 76779 bytes -7 bytes 0.58%
1,000,000 76774 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
77200 bytes +426 bytes (+0.55%) +261 bytes
78578 bytes +1804 bytes (+2.35%) +1639 bytes
78456 bytes +1682 bytes (+2.19%) +1517 bytes
77209 bytes +435 bytes (+0.57%) +270 bytes
77205 bytes +431 bytes (+0.56%) +266 bytes
77112 bytes +338 bytes (+0.44%) +173 bytes
77025 bytes +251 bytes (+0.33%) +86 bytes
76966 bytes +192 bytes (+0.25%) +27 bytes
76939 bytes +165 bytes (+0.21%)

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 60372 bytes -16402 bytes (-21.36%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 67214 bytes -9560 bytes (-12.45%)
LZMA2 (Wikipedia) xz xz -9 68072 bytes -8702 bytes (-11.33%)
Brotli (Wikipedia) brotli brotli -q 11 68256 bytes -8518 bytes (-11.09%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 70284 bytes -6490 bytes (-8.45%)
Zstandard (Wikipedia) zstd zstd -19 73558 bytes -3216 bytes (-4.19%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 76257 bytes -517 bytes (-0.67%)

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.