Choose a version:
45% The original file has 326722 bytes (319.1k) and is available from the project website.
There you can find the official minified version, too, which brings down the size to 146797 bytes (143.4k, 45%).

After GZIP compression these minified files vary in size:
Boot
  58778 bytes (57.4k)
CDN
cdnjs
  51842 bytes (50.6k)
CDN
unpkg
  51560 bytes (50.4k)
CDN
gzip -6 (default)
  51466 bytes (50.3k)
local copy
cdnhttps
  51448 bytes (50.2k)
CDN
gzip -9
  51309 bytes (50.1k)
local copy
libdeflate -12
  49620 bytes (48.5k)
local copy
7zip -mx=9 -tgzip
  49557 bytes (48.4k)
local copy
pigz -11 -n
  49368 bytes (48.2k)
local copy
kzip -s0 -rn -b8
  49333 bytes (48.2k)
local copy
Zopfli
  49271 bytes (48.1k)
local copy
Zopfli (defluff)
  49269 bytes (48.1k)
local copy

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

You will automatically get the smallest D3 3.4.9 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 2177 bytes by using my D3 3.4.9 Zopfli version instead of the best available CDN (4.42% smaller than cdnhttps, 49271 vs. 51448 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 --i100000 --mb8 --mls512 --bsr12 --lazy --ohh

(found December 22, 2015)
Description Value Parameter
iterations 100000  --i100000
maximum blocks 8  --mb8
maximum length score 512  --mls512
block splitting recursion 12  --bsr12
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 (49269 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/v3.4.9/d3.min.js --location | md5sum
3cad967c9e31d02ef6bce0e9a8eb9950  -
curl --silent --compressed http://minime.stephan-brumme.com/files/d3/d3-3.4.9.min.zopfli.js.gz | md5sum
3cad967c9e31d02ef6bce0e9a8eb9950  -

SHA1:
curl --silent --compressed https://raw.githubusercontent.com/mbostock/d3/v3.4.9/d3.min.js --location | sha1sum
1c4856db2d552d2a85f02e903632bfa952de1310  -
curl --silent --compressed http://minime.stephan-brumme.com/files/d3/d3-3.4.9.min.zopfli.js.gz | sha1sum
1c4856db2d552d2a85f02e903632bfa952de1310  -

All listed CDNs deliver identical contents:
CDN Size (compressed) MD5 (uncompressed) Timestamp
Boot 58778 bytes 3cad967c9e31d02ef6bce0e9a8eb9950 (invalid)
cdnjs 51842 bytes 3cad967c9e31d02ef6bce0e9a8eb9950 (invalid)
unpkg 51560 bytes 3cad967c9e31d02ef6bce0e9a8eb9950 July 11, 2016 @ 16:31
cdnhttps 51448 bytes 3cad967c9e31d02ef6bce0e9a8eb9950 December 24, 2015 @ 07:33

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
49271 bytes -7 bytes zopfli --i100000 --mls512 --bsr12 --lazy --ohh December 22, 2015 @ 13:52
49278 bytes -8 bytes zopfli --i10000 --mls512 --bsr12 --lazy --ohh October 13, 2015 @ 18:26
49286 bytes -4 bytes zopfli --i1000 --mls512 --bsr12 --lazy --ohh September 19, 2015 @ 07:37
49290 bytes -6 bytes zopfli --i1000 --mls64 --bsr9 --lazy --ohh September 19, 2015 @ 07:25
49296 bytes -5 bytes zopfli --i1000 --mls64 --bsr15 --lazy --ohh September 19, 2015 @ 07:25
49301 bytes -11 bytes zopfli --i1000 --mls8 --bsr18 --lazy --ohh September 19, 2015 @ 07:16
49312 bytes zopfli --i100 --mls64 --bsr9 --lazy --ohh September 18, 2015 @ 21:57

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

Most recent activity on February 24, 2017 @ 01:17.

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 or 100,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
49438 49477 49439 49476 49441 49484 49410 49450 49463 49445 49524 49537 49536 49409 49413
49320 49329 49327 49331 49350 49295 49307 49385 49319 49367 49389 49410 49524 49404 49527
49323 49318 49299 49334 49321 49303 49350 49292 49301 49387 49524 49392 49523 49367 49525
49344 49315 49315 49405 49358 49293 49386 49402 49296 49392 49383 49397 49522 49378 49310
49321 49323 49330 49345 49373 49365 49363 49384 49336 49373 49380 49395 49523 49369 49410
49305 49367 49332 49344 49333 49274 49351 49373 49297 49369 49372 49540 49523 49371 49310
49316 49334 49316 49344 49316 49338 49359 49383 49299 49380 49374 49375 49523 49389 49383
49331 49360 49359 49354 49335 49358 49354 49292 49297 49378 49391 49364 49522 49385 49382
49307 49345 49316 49327 49306 49337 49314 49301 49271 49388 49372 49386 49523 49390 49386
49315 49360 49318 49359 49303 49337 49354 49295 49296 49373 49376 49381 49522 49370 49382
49315 49307 49324 49340 49317 49346 49359 49286 49290 49369 49368 49381 49525 49386 49309
49314 49328 49319 49343 49325 49283 49354 49299 49294 49383 49375 49375 49522 49379 49394
49305 49349 49312 49328 49420 49331 49356 49374 49297 49373 49372 49373 49523 49368 49381
49314 49315 49315 49370 49320 49334 49333 49409 49301 49370 49372 49386 49523 49369 49370
49427 49426 49294 49339 49414 49275 49302 49370 49316 49379 49372 49386 49524 49385 49391
49307 49420 49313 49333 49320 49297 49352 49376 49298 49389 49377 49385 49523 49377 49369
49306 49317 49330 49340 49309 49327 49353 49369 49293 49369 49373 49397 49524 49388 49381
49426 49420 49319 49327 49349 49365 49354 49294 49305 49383 49381 49393 49524 49371 49368
49294 49347 49332 49337 49355 49287 49308 49285 49297 49386 49370 49394 49524 49387 49371
49302 49421 49330 49335 49420 49288 49355 49306 49302 49372 49377 49382 49523 49386 49385
49315 49352 49328 49323 49319 49348 49356 49310 49297 49371 49375 49374 49522 49377 49385
49331 49354 49330 49338 49301 49347 49359 49292 49294 49380 49371 49382 49523 49368 49370
49318 49318 49329 49340 49349 49284 49352 49380 49309 49382 49373 49392 49522 49373 49365

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 49312 bytes 100%
1,000 49286 bytes -26 bytes 100%
10,000 49278 bytes -8 bytes 100%
100,000 49271 bytes -7 bytes 0.87%
1,000,000
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
49562 bytes +291 bytes (+0.59%) +229 bytes
49562 bytes +291 bytes (+0.59%) +229 bytes
49550 bytes +279 bytes (+0.57%) +217 bytes
49490 bytes +219 bytes (+0.44%) +157 bytes
49440 bytes +169 bytes (+0.34%) +107 bytes
49448 bytes +177 bytes (+0.36%) +115 bytes
49348 bytes +77 bytes (+0.16%) +15 bytes
49368 bytes +97 bytes (+0.20%) +35 bytes
49333 bytes +62 bytes (+0.13%)

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 39298 bytes -9973 bytes (-20.24%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 41729 bytes -7542 bytes (-15.31%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 42633 bytes -6638 bytes (-13.47%)
Brotli (Wikipedia) brotli brotli -q 11 44490 bytes -4781 bytes (-9.70%)
LZMA2 (Wikipedia) xz xz -9 45236 bytes -4035 bytes (-8.19%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 46980 bytes -2291 bytes (-4.65%)
ZSTD (Wikipedia) zstd zstd -19 47612 bytes -1659 bytes (-3.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 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