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

After GZIP compression these minified files vary in size:
unpkg
  92267 bytes (90.1k)
CDN
Boot
  80919 bytes (79.0k)
CDN
cdnjs
  80919 bytes (79.0k)
CDN
gzip -6 (default)
  80225 bytes (78.3k)
local copy
gzip -9
  79915 bytes (78.0k)
local copy
libdeflate -12
  76757 bytes (75.0k)
local copy
7zip -mx=9 -tgzip
  76251 bytes (74.5k)
local copy
zultra
  75949 bytes (74.2k)
local copy
kzip -s0 -rn -b8
  75893 bytes (74.1k)
local copy
pigz -11 -n
  75795 bytes (74.0k)
local copy
Zopfli
  75742 bytes (74.0k)
local copy
Zopfli (defluff)
  75740 bytes (74.0k)
local copy

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

You will automatically get the smallest D3 5.10.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 5177 bytes by using my D3 5.10.1 Zopfli version instead of the best available CDN (6.84% smaller than cdnjs, 75742 vs. 80919 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 --bsr18 --lazy --ohh

(found September 2, 2019)
Description Value Parameter
iterations 1000000  --i1000000
maximum blocks 8  --mb8
maximum length score 4096  --mls4096
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 2 more bytes (75740 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.10.1/d3.zip --location | md5sum
aa71bb5d6cb6588259265ccfb99eb14b  -
curl --silent --compressed https://minime.stephan-brumme.com/files/d3/d3-5.10.1.min.zopfli.js.gz | md5sum
aa71bb5d6cb6588259265ccfb99eb14b  -

SHA1:
curl --silent --compressed https://raw.githubusercontent.com/mbostock/d3/v5.10.1/d3.zip --location | sha1sum
bbb8e5e3f8688514070e4ee90e95197cebee3864  -
curl --silent --compressed https://minime.stephan-brumme.com/files/d3/d3-5.10.1.min.zopfli.js.gz | sha1sum
bbb8e5e3f8688514070e4ee90e95197cebee3864  -

All listed CDNs deliver identical contents:
CDN Size (compressed) MD5 (uncompressed) Timestamp
unpkg 92267 bytes aa71bb5d6cb6588259265ccfb99eb14b (invalid)
Boot 80919 bytes aa71bb5d6cb6588259265ccfb99eb14b August 21, 2019 @ 06:45
cdnjs 80919 bytes aa71bb5d6cb6588259265ccfb99eb14b August 21, 2019 @ 06:45

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
75742 bytes -4 bytes zopfli --i1000000 --mls4096 --bsr18 --lazy --ohh September 2, 2019 @ 22:39
75746 bytes -7 bytes zopfli --i100000 --mls4096 --bsr18 --lazy --ohh August 30, 2019 @ 18:42
75753 bytes -3 bytes zopfli --i10000 --mls4096 --bsr18 --lazy --ohh August 30, 2019 @ 16:42
75756 bytes -7 bytes zopfli --i10000 --mls256 --bsr18 --lazy --ohh August 30, 2019 @ 07:57
75763 bytes -3 bytes zopfli --i1000 --mls4096 --bsr18 --lazy --ohh August 29, 2019 @ 23:16
75766 bytes -7 bytes zopfli --i1000 --mls256 --bsr18 --lazy --ohh August 29, 2019 @ 22:17
75773 bytes -1 byte zopfli --i1000 --mls2048 --bsr7 --lazy --ohh August 29, 2019 @ 22:02
75774 bytes zopfli --i100 --mls4096 --bsr18 --lazy --ohh August 29, 2019 @ 19:37

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

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
76111 75917 76271 76241 76240 76191 76190 76234 76220 76079 75961 76138 75994 75961 76222
76296 76300 75994 76196 75798 75985 75986 75990 75837 76227 75816 76049 75841 75996 75927
75779 76023 75989 75989 75775 75778 75778 75774 75772 75783 75806 75777 75828 76036 75756
75966 75970 75986 75771 75985 75819 75771 75811 76060 75993 75764 75963 75999 75999 75974
76111 75985 76089 76078 75837 75848 75851 75846 76093 75968 75860 75878 75856 75882 75925
75975 75956 75984 75977 75775 75772 75771 75760 76062 76070 75759 75760 75918 75896 75970
75754 75962 75993 75992 75985 75790 75770 75784 75954 75830 75762 75765 75917 75927 75925
75960 75991 75984 75986 75776 75820 75761 75866 75951 75949 75781 75873 75820 75919 75952
75971 75765 75984 75981 75774 75793 75772 75781 76059 75955 75768 75755 75920 75919 75926
75961 75954 75982 75978 75773 75798 75775 75866 76059 75992 75758 75775 75919 75943 75815
76065 75983 75978 75978 75779 75787 75763 75783 76060 75963 75854 75759 75945 75930 75966
75991 75968 75985 75981 75983 75815 75778 75781 75982 75986 75778 75757 75919 75898 75929
75973 75979 75986 75977 75777 75798 75770 75758 76067 75949 75764 75760 75920 75930 76075
75953 76105 75988 75770 75833 75783 75768 75778 75974 75949 75859 75757 75920 75920 75920
75986 75971 75989 75980 75775 75782 75767 75756 76057 75952 75761 75742 75920 75923 75940
75959 75978 75987 75975 75767 75784 75759 75778 76067 75949 75761 75758 75916 75990 75921
75969 75966 75980 75988 75768 75781 75770 75781 76061 75956 75761 75761 75919 75927 75922
75947 75767 75981 75986 75773 75794 75769 75780 76056 75947 75762 75768 75942 75924 76078
76057 75985 75987 75979 75779 75795 75776 75783 76067 75962 75773 75764 75923 75927 75925
75959 75762 75985 75781 75782 75793 75771 75782 76069 75950 75759 75762 75918 75922 75944
75764 75990 75986 75991 75777 75798 75771 75780 75950 75947 75766 75761 75923 75940 75925
76065 75964 75985 75983 75985 75797 75770 75782 76060 76000 75760 75755 75920 75919 75951
75957 75964 75980 75977 75773 75787 75768 75783 75969 75949 75779 75748 75921 75952 75922

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 75774 bytes 100%
1,000 75763 bytes -11 bytes 100%
10,000 75753 bytes -10 bytes 100%
100,000 75746 bytes -7 bytes 0.87%
1,000,000 75742 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
76182 bytes +440 bytes (+0.58%) +289 bytes
77565 bytes +1823 bytes (+2.41%) +1672 bytes
77453 bytes +1711 bytes (+2.26%) +1560 bytes
76183 bytes +441 bytes (+0.58%) +290 bytes
76186 bytes +444 bytes (+0.59%) +293 bytes
76165 bytes +423 bytes (+0.56%) +272 bytes
76134 bytes +392 bytes (+0.52%) +241 bytes
75951 bytes +209 bytes (+0.28%) +58 bytes
75893 bytes +151 bytes (+0.20%)

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 59588 bytes -16154 bytes (-21.33%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 66342 bytes -9400 bytes (-12.41%)
LZMA2 (Wikipedia) xz xz -9 67268 bytes -8474 bytes (-11.19%)
Brotli (Wikipedia) brotli brotli -q 11 67385 bytes -8357 bytes (-11.03%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 69361 bytes -6381 bytes (-8.42%)
Zstandard (Wikipedia) zstd zstd -19 72683 bytes -3059 bytes (-4.04%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 75332 bytes -410 bytes (-0.54%)

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.