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

After GZIP compression these minified files vary in size:
Boot
  61088 bytes (59.7k)
CDN, direct link
cdnjs
  53937 bytes (52.7k)
CDN, direct link
cdnhttps
  53648 bytes (52.4k)
CDN, direct link
unpkg
  53648 bytes (52.4k)
CDN, direct link
gzip -6 (default)
  53535 bytes (52.3k)
local copy
jsdelivr
  53426 bytes (52.2k)
CDN, direct link
gzip -9
  53399 bytes (52.1k)
local copy
libdeflate -12
  51710 bytes (50.5k)
local copy
7zip -mx=9 -tgzip
  51637 bytes (50.4k)
local copy
pigz -11 -n
  51371 bytes (50.2k)
local copy
kzip -s0 -rn -b7
  51349 bytes (50.1k)
local copy
Zopfli
  51287 bytes (50.1k)
local copy

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

You will automatically get the smallest D3 3.5.17 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 2139 bytes by using my D3 3.5.17 Zopfli version instead of the best available CDN (4.17% smaller than jsdelivr, 51287 vs. 53426 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 --mls1024 --bsr6 --lazy --ohh

(found May 6, 2016)
Description Value Parameter
iterations 1000000  --i1000000
maximum blocks 8  --mb8
maximum length score 1024  --mls1024
block splitting recursion 6  --bsr6
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/v3.5.17/d3.min.js --location | md5sum
d1784140c4634b660528c86fac758217  -
curl --silent --compressed http://minime.stephan-brumme.com/files/d3/d3-3.5.17.min.zopfli.js.gz | md5sum
d1784140c4634b660528c86fac758217  -

SHA1:
curl --silent --compressed https://raw.githubusercontent.com/mbostock/d3/v3.5.17/d3.min.js --location | sha1sum
67d801eacd484de18562b6cd4b1c967853f6d63c  -
curl --silent --compressed http://minime.stephan-brumme.com/files/d3/d3-3.5.17.min.zopfli.js.gz | sha1sum
67d801eacd484de18562b6cd4b1c967853f6d63c  -

These CDNs send you the original file:
CDN Size (compressed) MD5 (uncompressed) Timestamp
jsdelivr 53426 bytes d1784140c4634b660528c86fac758217 (invalid)

And some CDNs send you a different file:
CDN Size (compressed) MD5 (uncompressed) Comment / Diff Timestamp
Boot 61088 bytes 5bc245068b1b70d4c3eaef79045023e4 < !function(){function n(n){return n&&(n.ownerDocument||n.do [...]
< r(),S.point=c,S.lineEnd=s}function c(n,t){i(f=n,h=t),g=M,p [...]
< return g}:En(r),w=u===i?function(){return p}:En(i);++y<M;) [...]
< shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],mont [...]
< if(t==e.dx){for((r||s>e.dy)&&(s=e.dy);++i<a;)u=n[i],u.x=o, [...]
> !function(){function n(n){return n&&(n.ownerDocument||n.do [...]
> r(),S.point=c,S.lineEnd=f}function c(n,t){u(s=n,h=t),p=M,g [...]
> return p}:En(r),w=i===u?function(){return g}:En(u);++m<M;) [...]
> shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],mont [...]
> if(t==e.dx){for((r||f>e.dy)&&(f=e.dy);++u<o;)i=n[u],i.x=a, [...]
May 7, 2016 @ 16:09
cdnjs 53937 bytes 5bc245068b1b70d4c3eaef79045023e4 < !function(){function n(n){return n&&(n.ownerDocument||n.do [...]
< r(),S.point=c,S.lineEnd=s}function c(n,t){i(f=n,h=t),g=M,p [...]
< return g}:En(r),w=u===i?function(){return p}:En(i);++y<M;) [...]
< shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],mont [...]
< if(t==e.dx){for((r||s>e.dy)&&(s=e.dy);++i<a;)u=n[i],u.x=o, [...]
> !function(){function n(n){return n&&(n.ownerDocument||n.do [...]
> r(),S.point=c,S.lineEnd=f}function c(n,t){u(s=n,h=t),p=M,g [...]
> return p}:En(r),w=i===u?function(){return g}:En(u);++m<M;) [...]
> shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],mont [...]
> if(t==e.dx){for((r||f>e.dy)&&(f=e.dy);++u<o;)i=n[u],i.x=a, [...]
(invalid)
cdnhttps 53648 bytes 5bc245068b1b70d4c3eaef79045023e4 < !function(){function n(n){return n&&(n.ownerDocument||n.do [...]
< r(),S.point=c,S.lineEnd=s}function c(n,t){i(f=n,h=t),g=M,p [...]
< return g}:En(r),w=u===i?function(){return p}:En(i);++y<M;) [...]
< shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],mont [...]
< if(t==e.dx){for((r||s>e.dy)&&(s=e.dy);++i<a;)u=n[i],u.x=o, [...]
> !function(){function n(n){return n&&(n.ownerDocument||n.do [...]
> r(),S.point=c,S.lineEnd=f}function c(n,t){u(s=n,h=t),p=M,g [...]
> return p}:En(r),w=i===u?function(){return g}:En(u);++m<M;) [...]
> shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],mont [...]
> if(t==e.dx){for((r||f>e.dy)&&(f=e.dy);++u<o;)i=n[u],i.x=a, [...]
November 22, 2016 @ 16:32
unpkg 53648 bytes 5bc245068b1b70d4c3eaef79045023e4 < !function(){function n(n){return n&&(n.ownerDocument||n.do [...]
< r(),S.point=c,S.lineEnd=s}function c(n,t){i(f=n,h=t),g=M,p [...]
< return g}:En(r),w=u===i?function(){return p}:En(i);++y<M;) [...]
< shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],mont [...]
< if(t==e.dx){for((r||s>e.dy)&&(s=e.dy);++i<a;)u=n[i],u.x=o, [...]
> !function(){function n(n){return n&&(n.ownerDocument||n.do [...]
> r(),S.point=c,S.lineEnd=f}function c(n,t){u(s=n,h=t),p=M,g [...]
> return p}:En(r),w=i===u?function(){return g}:En(u);++m<M;) [...]
> shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],mont [...]
> if(t==e.dx){for((r||f>e.dy)&&(f=e.dy);++u<o;)i=n[u],i.x=a, [...]
July 11, 2016 @ 16:30

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

Other Versions

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

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
51287 bytes -3 bytes zopfli --i1000000 --mls1024 --bsr6 --lazy --ohh May 6, 2016 @ 13:04
51290 bytes -2 bytes zopfli --i100000 --mls1024 --bsr6 --lazy --ohh May 5, 2016 @ 11:54
51292 bytes -5 bytes zopfli --i10000 --mls1024 --bsr6 --lazy --ohh May 5, 2016 @ 10:51
51297 bytes -2 bytes zopfli --i10000 --mls32768 --bsr16 --lazy --ohh May 5, 2016 @ 10:44
51299 bytes -5 bytes zopfli --i1000 --mls1024 --bsr6 --lazy --ohh May 5, 2016 @ 10:42
51304 bytes -12 bytes zopfli --i1000 --mls32768 --bsr16 --lazy --ohh May 5, 2016 @ 10:38
51316 bytes zopfli --i100 --mls32768 --bsr16 --lazy --ohh May 5, 2016 @ 10:23

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

Most recent activity on November 22, 2016 @ 16:32.

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
51437 51442 51478 51440 51487 51445 51480 51482 51447 51482 51557 51561 51581 51464 51577
51360 51326 51358 51396 51420 51459 51388 51442 51425 51432 51425 51431 51442 51439 51426
51372 51338 51408 51334 51372 51391 51383 51407 51418 51287 51415 51448 51413 51412 51316
51348 51354 51385 51346 51432 51345 51401 51414 51444 51352 51410 51433 51421 51425 51357
51374 51346 51415 51417 51501 51378 51342 51431 51443 51308 51563 51442 51581 51412 51574
51356 51328 51387 51378 51416 51389 51415 51436 51431 51430 51407 51435 51414 51415 51310
51365 51340 51329 51392 51432 51378 51369 51431 51418 51334 51562 51445 51415 51417 51337
51341 51369 51365 51407 51378 51484 51495 51445 51428 51324 51436 51424 51415 51428 51334
51368 51331 51361 51418 51375 51399 51376 51453 51425 51333 51429 51422 51412 51410 51310
51351 51341 51382 51388 51377 51375 51421 51439 51438 51301 51407 51446 51423 51415 51311
51404 51380 51391 51421 51432 51380 51367 51425 51432 51318 51418 51424 51569 51421 51340
51341 51333 51331 51391 51374 51396 51377 51437 51434 51323 51439 51426 51414 51409 51335
51342 51368 51408 51377 51428 51340 51371 51437 51413 51329 51445 51447 51415 51402 51294
51344 51328 51394 51362 51436 51383 51364 51444 51422 51309 51418 51430 51420 51423 51338
51347 51327 51379 51417 51371 51432 51366 51431 51437 51315 51439 51433 51428 51419 51308
51344 51314 51406 51390 51441 51441 51363 51439 51427 51333 51434 51413 51411 51408 51312
51407 51464 51352 51410 51434 51447 51360 51437 51381 51321 51424 51438 51418 51404 51331
51359 51342 51349 51418 51430 51370 51416 51441 51442 51326 51411 51442 51424 51407 51338
51347 51351 51336 51408 51430 51403 51375 51440 51323 51319 51412 51409 51412 51408 51347
51343 51338 51378 51377 51430 51322 51352 51439 51439 51317 51418 51419 51412 51414 51340
51353 51372 51410 51413 51441 51381 51376 51436 51435 51331 51419 51423 51415 51408 51317
51346 51312 51403 51422 51434 51404 51383 51439 51433 51329 51419 51426 51413 51412 51309
51363 51336 51406 51418 51440 51369 51390 51436 51434 51317 51420 51410 51423 51406 51343

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 51316 bytes 100%
1,000 51299 bytes -17 bytes 100%
10,000 51292 bytes -7 bytes 100%
100,000 51290 bytes -2 bytes 0.87%
1,000,000 51287 bytes -3 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
51609 bytes +322 bytes (+0.63%) +260 bytes
51610 bytes +323 bytes (+0.63%) +261 bytes
51612 bytes +325 bytes (+0.63%) +263 bytes
51547 bytes +260 bytes (+0.51%) +198 bytes
51498 bytes +211 bytes (+0.41%) +149 bytes
51496 bytes +209 bytes (+0.41%) +147 bytes
51400 bytes +113 bytes (+0.22%) +51 bytes
51349 bytes +62 bytes (+0.12%)
51374 bytes +87 bytes (+0.17%) +25 bytes

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 40942 bytes -10345 bytes (-20.17%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 43535 bytes -7752 bytes (-15.11%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 44600 bytes -6687 bytes (-13.04%)
Brotli (Wikipedia) brotli brotli -q 11 46399 bytes -4888 bytes (-9.53%)
LZMA2 (Wikipedia) xz xz -9 47036 bytes -4251 bytes (-8.29%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 48988 bytes -2299 bytes (-4.48%)
ZSTD (Wikipedia) zstd zstd -19 49596 bytes -1691 bytes (-3.30%)

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