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

After GZIP compression these minified files vary in size:
unpkg
  91491 bytes (89.3k)
CDN
Boot
  80246 bytes (78.4k)
CDN
cdnjs
  80246 bytes (78.4k)
CDN
gzip -6 (default)
  79529 bytes (77.7k)
local copy
gzip -9
  79238 bytes (77.4k)
local copy
libdeflate -12
  76084 bytes (74.3k)
local copy
7zip -mx=9 -tgzip
  75593 bytes (73.8k)
local copy
zultra
  75342 bytes (73.6k)
local copy
kzip -s0 -rn -b8
  75336 bytes (73.6k)
local copy
pigz -11 -n
  75131 bytes (73.4k)
local copy
Zopfli
  75055 bytes (73.3k)
local copy
Zopfli (defluff)
  75052 bytes (73.3k)
local copy

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

You will automatically get the smallest D3 5.9.4 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 5191 bytes by using my D3 5.9.4 Zopfli version instead of the best available CDN (6.92% smaller than cdnjs, 75055 vs. 80246 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 --bsr11 --lazy --ohh

(found July 6, 2019)
Description Value Parameter
iterations 1000000  --i1000000
maximum blocks 8  --mb8
maximum length score 32768  --mls32768
block splitting recursion 11  --bsr11
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 3 more bytes (75052 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.4/d3.zip --location | md5sum
5a02a4fe9dee70c8814e2b556d5da951  -
curl --silent --compressed https://minime.stephan-brumme.com/files/d3/d3-5.9.4.min.zopfli.js.gz | md5sum
5a02a4fe9dee70c8814e2b556d5da951  -

SHA1:
curl --silent --compressed https://raw.githubusercontent.com/mbostock/d3/v5.9.4/d3.zip --location | sha1sum
2ab8e73bc900d97b4af51c52187cbee73e990d2c  -
curl --silent --compressed https://minime.stephan-brumme.com/files/d3/d3-5.9.4.min.zopfli.js.gz | sha1sum
2ab8e73bc900d97b4af51c52187cbee73e990d2c  -

All listed CDNs deliver identical contents:
CDN Size (compressed) MD5 (uncompressed) Timestamp
unpkg 91491 bytes 5a02a4fe9dee70c8814e2b556d5da951 (invalid)
Boot 80246 bytes 5a02a4fe9dee70c8814e2b556d5da951 June 29, 2019 @ 12:46
cdnjs 80246 bytes 5a02a4fe9dee70c8814e2b556d5da951 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:

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
75055 bytes -4 bytes zopfli --i1000000 --mls32768 --bsr11 --lazy --ohh July 6, 2019 @ 01:50
75059 bytes -7 bytes zopfli --i100000 --mls32768 --bsr11 --lazy --ohh July 5, 2019 @ 12:29
75066 bytes -5 bytes zopfli --i10000 --mls32768 --bsr11 --lazy --ohh July 2, 2019 @ 18:02
75071 bytes -7 bytes zopfli --i10000 --mls16384 --bsr16 --lazy --ohh July 2, 2019 @ 17:00
75078 bytes -19 bytes zopfli --i1000 --mls32768 --bsr6 --lazy --ohh July 2, 2019 @ 12:43
75097 bytes zopfli --i100 --mls32768 --bsr6 --lazy --ohh July 2, 2019 @ 12:05

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

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
75540 75546 75607 75516 75515 75526 75319 75503 75300 75347 75669 75339 75320 75328 75490
75412 75424 75337 75370 75180 75181 75316 75333 75586 75399 75186 75236 75404 75243 75300
75115 75322 75438 75120 75097 75134 75118 75136 75096 75128 75153 75144 75123 75231 75055
75326 75134 75472 75180 75107 75300 75113 75310 75110 75441 75124 75294 75257 75237 75151
75100 75339 75160 75169 75158 75163 75399 75394 75313 75342 75218 75252 75250 75192 75158
75330 75138 75411 75116 75120 75299 75327 75117 75294 75295 75112 75297 75284 75270 75105
75419 75304 75343 75120 75118 75327 75311 75134 75300 75292 75134 75102 75253 75222 75101
75322 75428 75392 75155 75115 75099 75109 75173 75317 75113 75115 75293 75092 75110 75055
75120 75414 75345 75103 75109 75101 75304 75116 75293 75295 75111 75295 75250 75254 75159
75115 75414 75417 75115 75100 75332 75307 75305 75293 75295 75115 75322 75228 75336 75231
75417 75305 75437 75311 75302 75126 75329 75306 75330 75343 75117 75095 75280 75270 75230
75422 75432 75441 75412 75296 75119 75307 75312 75117 75293 75138 75301 75234 75236 75152
75419 75412 75341 75118 75114 75104 75302 75121 75112 75296 75114 75300 75095 75068 75153
75420 75309 75409 75174 75166 75164 75173 75170 75293 75292 75118 75293 75095 75244 75152
75118 75110 75111 75118 75116 75104 75307 75126 75126 75291 75113 75104 75276 75223 75151
75419 75318 75337 75109 75295 75104 75308 75131 75120 75293 75116 75294 75276 75237 75150
75417 75413 75412 75118 75295 75296 75304 75307 75319 75340 75122 75300 75278 75234 75233
75318 75418 75331 75116 75297 75296 75305 75303 75114 75303 75297 75299 75278 75336 75156
75427 75421 75442 75425 75297 75296 75327 75305 75304 75305 75299 75145 75281 75236 75153
75412 75416 75328 75121 75110 75122 75306 75118 75292 75301 75115 75101 75095 75279 75153
75116 75115 75441 75118 75297 75099 75307 75116 75303 75302 75117 75091 75277 75234 75152
75419 75414 75446 75421 75297 75305 75303 75307 75299 75312 75307 75302 75297 75232 75234
75429 75412 75444 75319 75298 75102 75311 75304 75303 75292 75119 75293 75277 75290 75102

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 75097 bytes 100%
1,000 75078 bytes -19 bytes 100%
10,000 75066 bytes -12 bytes 100%
100,000 75059 bytes -7 bytes 1.45%
1,000,000 75055 bytes -4 bytes 0.58%
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
75502 bytes +447 bytes (+0.60%) +166 bytes
76858 bytes +1803 bytes (+2.40%) +1522 bytes
76735 bytes +1680 bytes (+2.24%) +1399 bytes
75503 bytes +448 bytes (+0.60%) +167 bytes
75514 bytes +459 bytes (+0.61%) +178 bytes
75501 bytes +446 bytes (+0.59%) +165 bytes
75521 bytes +466 bytes (+0.62%) +185 bytes
75340 bytes +285 bytes (+0.38%) +4 bytes
75336 bytes +281 bytes (+0.37%)

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 59177 bytes -15878 bytes (-21.16%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 65963 bytes -9092 bytes (-12.11%)
LZMA2 (Wikipedia) xz xz -9 66804 bytes -8251 bytes (-10.99%)
Brotli (Wikipedia) brotli brotli -q 11 67023 bytes -8032 bytes (-10.70%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 68673 bytes -6382 bytes (-8.50%)
Zstandard (Wikipedia) zstd zstd -19 72197 bytes -2858 bytes (-3.81%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 74775 bytes -280 bytes (-0.37%)

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.