Choose a version:
48% The original file has 507476 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 242993 bytes (237.3k, 48%).

After GZIP compression these minified files vary in size:
Boot
  80251 bytes (78.4k)
CDN
cdnjs
  80251 bytes (78.4k)
CDN
gzip -6 (default)
  79534 bytes (77.7k)
local copy
gzip -9
  79243 bytes (77.4k)
local copy
libdeflate -12
  76089 bytes (74.3k)
local copy
7zip -mx=9 -tgzip
  75608 bytes (73.8k)
local copy
kzip -s0 -rn -b7
  75343 bytes (73.6k)
local copy
pigz -11 -n
  75151 bytes (73.4k)
local copy
Zopfli
  75062 bytes (73.3k)
local copy

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

You will automatically get the smallest D3 5.9.3 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 5189 bytes by using my D3 5.9.3 Zopfli version instead of the best available CDN (6.91% smaller than cdnjs, 75062 vs. 80251 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 --mls32768 --bsr6 --lazy --ohh

(found July 4, 2019)
Description Value Parameter
iterations 1000000  --i1000000
maximum blocks 8  --mb8
maximum length score 32768  --mls32768
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

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.3/d3.zip --location | md5sum
e906708fa5940162b630aa1f9bcd767c  -
curl --silent --compressed https://minime.stephan-brumme.com/files/d3/d3-5.9.3.min.zopfli.js.gz | md5sum
e906708fa5940162b630aa1f9bcd767c  -

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

All listed CDNs deliver identical contents:
CDN Size (compressed) MD5 (uncompressed) Timestamp
Boot 80251 bytes e906708fa5940162b630aa1f9bcd767c June 29, 2019 @ 12:46
cdnjs 80251 bytes e906708fa5940162b630aa1f9bcd767c 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
75062 bytes -3 bytes zopfli --i1000000 --mls32768 --bsr6 --lazy --ohh July 4, 2019 @ 04:30
75065 bytes -7 bytes zopfli --i100000 --mls32768 --bsr6 --lazy --ohh July 3, 2019 @ 13:03
75072 bytes -4 bytes zopfli --i10000 --mls32768 --bsr6 --lazy --ohh July 2, 2019 @ 15:36
75076 bytes -4 bytes zopfli --i10000 --mls16384 --bsr16 --lazy --ohh July 2, 2019 @ 15:05
75080 bytes -12 bytes zopfli --i1000 --mls32768 --bsr6 --lazy --ohh July 2, 2019 @ 12:49
75092 bytes -10 bytes zopfli --i1000 --mls16384 --bsr16 --lazy --ohh July 2, 2019 @ 12:45
75102 bytes zopfli --i100 --mls32768 --bsr6 --lazy --ohh July 2, 2019 @ 12:07

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

Most recent activity on July 4, 2019 @ 04:30.

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
75545 75551 75614 75523 75518 75328 75538 75512 75463 75356 75499 75347 75342 75335 75460
75342 75433 75361 75354 75187 75188 75322 75322 75318 75195 75198 75239 75408 75236 75304
75123 75322 75133 75130 75108 75143 75130 75137 75107 75131 75154 75145 75127 75236 75062
75336 75321 75359 75427 75307 75160 75123 75320 75311 75278 75148 75320 75076 75242 75156
75103 75150 75176 75175 75164 75168 75402 75395 75315 75350 75221 75240 75255 75200 75161
75117 75348 75416 75121 75300 75117 75315 75123 75303 75301 75121 75302 75322 75277 75109
75346 75318 75135 75118 75302 75111 75147 75142 75305 75307 75148 75107 75253 75226 75106
75426 75323 75399 75167 75121 75104 75161 75177 75309 75299 75229 75301 75102 75119 75235
75323 75429 75119 75100 75118 75129 75311 75133 75304 75299 75118 75303 75253 75259 75165
75323 75421 75421 75121 75119 75309 75312 75330 75304 75299 75137 75330 75230 75341 75234
75420 75326 75348 75316 75308 75134 75313 75315 75320 75349 75310 75122 75286 75273 75227
75314 75420 75445 75310 75304 75128 75134 75324 75306 75339 75153 75105 75238 75240 75159
75418 75417 75347 75114 75114 75107 75310 75130 75119 75299 75121 75112 75099 75072 75156
75427 75314 75424 75174 75115 75167 75406 75170 75303 75298 75138 75305 75125 75292 75159
75336 75122 75116 75128 75121 75333 75133 75117 75322 75300 75120 75106 75283 75227 75156
75426 75323 75380 75130 75105 75108 75311 75133 75325 75306 75140 75299 75282 75238 75235
75422 75418 75418 75120 75299 75107 75314 75308 75320 75297 75123 75305 75284 75284 75235
75430 75420 75340 75120 75113 75106 75328 75313 75303 75309 75313 75301 75290 75342 75164
75434 75425 75452 75430 75422 75113 75115 75315 75306 75312 75127 75152 75287 75242 75156
75425 75418 75449 75125 75119 75110 75310 75134 75302 75306 75123 75105 75097 75284 75160
75119 75123 75447 75115 75304 75114 75313 75135 75304 75313 75120 75120 75288 75235 75157
75422 75420 75450 75416 75304 75110 75311 75318 75306 75314 75312 75305 75302 75239 75161
75427 75421 75450 75323 75303 75107 75318 75127 75308 75337 75125 75299 75282 75297 75236

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 75102 bytes 100%
1,000 75080 bytes -22 bytes 100%
10,000 75072 bytes -8 bytes 100%
100,000 75065 bytes -7 bytes 0.87%
1,000,000 75062 bytes -3 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
75511 bytes +449 bytes (+0.60%) +168 bytes
76869 bytes +1807 bytes (+2.41%) +1526 bytes
76743 bytes +1681 bytes (+2.24%) +1400 bytes
75514 bytes +452 bytes (+0.60%) +171 bytes
75525 bytes +463 bytes (+0.62%) +182 bytes
75508 bytes +446 bytes (+0.59%) +165 bytes
75529 bytes +467 bytes (+0.62%) +186 bytes
75343 bytes +281 bytes (+0.37%)
75349 bytes +287 bytes (+0.38%) +6 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 59178 bytes -15884 bytes (-21.16%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 65970 bytes -9092 bytes (-12.11%)
LZMA2 (Wikipedia) xz xz -9 66800 bytes -8262 bytes (-11.01%)
Brotli (Wikipedia) brotli brotli -q 11 67072 bytes -7990 bytes (-10.64%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 68678 bytes -6384 bytes (-8.50%)
Zstandard (Wikipedia) zstd zstd -19 72198 bytes -2864 bytes (-3.82%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 74768 bytes -294 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