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

After GZIP compression these minified files vary in size:
Boot
  61023 bytes (59.6k)
CDN, direct link
cdnjs
  53915 bytes (52.7k)
CDN, direct link
unpkg
  53642 bytes (52.4k)
CDN, direct link
gzip -6 (default)
  53515 bytes (52.3k)
local copy
cdnhttps
  53506 bytes (52.3k)
CDN, direct link
jsdelivr
  53411 bytes (52.2k)
CDN, direct link
gzip -9
  53372 bytes (52.1k)
local copy
libdeflate -12
  51668 bytes (50.5k)
local copy
7zip -mx=9 -tgzip
  51627 bytes (50.4k)
local copy
pigz -11 -n
  51341 bytes (50.1k)
local copy
kzip -s0 -rn -b7
  51317 bytes (50.1k)
local copy
Zopfli
  51268 bytes (50.1k)
local copy
Zopfli (defluff)
  51266 bytes (50.1k)
local copy

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

You will automatically get the smallest D3 3.5.7 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 2143 bytes by using my D3 3.5.7 Zopfli version instead of the best available CDN (4.18% smaller than jsdelivr, 51268 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 --mls16384 --bsr17 --lazy --ohh

(found November 10, 2015)
Description Value Parameter
iterations 1000000  --i1000000
maximum blocks 8  --mb8
maximum length score 16384  --mls16384
block splitting recursion 17  --bsr17
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 (51266 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.7/d3.min.js --location | md5sum
33f21128a88651624a1bfd9cf646c6b6  -
curl --silent --compressed http://minime.stephan-brumme.com/files/d3/d3-3.5.7.min.zopfli.js.gz | md5sum
33f21128a88651624a1bfd9cf646c6b6  -

SHA1:
curl --silent --compressed https://raw.githubusercontent.com/mbostock/d3/v3.5.7/d3.min.js --location | sha1sum
ff2e6f9a6765f3cc1c7b3e6a14f3073d9b874528  -
curl --silent --compressed http://minime.stephan-brumme.com/files/d3/d3-3.5.7.min.zopfli.js.gz | sha1sum
ff2e6f9a6765f3cc1c7b3e6a14f3073d9b874528  -

All listed CDNs deliver identical contents:
CDN Size (compressed) MD5 (uncompressed) Timestamp
Boot 61023 bytes 33f21128a88651624a1bfd9cf646c6b6 November 29, 2015 @ 12:58
cdnjs 53915 bytes 33f21128a88651624a1bfd9cf646c6b6 (invalid)
unpkg 53642 bytes 33f21128a88651624a1bfd9cf646c6b6 July 11, 2016 @ 16:30
cdnhttps 53506 bytes 33f21128a88651624a1bfd9cf646c6b6 December 24, 2015 @ 07:33
jsdelivr 53411 bytes 33f21128a88651624a1bfd9cf646c6b6 (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
51268 bytes -3 bytes zopfli --i1000000 --mls16384 --bsr17 --lazy --ohh November 10, 2015 @ 21:42
51271 bytes -1 byte zopfli --i100000 --mls16384 --bsr15 --lazy --ohh November 10, 2015 @ 18:21
51272 bytes -4 bytes zopfli --i100000 --mls16384 --bsr17 --lazy --ohh November 10, 2015 @ 12:49
51276 bytes -5 bytes zopfli --i10000 --mls16384 --bsr17 --lazy --ohh November 10, 2015 @ 11:55
51281 bytes -4 bytes zopfli --i10000 --mls16384 --bsr22 --lazy --ohh November 10, 2015 @ 11:45
51285 bytes -3 bytes zopfli --i1000 --mls16384 --bsr17 --lazy --ohh November 10, 2015 @ 11:44
51288 bytes -12 bytes zopfli --i1000 --mls16384 --bsr22 --lazy --ohh November 10, 2015 @ 11:34
51300 bytes zopfli --i100 --mls16384 --bsr15 --lazy --ohh November 10, 2015 @ 11:00

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

Most recent activity on July 11, 2016 @ 16: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
51455 51462 51454 51463 51449 51399 51427 51427 51428 51446 51524 51428 51552 51433 51558
51305 51359 51330 51414 51422 51317 51406 51400 51413 51389 51412 51423 51395 51322 51370
51390 51398 51401 51396 51421 51402 51399 51420 51348 51321 51381 51420 51384 51414 51319
51352 51366 51378 51409 51363 51332 51379 51401 51355 51323 51387 51406 51387 51385 51331
51384 51375 51327 51403 51408 51366 51476 51414 51387 51406 51543 51429 51546 51387 51326
51378 51340 51366 51391 51364 51403 51480 51425 51397 51323 51381 51422 51384 51320 51318
51386 51354 51340 51393 51354 51369 51404 51481 51341 51314 51388 51409 51385 51390 51323
51381 51326 51371 51347 51481 51377 51356 51418 51395 51303 51389 51403 51388 51303 51320
51362 51392 51330 51386 51354 51403 51384 51420 51344 51310 51394 51410 51391 51385 51322
51368 51392 51312 51392 51363 51404 51403 51421 51396 51314 51395 51412 51383 51309 51317
51376 51375 51328 51386 51431 51357 51444 51409 51396 51312 51389 51395 51389 51393 51324
51387 51338 51402 51390 51480 51404 51346 51397 51354 51319 51381 51398 51385 51268 51321
51369 51395 51373 51395 51479 51404 51360 51420 51345 51311 51382 51411 51543 51302 51324
51364 51329 51359 51362 51364 51405 51332 51410 51394 51303 51397 51414 51399 51268 51316
51352 51348 51371 51385 51482 51372 51397 51412 51351 51313 51385 51424 51385 51310 51324
51356 51370 51333 51357 51429 51457 51357 51417 51395 51313 51382 51408 51391 51310 51323
51310 51365 51330 51387 51353 51403 51372 51398 51397 51318 51400 51425 51386 51381 51330
51353 51367 51348 51362 51400 51402 51373 51417 51350 51308 51385 51417 51389 51307 51347
51380 51306 51329 51359 51357 51398 51398 51481 51390 51303 51380 51413 51386 51277 51324
51354 51391 51329 51391 51422 51407 51374 51418 51395 51302 51400 51415 51386 51301 51320
51347 51367 51306 51361 51355 51386 51380 51417 51348 51309 51381 51428 51387 51306 51320
51352 51354 51356 51393 51354 51387 51475 51422 51358 51314 51404 51425 51387 51387 51322
51381 51392 51330 51332 51358 51372 51355 51399 51390 51318 51405 51408 51391 51385 51320

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 51300 bytes 100%
1,000 51285 bytes -15 bytes 100%
10,000 51276 bytes -9 bytes 100%
100,000 51271 bytes -5 bytes 0.87%
1,000,000 51268 bytes -3 bytes 0.58%
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
51585 bytes +317 bytes (+0.62%) +268 bytes
51586 bytes +318 bytes (+0.62%) +269 bytes
51591 bytes +323 bytes (+0.63%) +274 bytes
51525 bytes +257 bytes (+0.50%) +208 bytes
51470 bytes +202 bytes (+0.39%) +153 bytes
51469 bytes +201 bytes (+0.39%) +152 bytes
51366 bytes +98 bytes (+0.19%) +49 bytes
51317 bytes +49 bytes (+0.10%)
51334 bytes +66 bytes (+0.13%) +17 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 40870 bytes -10398 bytes (-20.28%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 43496 bytes -7772 bytes (-15.16%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 44564 bytes -6704 bytes (-13.08%)
Brotli (Wikipedia) brotli brotli -q 11 46342 bytes -4926 bytes (-9.61%)
LZMA2 (Wikipedia) xz xz -9 47016 bytes -4252 bytes (-8.29%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 48971 bytes -2297 bytes (-4.48%)
ZSTD (Wikipedia) zstd zstd -19 49574 bytes -1694 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