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

After GZIP compression these minified files vary in size:
Boot
  80154 bytes (78.3k)
CDN
cdnjs
  80154 bytes (78.3k)
CDN
gzip -6 (default)
  79437 bytes (77.6k)
local copy
gzip -9
  79141 bytes (77.3k)
local copy
libdeflate -12
  75979 bytes (74.2k)
local copy
7zip -mx=9 -tgzip
  75481 bytes (73.7k)
local copy
kzip -s0 -rn -b8
  75241 bytes (73.5k)
local copy
pigz -11 -n
  75036 bytes (73.3k)
local copy
Zopfli
  74942 bytes (73.2k)
local copy
Zopfli (defluff)
  74941 bytes (73.2k)
local copy

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

You will automatically get the smallest D3 5.9.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 5212 bytes by using my D3 5.9.1 Zopfli version instead of the best available CDN (6.95% smaller than cdnjs, 74942 vs. 80154 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 --bsr6 --lazy --ohh

(found February 16, 2019)
Description Value Parameter
iterations 1000000  --i1000000
maximum blocks 8  --mb8
maximum length score 16384  --mls16384
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 (74941 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.9.1/d3.zip --location | md5sum
ce3c0fd100ad0c0b16dce21c0c3cb90c  -
curl --silent --compressed https://minime.stephan-brumme.com/files/d3/d3-5.9.1.min.zopfli.js.gz | md5sum
ce3c0fd100ad0c0b16dce21c0c3cb90c  -

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

All listed CDNs deliver identical contents:
CDN Size (compressed) MD5 (uncompressed) Timestamp
Boot 80154 bytes ce3c0fd100ad0c0b16dce21c0c3cb90c February 10, 2019 @ 16:45
cdnjs 80154 bytes ce3c0fd100ad0c0b16dce21c0c3cb90c February 10, 2019 @ 16:45

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

Other Versions

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

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
74942 bytes -8 bytes zopfli --i1000000 --mls16384 --bsr6 --lazy --ohh February 16, 2019 @ 16:05
74950 bytes -8 bytes zopfli --i100000 --mls16384 --bsr6 --lazy --ohh February 15, 2019 @ 23:11
74958 bytes -11 bytes zopfli --i10000 --mls16384 --bsr6 --lazy --ohh February 12, 2019 @ 22:50
74969 bytes -20 bytes zopfli --i1000 --mls16384 --bsr6 --lazy --ohh February 11, 2019 @ 21:25
74989 bytes -4 bytes zopfli --i1000 --mls16384 --bsr16 --lazy --ohh February 11, 2019 @ 21:09
74993 bytes zopfli --i100 --mls16384 --bsr6 --lazy --ohh February 11, 2019 @ 17:13

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

Most recent activity on February 18, 2019 @ 10:15.

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
75219 75248 75206 75404 75403 75416 75415 75172 75390 75418 75389 75275 75263 75238 75349
75328 75333 75290 75269 75092 75087 75414 75410 75627 75088 75103 75119 75309 75016 75189
75035 75006 75040 75045 75028 75032 75220 75042 75023 75231 75078 75024 75088 74942 74985
75232 75218 75019 75019 75230 75211 75052 75018 75210 75061 75040 75007 75025 75282 75062
75046 75243 75074 75068 75288 75302 75303 75288 75237 75269 75383 75148 75173 75153 75137
75016 75024 75036 75034 75213 75038 75058 75219 75222 75017 75016 75040 75056 75002 75042
75003 75014 75005 75208 75022 75213 75018 75027 75215 75019 75014 75010 75135 75009 75065
75016 75003 75240 75043 75237 75020 75060 75037 75230 75054 74966 75017 75053 74978 75065
75023 75328 75004 75003 75211 75030 75214 75211 75205 75033 75020 75207 74989 74977 75049
75330 75319 75025 75018 75225 75011 75216 75204 75208 75021 75202 74999 75185 75251 75080
75320 75231 75004 75023 75213 75015 75218 75207 75237 75265 75208 75006 75210 75179 75131
75347 75227 75018 75021 75214 75006 75035 75023 75204 75042 75033 75013 75006 75134 75048
75021 75028 75033 75144 75212 75008 75037 75020 75205 75014 75022 75010 75041 74981 75136
75020 75032 75079 75015 75215 75066 75078 75021 75234 75014 75030 75004 75041 74979 75045
75019 75226 75022 75020 75216 75211 75022 75226 75224 75018 75018 75006 75039 74980 75141
75016 75026 75018 75017 75018 75242 75019 75023 75214 75022 75016 75041 75042 75153 75141
75319 75326 75023 75020 75211 75033 75216 75206 75230 75208 75017 75018 75038 74978 75141
75218 75331 75322 75020 75215 75213 75211 75211 75208 75017 75212 75007 75041 75246 75048
75339 75340 75331 75020 75213 75214 75216 75211 75208 75203 75215 75227 75195 75148 75146
75322 75031 75021 75022 75216 75013 75019 75213 75233 75020 75015 75004 75026 74977 75045
75024 75028 75017 75014 75212 75212 75020 75215 75207 75204 75023 75016 75040 75133 75136
75329 75327 75328 75017 75018 75214 75214 75214 75208 75207 75229 75017 75213 75135 75079
75321 75335 75017 75019 75215 75035 75217 75022 75216 75015 75036 75009 75211 75191 75008

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 74993 bytes 100%
1,000 74969 bytes -24 bytes 100%
10,000 74958 bytes -11 bytes 100%
100,000 74950 bytes -8 bytes 0.58%
1,000,000 74942 bytes -8 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
75401 bytes +459 bytes (+0.61%) +160 bytes
76767 bytes +1825 bytes (+2.44%) +1526 bytes
76640 bytes +1698 bytes (+2.27%) +1399 bytes
75403 bytes +461 bytes (+0.62%) +162 bytes
75423 bytes +481 bytes (+0.64%) +182 bytes
75395 bytes +453 bytes (+0.60%) +154 bytes
75426 bytes +484 bytes (+0.65%) +185 bytes
75427 bytes +485 bytes (+0.65%) +186 bytes
75241 bytes +299 bytes (+0.40%)

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 59103 bytes -15839 bytes (-21.14%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 65882 bytes -9060 bytes (-12.09%)
LZMA2 (Wikipedia) xz xz -9 66704 bytes -8238 bytes (-10.99%)
Brotli (Wikipedia) brotli brotli -q 11 66883 bytes -8059 bytes (-10.75%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 68585 bytes -6357 bytes (-8.48%)
Zstandard (Wikipedia) zstd zstd -19 72080 bytes -2862 bytes (-3.82%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 74692 bytes -250 bytes (-0.33%)

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 2019.
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