Choose a version:
47% The original file has 472081 bytes (461.0k) and is available from the project website.
There you can find the official minified version, too, which brings down the size to 221957 bytes (216.8k, 47%).

After GZIP compression these minified files vary in size:
Boot
  84869 bytes (82.9k)
CDN
cdnjs
  74726 bytes (73.0k)
CDN
gzip -6 (default)
  74168 bytes (72.4k)
local copy
gzip -9
  73900 bytes (72.2k)
local copy
libdeflate -12
  70904 bytes (69.2k)
local copy
7zip -mx=9 -tgzip
  70649 bytes (69.0k)
local copy
pigz -11 -n
  70253 bytes (68.6k)
local copy
kzip -s0 -rn -b0
  70162 bytes (68.5k)
local copy
Zopfli
  70110 bytes (68.5k)
local copy
Zopfli (defluff)
  70108 bytes (68.5k)
local copy

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

You will automatically get the smallest D3 4.13.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 4616 bytes by using my D3 4.13.0 Zopfli version instead of the best available CDN (6.58% smaller than cdnjs, 70110 vs. 74726 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 --mls4 --bsr30 --lazy --ohh

(found January 31, 2018)
Description Value Parameter
iterations 1000000  --i1000000
maximum blocks 8  --mb8
maximum length score 4  --mls4
block splitting recursion 30  --bsr30
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 (70108 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/v4.13.0/d3.zip --location | md5sum
e899651bcf1a3591032d7213daeab171  -
curl --silent --compressed https://minime.stephan-brumme.com/files/d3/d3-4.13.0.min.zopfli.js.gz | md5sum
e899651bcf1a3591032d7213daeab171  -

SHA1:
curl --silent --compressed https://raw.githubusercontent.com/mbostock/d3/v4.13.0/d3.zip --location | sha1sum
607e02087446eb2efadcbee253db3aca3d794a7b  -
curl --silent --compressed https://minime.stephan-brumme.com/files/d3/d3-4.13.0.min.zopfli.js.gz | sha1sum
607e02087446eb2efadcbee253db3aca3d794a7b  -

All listed CDNs deliver identical contents:
CDN Size (compressed) MD5 (uncompressed) Timestamp
Boot 84869 bytes e899651bcf1a3591032d7213daeab171 January 29, 2018 @ 18:10
cdnjs 74726 bytes e899651bcf1a3591032d7213daeab171 January 29, 2018 @ 15:04

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

Other Versions

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

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
70110 bytes -2 bytes zopfli --i1000000 --mls4 --bsr30 --lazy --ohh January 31, 2018 @ 08:03
70112 bytes -4 bytes zopfli --i100000 --mls4 --bsr30 --lazy --ohh January 30, 2018 @ 17:43
70116 bytes -12 bytes zopfli --i10000 --mls4 --bsr30 --lazy --ohh January 30, 2018 @ 16:25
70128 bytes -3 bytes zopfli --i1000 --mls4 --bsr30 --lazy --ohh January 30, 2018 @ 15:55
70131 bytes -9 bytes zopfli --i1000 --mls32 --bsr23 --lazy --ohh January 30, 2018 @ 15:55
70140 bytes zopfli --i100 --mls4 --bsr30 --lazy --ohh January 30, 2018 @ 15:43

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

Most recent activity on January 31, 2018 @ 13: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
70475 70480 70391 70393 70405 70403 70404 70413 70298 70287 70251 70280 70372 70297 70383
70162 70186 70227 70211 70281 70216 70271 70273 70225 70231 70227 70152 70213 70172 70173
70170 70160 70174 70151 70134 70182 70184 70187 70149 70232 70224 70162 70143 70202 70167
70178 70146 70120 70145 70179 70172 70175 70162 70167 70234 70137 70149 70132 70188 70195
70212 70188 70128 70144 70166 70248 70252 70260 70149 70377 70240 70188 70474 70295 70200
70144 70123 70146 70149 70149 70160 70173 70161 70187 70153 70143 70173 70131 70162 70168
70146 70146 70121 70170 70146 70168 70165 70142 70203 70147 70177 70337 70126 70165 70177
70163 70127 70166 70179 70152 70171 70193 70249 70183 70328 70235 70171 70131 70167 70148
70143 70155 70120 70155 70160 70175 70182 70161 70151 70155 70146 70176 70129 70169 70308
70175 70167 70127 70189 70151 70158 70173 70242 70172 70159 70159 70150 70132 70169 70159
70146 70125 70127 70146 70146 70151 70147 70141 70185 70185 70208 70192 70137 70178 70196
70142 70127 70122 70146 70121 70168 70148 70159 70167 70150 70167 70170 70143 70165 70186
70143 70127 70123 70147 70148 70158 70199 70144 70142 70162 70167 70152 70126 70143 70308
70142 70124 70192 70218 70152 70166 70258 70251 70215 70191 70337 70212 70126 70157 70164
70143 70121 70121 70144 70143 70161 70173 70190 70208 70153 70167 70148 70131 70175 70309
70142 70144 70125 70144 70146 70162 70170 70144 70184 70174 70196 70173 70126 70154 70148
70142 70132 70124 70146 70145 70161 70169 70150 70179 70155 70190 70148 70129 70166 70148
70146 70171 70129 70149 70123 70154 70173 70149 70174 70147 70165 70182 70132 70170 70156
70173 70132 70126 70147 70123 70149 70205 70142 70183 70156 70175 70155 70125 70164 70322
70174 70126 70183 70146 70117 70164 70201 70254 70213 70185 70337 70184 70130 70166 70173
70144 70147 70127 70145 70144 70157 70176 70142 70179 70138 70335 70151 70138 70163 70176
70144 70110 70123 70181 70153 70151 70167 70143 70177 70153 70156 70173 70145 70164 70307
70147 70150 70123 70149 70161 70157 70175 70170 70178 70153 70169 70175 70129 70157 70152

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 70140 bytes 100%
1,000 70128 bytes -12 bytes 100%
10,000 70116 bytes -12 bytes 100%
100,000 70112 bytes -4 bytes 0.58%
1,000,000 70110 bytes -2 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
70162 bytes +52 bytes (+0.07%)
71580 bytes +1470 bytes (+2.10%) +1418 bytes
71425 bytes +1315 bytes (+1.88%) +1263 bytes
71149 bytes +1039 bytes (+1.48%) +987 bytes
70338 bytes +228 bytes (+0.33%) +176 bytes
70321 bytes +211 bytes (+0.30%) +159 bytes
70164 bytes +54 bytes (+0.08%) +2 bytes
70171 bytes +61 bytes (+0.09%) +9 bytes
70176 bytes +66 bytes (+0.09%) +14 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 54857 bytes -15253 bytes (-21.76%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 60650 bytes -9460 bytes (-13.49%)
LZMA2 (Wikipedia) xz xz -9 61948 bytes -8162 bytes (-11.64%)
Brotli (Wikipedia) brotli brotli -q 11 62138 bytes -7972 bytes (-11.37%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 63032 bytes -7078 bytes (-10.10%)
Zstandard (Wikipedia) zstd zstd -19 67401 bytes -2709 bytes (-3.86%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 68152 bytes -1958 bytes (-2.79%)

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