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

After GZIP compression these minified files vary in size:
Boot
  83288 bytes (81.3k)
CDN
cdnjs
  73576 bytes (71.9k)
CDN
gzip -6 (default)
  73130 bytes (71.4k)
local copy
jsdelivr
  72958 bytes (71.2k)
CDN
gzip -9
  72848 bytes (71.1k)
local copy
libdeflate -12
  70010 bytes (68.4k)
local copy
7zip -mx=9 -tgzip
  69747 bytes (68.1k)
local copy
kzip -s0 -rn -b8
  69454 bytes (67.8k)
local copy
pigz -11 -n
  69251 bytes (67.6k)
local copy
Zopfli
  69211 bytes (67.6k)
local copy
Zopfli (defluff)
  69209 bytes (67.6k)
local copy

perma-link to the smallest file on my server:
http://minime.stephan-brumme.com/files/d3/d3-4.8.0.min.js

You will automatically get the smallest D3 4.8.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 3747 bytes by using my D3 4.8.0 Zopfli version instead of the best available CDN (5.41% smaller than jsdelivr, 69211 vs. 72958 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 --bsr25 --lazy --ohh

(found May 3, 2017)
Description Value Parameter
iterations 1000000  --i1000000
maximum blocks 8  --mb8
maximum length score 4  --mls4
block splitting recursion 25  --bsr25
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 (69209 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.8.0/d3.zip --location | md5sum
2c40c3447d2c25dad73c0695696f585a  -
curl --silent --compressed http://minime.stephan-brumme.com/files/d3/d3-4.8.0.min.zopfli.js.gz | md5sum
2c40c3447d2c25dad73c0695696f585a  -

SHA1:
curl --silent --compressed https://raw.githubusercontent.com/mbostock/d3/v4.8.0/d3.zip --location | sha1sum
6573c52226f3d3a88a762dc47bcc79a3caa21056  -
curl --silent --compressed http://minime.stephan-brumme.com/files/d3/d3-4.8.0.min.zopfli.js.gz | sha1sum
6573c52226f3d3a88a762dc47bcc79a3caa21056  -

All listed CDNs deliver identical contents:
CDN Size (compressed) MD5 (uncompressed) Timestamp
Boot 83288 bytes 2c40c3447d2c25dad73c0695696f585a April 18, 2017 @ 20:36
cdnjs 73576 bytes 2c40c3447d2c25dad73c0695696f585a April 15, 2017 @ 08:03
jsdelivr 72958 bytes 2c40c3447d2c25dad73c0695696f585a April 15, 2017 @ 08:04

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

Other Versions

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

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
69211 bytes -7 bytes zopfli --i1000000 --mls4 --bsr25 --lazy --ohh May 3, 2017 @ 05:06
69218 bytes -1 byte zopfli --i100000 --mls4 --bsr25 --lazy --ohh May 2, 2017 @ 13:00
69219 bytes -4 bytes zopfli --i100000 --mls2 --bsr11 --lazy --ohh May 2, 2017 @ 11:37
69223 bytes -2 bytes zopfli --i10000 --mls2 --bsr11 --lazy --ohh April 28, 2017 @ 20:50
69225 bytes -1 byte zopfli --i10000 --mls8 --bsr21 --lazy --ohh April 28, 2017 @ 20:41
69226 bytes -5 bytes zopfli --i10000 --mls8 --bsr22 --lazy --ohh April 28, 2017 @ 20:33
69231 bytes -1 byte zopfli --i1000 --mls4 --bsr25 --lazy --ohh April 28, 2017 @ 15:34
69232 bytes -28 bytes zopfli --i1000 --mls2 --bsr11 --lazy --ohh April 28, 2017 @ 15:33
69260 bytes zopfli --i100 --mls8 --bsr21 --lazy --ohh April 28, 2017 @ 14:50

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

Most recent activity on May 3, 2017 @ 10:34.

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
69498 69687 69505 69521 69575 69573 69488 69474 69438 69505 69480 69465 69450 69457 69498
69282 69498 69358 69274 69326 69315 69287 69276 69269 69420 69377 69390 69379 69409 69387
69275 69348 69290 69293 69259 69272 69377 69372 69285 69387 69362 69402 69399 69404 69419
69238 69260 69244 69238 70365 69268 69649 69642 69384 69382 69382 69254 69386 69407 69406
69326 69259 69257 69265 69445 69356 69443 69370 69364 69380 69420 69378 69412 69427 69384
69280 69276 69232 69258 69444 69403 69403 69367 69244 69363 69351 69258 69408 69404 69385
69276 69274 69254 69243 69405 69397 69407 69389 69369 69363 69359 69357 69368 69353 69379
69219 69229 69228 69238 69406 69403 69373 69374 69377 69376 69354 69387 69389 69384 69376
69276 69272 69229 69242 69376 69371 69378 69400 69379 69376 69374 69360 69393 69390 69403
69275 69276 69252 69239 69398 69398 69367 69397 69382 69376 69356 69354 69375 69341 69378
69273 69273 69230 69240 69402 69350 69358 69373 69372 69379 69348 69378 69381 69344 69378
69237 69231 69229 69240 69380 69358 69403 69381 69384 69379 69361 69263 69398 69422 69392
69329 69272 69221 69242 69403 69366 69374 69370 69372 69368 69367 69394 69379 69414 69376
69235 69271 69232 69237 69410 69360 69366 69372 69367 69375 69343 69242 69378 69340 69378
69231 69396 69349 69409 69402 69370 69382 69369 69373 69345 69343 69388 69409 69382 69376
69275 69230 69367 69450 69405 69452 69370 69380 69365 69344 69343 69359 69341 69416 69385
69233 69272 69402 69412 69406 69354 69382 69380 69379 69344 69342 69382 69341 69405 69378
69274 69270 69221 69237 69443 69447 69406 69380 69376 69344 69340 69365 69369 69379 69379
69279 69232 69221 69238 69314 69402 69404 69370 69371 69344 69341 69362 69347 69407 69396
69273 69272 69230 69239 69278 69229 69379 69375 69402 69343 69341 69388 69344 69410 69348
69269 69211 69228 69235 69437 69450 69393 69373 69379 69343 69342 69459 69343 69309 69344
69275 69272 69238 69235 69440 69401 69408 69372 69380 69340 69336 69354 69345 69381 69391
69305 69274 69234 69235 70300 69399 69343 70303 69381 69340 69342 69372 69359 69383 69347

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 69260 bytes 100%
1,000 69231 bytes -29 bytes 100%
10,000 69223 bytes -8 bytes 100%
100,000 69218 bytes -5 bytes 1.45%
1,000,000 69211 bytes -7 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
69477 bytes +266 bytes (+0.38%) +23 bytes
70793 bytes +1582 bytes (+2.29%) +1339 bytes
70475 bytes +1264 bytes (+1.83%) +1021 bytes
69604 bytes +393 bytes (+0.57%) +150 bytes
69480 bytes +269 bytes (+0.39%) +26 bytes
69487 bytes +276 bytes (+0.40%) +33 bytes
69498 bytes +287 bytes (+0.41%) +44 bytes
69457 bytes +246 bytes (+0.36%) +3 bytes
69454 bytes +243 bytes (+0.35%)

Non-DEFLATE Algorithms

Archivers based on completely different compression algorithms often produce superior results.
Unfortunately, browsers only support gzip compression at the moment.
Algorithm Program Parameters Size Compared To Best Zopfli
ZPAQ (Wikipedia) zpaq zpaq -method 69 54405 bytes -14806 bytes (-21.39%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 60512 bytes -8699 bytes (-12.57%)
LZMA2 (Wikipedia) xz xz -9 61324 bytes -7887 bytes (-11.40%)
Brotli (Wikipedia) brotli brotli -q 11 61581 bytes -7630 bytes (-11.02%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 62508 bytes -6703 bytes (-9.68%)
ZSTD (Wikipedia) zstd zstd -19 66859 bytes -2352 bytes (-3.40%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 68030 bytes -1181 bytes (-1.71%)

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