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

After GZIP compression these minified files vary in size:
Boot
  80283 bytes (78.4k)
CDN
cdnjs
  80283 bytes (78.4k)
CDN
gzip -6 (default)
  79574 bytes (77.7k)
local copy
gzip -9
  79285 bytes (77.4k)
local copy
libdeflate -12
  76060 bytes (74.3k)
local copy
7zip -mx=9 -tgzip
  75636 bytes (73.9k)
local copy
pigz -11 -n
  75179 bytes (73.4k)
local copy
Zopfli
  75084 bytes (73.3k)
local copy
Zopfli (defluff)
  75082 bytes (73.3k)
local copy

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

You will automatically get the smallest D3 5.9.7 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 5199 bytes by using my D3 5.9.7 Zopfli version instead of the best available CDN (6.92% smaller than cdnjs, 75084 vs. 80283 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 July 6, 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 2 more bytes (75082 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.7/d3.zip --location | md5sum
f698183caeecc81bd2548435dc078ac7  -
curl --silent --compressed https://minime.stephan-brumme.com/files/d3/d3-5.9.7.min.zopfli.js.gz | md5sum
f698183caeecc81bd2548435dc078ac7  -

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

All listed CDNs deliver identical contents:
CDN Size (compressed) MD5 (uncompressed) Timestamp
Boot 80283 bytes f698183caeecc81bd2548435dc078ac7 June 29, 2019 @ 12:46
cdnjs 80283 bytes f698183caeecc81bd2548435dc078ac7 June 29, 2019 @ 12:46

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

Other Versions

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

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
75084 bytes -3 bytes zopfli --i1000000 --mls16384 --bsr6 --lazy --ohh July 6, 2019 @ 00:11
75087 bytes -10 bytes zopfli --i100000 --mls16384 --bsr6 --lazy --ohh July 5, 2019 @ 05:36
75097 bytes -8 bytes zopfli --i10000 --mls16384 --bsr6 --lazy --ohh July 4, 2019 @ 04:02
75105 bytes -12 bytes zopfli --i1000 --mls16384 --bsr6 --lazy --ohh July 3, 2019 @ 14:37
75117 bytes -9 bytes zopfli --i1000 --mls16384 --bsr16 --lazy --ohh July 3, 2019 @ 14:02
75126 bytes zopfli --i100 --mls16384 --bsr6 --lazy --ohh July 3, 2019 @ 13:35

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

Most recent activity on July 8, 2019 @ 10: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
75571 75572 75641 75567 75589 75571 75574 75552 75472 75384 75706 75347 75349 75386 75567
75677 75442 75381 75561 75403 75406 75353 75375 75610 75208 75186 75261 75463 75360 75315
75145 75151 75181 75163 75154 75139 75155 75165 75133 75154 75174 75370 75197 75084 75275
75472 75379 75476 75147 75151 75174 75341 75337 75363 75173 75132 75138 75128 75261 75268
75467 75457 75556 75208 75203 75431 75430 75429 75328 75189 75248 75286 75269 75275 75294
75472 75479 75451 75149 75337 75328 75154 75168 75333 75146 75140 75138 75313 75277 75136
75488 75481 75474 75146 75154 75343 75340 75149 75152 75168 75162 75141 75314 75120 75187
75470 75379 75435 75186 75160 75149 75336 75174 75331 75147 75161 75341 75129 75261 75184
75163 75165 75164 75350 75150 75339 75333 75150 75326 75153 75150 75341 75134 75278 75189
75476 75476 75474 75352 75154 75148 75146 75334 75341 75148 75153 75364 75272 75146 75213
75460 75477 75477 75146 75333 75335 75337 75357 75333 75185 75135 75133 75310 75281 75187
75452 75461 75162 75146 75149 75327 75360 75156 75362 75175 75135 75142 75131 75262 75194
75473 75477 75476 75143 75146 75336 75140 75336 75330 75145 75147 75137 75129 75102 75273
75354 75475 75383 75205 75433 75335 75204 75196 75336 75157 75153 75141 75126 75274 75187
75478 75480 75480 75151 75160 75339 75338 75152 75352 75149 75140 75138 75132 75263 75294
75459 75475 75477 75148 75147 75337 75341 75149 75333 75154 75152 75140 75314 75315 75186
75472 75476 75479 75149 75152 75333 75144 75331 75338 75188 75147 75134 75315 75333 75267
75456 75474 75490 75148 75462 75332 75336 75330 75330 75337 75131 75138 75332 75332 75190
75481 75475 75478 75149 75338 75334 75335 75334 75334 75337 75137 75146 75131 75266 75215
75474 75474 75479 75148 75159 75144 75336 75338 75335 75142 75139 75139 75126 75129 75193
75162 75165 75478 75155 75151 75329 75335 75150 75333 75153 75144 75139 75125 75276 75185
75474 75473 75474 75147 75456 75337 75339 75342 75431 75336 75128 75136 75326 75264 75266
75479 75480 75480 75148 75143 75333 75337 75342 75335 75147 75151 75130 75319 75315 75234

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 75126 bytes 100%
1,000 75105 bytes -21 bytes 100%
10,000 75097 bytes -8 bytes 100%
100,000 75087 bytes -10 bytes 0.58%
1,000,000 75084 bytes -3 bytes 0.29%
10,000,000

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 59304 bytes -15780 bytes (-21.02%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 65965 bytes -9119 bytes (-12.15%)
LZMA2 (Wikipedia) xz xz -9 66812 bytes -8272 bytes (-11.02%)
Brotli (Wikipedia) brotli brotli -q 11 67003 bytes -8081 bytes (-10.76%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 68700 bytes -6384 bytes (-8.50%)
Zstandard (Wikipedia) zstd zstd -19 72220 bytes -2864 bytes (-3.81%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 74792 bytes -292 bytes (-0.39%)

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