Choose a version:
45% The original file has 337896 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 151720 bytes (148.2k, 45%).

After GZIP compression these minified files vary in size:
Boot
  61068 bytes (59.6k)
CDN, direct link
cdnjs
  53922 bytes (52.7k)
CDN, direct link
cdnhttps
  53647 bytes (52.4k)
CDN, direct link
unpkg
  53647 bytes (52.4k)
CDN, direct link
gzip -6 (default)
  53521 bytes (52.3k)
local copy
jsdelivr
  53411 bytes (52.2k)
CDN, direct link
gzip -9
  53382 bytes (52.1k)
local copy
libdeflate -12
  51686 bytes (50.5k)
local copy
7zip -mx=9 -tgzip
  51626 bytes (50.4k)
local copy
pigz -11 -n
  51366 bytes (50.2k)
local copy
kzip -s0 -rn -b8
  51351 bytes (50.1k)
local copy
Zopfli
  51289 bytes (50.1k)
local copy
Zopfli (defluff)
  51286 bytes (50.1k)
local copy

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

You will automatically get the smallest D3 3.5.15 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 2122 bytes by using my D3 3.5.15 Zopfli version instead of the best available CDN (4.14% smaller than jsdelivr, 51289 vs. 53411 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 --mls32768 --bsr7 --lazy --ohh

(found February 13, 2016)
Description Value Parameter
iterations 1000000  --i1000000
maximum blocks 8  --mb8
maximum length score 32768  --mls32768
block splitting recursion 7  --bsr7
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 3 more bytes (51286 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.5.15/d3.min.js --location | md5sum
ac6b03f6452a53a6cc7562c18d61793e  -
curl --silent --compressed http://minime.stephan-brumme.com/files/d3/d3-3.5.15.min.zopfli.js.gz | md5sum
ac6b03f6452a53a6cc7562c18d61793e  -

SHA1:
curl --silent --compressed https://raw.githubusercontent.com/mbostock/d3/v3.5.15/d3.min.js --location | sha1sum
81502e5533ab0f32fa8112b6af735c0e48604db0  -
curl --silent --compressed http://minime.stephan-brumme.com/files/d3/d3-3.5.15.min.zopfli.js.gz | sha1sum
81502e5533ab0f32fa8112b6af735c0e48604db0  -

All listed CDNs deliver identical contents:
CDN Size (compressed) MD5 (uncompressed) Timestamp
Boot 61068 bytes ac6b03f6452a53a6cc7562c18d61793e February 13, 2016 @ 16:58
cdnjs 53922 bytes ac6b03f6452a53a6cc7562c18d61793e (invalid)
cdnhttps 53647 bytes ac6b03f6452a53a6cc7562c18d61793e November 22, 2016 @ 16:32
unpkg 53647 bytes ac6b03f6452a53a6cc7562c18d61793e July 11, 2016 @ 16:30
jsdelivr 53411 bytes ac6b03f6452a53a6cc7562c18d61793e (invalid)

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

Other Versions

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

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
51289 bytes -4 bytes zopfli --i1000000 --mls32768 --bsr7 --lazy --ohh February 13, 2016 @ 01:46
51293 bytes -4 bytes zopfli --i100000 --mls32768 --bsr7 --lazy --ohh February 12, 2016 @ 13:56
51297 bytes -4 bytes zopfli --i10000 --mls32768 --bsr7 --lazy --ohh February 12, 2016 @ 11:25
51301 bytes -7 bytes zopfli --i1000 --mls32768 --bsr7 --lazy --ohh February 12, 2016 @ 11:11
51308 bytes -4 bytes zopfli --i1000 --mls32768 --bsr9 --lazy --ohh February 12, 2016 @ 10:59
51312 bytes -12 bytes zopfli --i1000 --mls32 --bsr14 --lazy --ohh February 12, 2016 @ 10:58
51324 bytes zopfli --i100 --mls32768 --bsr9 --lazy --ohh February 12, 2016 @ 10:57

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
51461 51462 51465 51469 51473 51433 51468 51463 51459 51458 51544 51544 51430 51444 51568
51346 51340 51305 51409 51372 51422 51356 51420 51425 51414 51412 51566 51417 51414 51320
51342 51386 51483 51397 51370 51388 51344 51438 51404 51405 51403 51413 51409 51429 51401
51396 51329 51378 51375 51416 51417 51325 51401 51401 51411 51406 51426 51402 51393 51289
51333 51342 51449 51393 51425 51437 51369 51418 51426 51411 51421 51427 51558 51392 51560
51385 51326 51462 51388 51364 51390 51372 51431 51426 51420 51396 51407 51404 51392 51297
51391 51327 51386 51390 51324 51441 51378 51411 51414 51402 51555 51422 51401 51403 51412
51446 51450 51435 51387 51351 51442 51325 51424 51406 51408 51411 51424 51416 51397 51313
51396 51437 51446 51481 51486 51381 51374 51430 51409 51410 51400 51411 51403 51399 51326
51398 51381 51378 51397 51371 51347 51345 51420 51411 51414 51415 51400 51416 51413 51327
51384 51449 51477 51397 51305 51381 51350 51413 51425 51401 51555 51410 51560 51396 51323
51330 51326 51379 51397 51416 51338 51337 51401 51415 51392 51390 51413 51402 51394 51328
51332 51349 51383 51369 51416 51445 51373 51411 51403 51410 51415 51411 51407 51393 51314
51414 51373 51349 51384 51485 51392 51376 51421 51406 51392 51421 51423 51406 51402 51326
51389 51347 51378 51388 51356 51382 51334 51418 51417 51396 51546 51442 51407 51394 51328
51329 51450 51451 51393 51374 51380 51347 51423 51418 51410 51426 51422 51409 51413 51320
51332 51445 51446 51392 51361 51381 51348 51419 51413 51402 51424 51411 51403 51393 51335
51336 51377 51352 51407 51416 51323 51367 51421 51435 51406 51425 51425 51401 51393 51296
51359 51447 51359 51382 51336 51363 51345 51411 51416 51406 51397 51429 51406 51398 51326
51372 51325 51450 51373 51358 51380 51369 51422 51415 51397 51404 51414 51404 51394 51321
51330 51450 51352 51388 51313 51390 51449 51418 51415 51408 51410 51415 51403 51396 51335
51329 51348 51378 51384 51383 51389 51374 51418 51425 51408 51422 51422 51401 51393 51342
51334 51438 51447 51396 51324 51356 51349 51421 51412 51414 51427 51431 51405 51392 51318

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 51313 bytes 100%
1,000 51301 bytes -12 bytes 100%
10,000 51297 bytes -4 bytes 100%
100,000 51293 bytes -4 bytes 0.87%
1,000,000 51289 bytes -4 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
51595 bytes +306 bytes (+0.60%) +244 bytes
51597 bytes +308 bytes (+0.60%) +246 bytes
51605 bytes +316 bytes (+0.62%) +254 bytes
51540 bytes +251 bytes (+0.49%) +189 bytes
51484 bytes +195 bytes (+0.38%) +133 bytes
51474 bytes +185 bytes (+0.36%) +123 bytes
51380 bytes +91 bytes (+0.18%) +29 bytes
51397 bytes +108 bytes (+0.21%) +46 bytes
51351 bytes +62 bytes (+0.12%)

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 40897 bytes -10392 bytes (-20.26%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 43510 bytes -7779 bytes (-15.17%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 44578 bytes -6711 bytes (-13.08%)
Brotli (Wikipedia) brotli brotli -q 11 46343 bytes -4946 bytes (-9.64%)
LZMA2 (Wikipedia) xz xz -9 47016 bytes -4273 bytes (-8.33%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 48992 bytes -2297 bytes (-4.48%)
ZSTD (Wikipedia) zstd zstd -19 49584 bytes -1705 bytes (-3.32%)

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