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

After GZIP compression these minified files vary in size:
Boot
  81219 bytes (79.3k)
CDN
cdnjs
  81219 bytes (79.3k)
CDN
gzip -6 (default)
  80540 bytes (78.7k)
local copy
gzip -9
  80230 bytes (78.3k)
local copy
libdeflate -12
  77050 bytes (75.2k)
local copy
7zip -mx=9 -tgzip
  76573 bytes (74.8k)
local copy
kzip -s0 -rn -b8
  76210 bytes (74.4k)
local copy
pigz -11 -n
  76109 bytes (74.3k)
local copy
Zopfli
  76059 bytes (74.3k)
local copy

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

You will automatically get the smallest D3 5.11.0 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 5160 bytes by using my D3 5.11.0 Zopfli version instead of the best available CDN (6.78% smaller than cdnjs, 76059 vs. 81219 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 --mls32 --bsr20 --lazy --ohh

(found September 2, 2019)
Description Value Parameter
iterations 1000000  --i1000000
maximum blocks 8  --mb8
maximum length score 32  --mls32
block splitting recursion 20  --bsr20
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.11.0/d3.zip --location | md5sum
a2c3ce434146d03a8c1008dce1ac3fd0  -
curl --silent --compressed https://minime.stephan-brumme.com/files/d3/d3-5.11.0.min.zopfli.js.gz | md5sum
a2c3ce434146d03a8c1008dce1ac3fd0  -

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

All listed CDNs deliver identical contents:
CDN Size (compressed) MD5 (uncompressed) Timestamp
Boot 81219 bytes a2c3ce434146d03a8c1008dce1ac3fd0 August 21, 2019 @ 09:15
cdnjs 81219 bytes a2c3ce434146d03a8c1008dce1ac3fd0 August 21, 2019 @ 09:15

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

Other Versions

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

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
76059 bytes -6 bytes zopfli --i1000000 --mls32 --bsr20 --lazy --ohh September 2, 2019 @ 22:45
76065 bytes -4 bytes zopfli --i100000 --mls32 --bsr20 --lazy --ohh August 30, 2019 @ 23:55
76069 bytes -6 bytes zopfli --i10000 --mls32 --bsr20 --lazy --ohh August 30, 2019 @ 16:54
76075 bytes -3 bytes zopfli --i10000 --mls32 --bsr17 --lazy --ohh August 30, 2019 @ 08:20
76078 bytes -3 bytes zopfli --i1000 --mls32 --bsr20 --lazy --ohh August 30, 2019 @ 01:45
76081 bytes -4 bytes zopfli --i1000 --mls32 --bsr17 --lazy --ohh August 30, 2019 @ 00:00
76085 bytes -1 byte zopfli --i1000 --mls4096 --bsr18 --lazy --ohh August 29, 2019 @ 22:41
76086 bytes -1 byte zopfli --i1000 --mls4096 --bsr11 --lazy --ohh August 29, 2019 @ 22:11
76087 bytes -4 bytes zopfli --i1000 --mls2048 --bsr11 --lazy --ohh August 29, 2019 @ 22:02
76091 bytes -4 bytes zopfli --i1000 --mls16 --bsr15 --lazy --ohh August 29, 2019 @ 21:59
76095 bytes zopfli --i100 --mls32 --bsr20 --lazy --ohh August 29, 2019 @ 19:28

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

Most recent activity on September 2, 2019 @ 22:45.

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
76424 76433 76604 76597 76601 76604 76611 76598 76579 76592 76396 76358 76408 76394 76439
76122 76133 76129 76358 76134 76161 76162 76171 76283 76362 76223 76285 76361 76356 76229
76138 76067 76086 76276 76085 76086 76098 76094 76201 76272 76108 76099 76262 76281 76254
76447 76355 76299 76090 76320 76108 76086 76100 76193 76311 76096 76078 76097 76323 76267
76094 76080 76355 76340 76119 76113 76115 76340 76346 76381 76169 76280 76231 76291 76242
76272 76305 76298 76294 76091 76082 76088 76088 76375 76267 76080 76078 76338 76344 76243
76092 76079 76300 76281 76093 76088 76085 76095 76282 76098 76098 76282 76234 76224 76238
76272 76284 76298 76299 76296 76089 76136 76096 76404 76322 76074 76076 76189 76122 76264
76276 76275 76299 76275 76074 76086 76085 76092 76273 76306 76096 76080 76254 76331 76214
76276 76274 76300 76299 76085 76093 76086 76092 76277 76307 76096 76100 76233 76329 76232
76273 76282 76307 76121 76298 76085 76083 76094 76273 76350 76128 76075 76261 76312 76217
76077 76383 76300 76078 76098 76078 76091 76086 76289 76305 76087 76119 76091 76263 76248
76289 76269 76303 76295 76081 76084 76086 76089 76288 76317 76095 76077 76234 76303 76408
76084 76298 76282 76090 76075 76085 76090 76090 76344 76308 76111 76075 76231 76263 76300
76279 76299 76285 76276 76272 76086 76086 76091 76294 76267 76095 76074 76229 76312 76261
76269 76276 76289 76389 76310 76268 76087 76090 76273 76305 76095 76096 76233 76361 76239
76274 76273 76308 76293 76059 76084 76085 76092 76375 76353 76074 76077 76234 76134 76237
76280 76280 76304 76277 76091 76086 76088 76099 76272 76308 76102 76267 76231 76223 76210
76277 76282 76305 76279 76301 76082 76092 76090 76274 76307 76086 76090 76238 76323 76241
76280 76280 76284 76301 76072 76084 76083 76089 76275 76307 76091 76081 76241 76221 76270
76276 76284 76305 76287 76092 76084 76088 76088 76273 76307 76085 76081 76259 76304 76242
76275 76269 76308 76293 76276 76085 76094 76089 76291 76306 76081 76078 76237 76121 76247
76275 76268 76304 76079 76292 76084 76087 76089 76275 76308 76096 76094 76260 76260 76237

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 76095 bytes 100%
1,000 76078 bytes -17 bytes 100%
10,000 76069 bytes -9 bytes 100%
100,000 76065 bytes -4 bytes 0.58%
1,000,000 76059 bytes -6 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
76507 bytes +448 bytes (+0.59%) +297 bytes
77868 bytes +1809 bytes (+2.38%) +1658 bytes
77748 bytes +1689 bytes (+2.22%) +1538 bytes
76495 bytes +436 bytes (+0.57%) +285 bytes
76497 bytes +438 bytes (+0.58%) +287 bytes
76480 bytes +421 bytes (+0.55%) +270 bytes
76459 bytes +400 bytes (+0.53%) +249 bytes
76265 bytes +206 bytes (+0.27%) +55 bytes
76210 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 59804 bytes -16255 bytes (-21.37%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 66594 bytes -9465 bytes (-12.44%)
LZMA2 (Wikipedia) xz xz -9 67496 bytes -8563 bytes (-11.26%)
Brotli (Wikipedia) brotli brotli -q 11 67727 bytes -8332 bytes (-10.95%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 69646 bytes -6413 bytes (-8.43%)
Zstandard (Wikipedia) zstd zstd -19 72944 bytes -3115 bytes (-4.10%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 75539 bytes -520 bytes (-0.68%)

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