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

After GZIP compression these minified files vary in size:
Boot
  60935 bytes (59.5k)
CDN, direct link
jsdelivr
  60935 bytes (59.5k)
CDN, direct link
cdnjs
  53795 bytes (52.5k)
CDN, direct link
unpkg
  53507 bytes (52.3k)
CDN, direct link
fastcdn
  53502 bytes (52.2k)
CDN, direct link
gzip -6 (default)
  53378 bytes (52.1k)
local copy
cdnhttps
  53369 bytes (52.1k)
CDN, direct link
gzip -9
  53220 bytes (52.0k)
local copy
libdeflate -12
  51535 bytes (50.3k)
local copy
7zip -mx=9 -tgzip
  51499 bytes (50.3k)
local copy
pigz -11 -n
  51206 bytes (50.0k)
local copy
kzip -s0 -rn -b7
  51186 bytes (50.0k)
local copy
Zopfli
  51119 bytes (49.9k)
local copy
Zopfli (defluff)
  51118 bytes (49.9k)
local copy

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

You will automatically get the smallest D3 3.5.6 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 2250 bytes by using my D3 3.5.6 Zopfli version instead of the best available CDN (4.40% smaller than cdnhttps, 51119 vs. 53369 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 --mls256 --bsr6 --lazy --ohh

(found October 12, 2015)
Description Value Parameter
iterations 1000000  --i1000000
maximum blocks 8  --mb8
maximum length score 256  --mls256
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

Even Smaller Files Thanks To Defluff

Zopfli's output can be further optimized by the defluff tool.
In this particular case, defluff saves 1 more byte (51118 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.6/d3.min.js --location | md5sum
f3ba03784f98e7e7985fc96413714837  -
curl --silent --compressed http://minime.stephan-brumme.com/files/d3/d3-3.5.6.min.zopfli.js.gz | md5sum
f3ba03784f98e7e7985fc96413714837  -

SHA1:
curl --silent --compressed https://raw.githubusercontent.com/mbostock/d3/v3.5.6/d3.min.js --location | sha1sum
3c99518b7bcfea5c6d489ab5e070b98b8acd5f55  -
curl --silent --compressed http://minime.stephan-brumme.com/files/d3/d3-3.5.6.min.zopfli.js.gz | sha1sum
3c99518b7bcfea5c6d489ab5e070b98b8acd5f55  -

These CDNs send you the original file:
CDN Size (compressed) MD5 (uncompressed) Timestamp
Boot 60935 bytes f3ba03784f98e7e7985fc96413714837 (invalid)
jsdelivr 60935 bytes f3ba03784f98e7e7985fc96413714837 (invalid)
cdnjs 53795 bytes f3ba03784f98e7e7985fc96413714837 (invalid)
unpkg 53507 bytes f3ba03784f98e7e7985fc96413714837 July 11, 2016 @ 16:30
cdnhttps 53369 bytes f3ba03784f98e7e7985fc96413714837 December 24, 2015 @ 07:33

And some CDNs send you a different file:
CDN Size (compressed) MD5 (uncompressed) Comment / Diff Timestamp
fastcdn 53502 bytes e9b501452b74836764e9c186f2ed337e < !function(){function n(n){return n&&(n.ownerDocument||n.do [...]
> !function(){function n(n){return n&&(n.ownerDocument||n.do [...]
November 4, 2015 @ 10:08

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
51119 bytes -1 byte zopfli --i1000000 --mls256 --bsr6 --lazy --ohh October 12, 2015 @ 00:55
51120 bytes -2 bytes zopfli --i1000000 --mls16384 --bsr23 --lazy --ohh October 11, 2015 @ 02:43
51122 bytes -1 byte zopfli --i100000 --mls256 --bsr6 --lazy --ohh September 28, 2015 @ 11:47
51123 bytes -9 bytes zopfli --i10000 --mls256 --bsr6 --lazy --ohh September 21, 2015 @ 04:08
51132 bytes -23 bytes zopfli --i1000 --mls256 --bsr6 --lazy --ohh September 18, 2015 @ 23:15
51155 bytes zopfli --i100 --mls16384 --bsr12 --lazy --ohh September 18, 2015 @ 20:44

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 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
51276 51284 51287 51318 51318 51308 51320 51312 51268 51293 51397 51291 51416 51281 51408
51151 51316 51230 51182 51180 51256 51242 51246 51177 51168 51252 51288 51259 51158 51403
51213 51223 51228 51228 51254 51153 51237 51119 51169 51169 51238 51276 51251 51167 51405
51211 51236 51233 51335 51242 51181 51227 51183 51193 51179 51240 51270 51258 51178 51160
51197 51238 51218 51242 51227 51187 51336 51138 51137 51410 51405 51282 51413 51156 51173
51214 51252 51218 51335 51223 51160 51335 51212 51194 51174 51241 51271 51402 51170 51212
51202 51242 51245 51337 51221 51230 51233 51232 51197 51217 51239 51274 51254 51157 51161
51204 51236 51218 51338 51238 51198 51330 51181 51122 51176 51250 51271 51396 51163 51217
51209 51225 51222 51338 51236 51185 51259 51156 51198 51172 51249 51271 51396 51134 51164
51212 51243 51212 51332 51245 51247 51238 51183 51148 51151 51246 51277 51244 51151 51171
51212 51225 51219 51337 51246 51194 51337 51215 51122 51144 51263 51272 51250 51158 51167
51218 51336 51191 51330 51181 51195 51227 51220 51187 51217 51268 51250 51251 51155 51162
51212 51340 51219 51249 51248 51165 51339 51229 51196 51177 51242 51258 51250 51175 51166
51238 51220 51218 51339 51222 51179 51336 51209 51232 51174 51244 51267 51249 51154 51214
51203 51239 51241 51339 51224 51229 51230 51257 51158 51169 51253 51272 51236 51159 51160
51210 51222 51228 51337 51229 51241 51337 51210 51150 51167 51252 51245 51250 51152 51212
51210 51206 51217 51245 51250 51167 51216 51210 51171 51175 51269 51259 51248 51158 51172
51211 51336 51215 51338 51252 51192 51341 51208 51187 51174 51253 51270 51252 51158 51170
51210 51233 51222 51338 51247 51256 51338 51209 51199 51174 51242 51270 51251 51153 51171
51216 51335 51220 51246 51224 51192 51222 51210 51188 51169 51246 51266 51251 51120 51210
51213 51237 51217 51338 51180 51137 51341 51210 51202 51164 51249 51262 51251 51157 51178
51214 51221 51217 51341 51164 51193 51335 51228 51192 51170 51250 51280 51252 51153 51164
51215 51228 51215 51245 51255 51196 51338 51136 51176 51177 51246 51271 51411 51157 51169

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 51150 bytes 100%
1,000 51132 bytes -18 bytes 100%
10,000 51123 bytes -9 bytes 100%
100,000 51122 bytes -1 byte 1.16%
1,000,000 51119 bytes -3 bytes 1.16%
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
51441 bytes +322 bytes (+0.63%) +255 bytes
51442 bytes +323 bytes (+0.63%) +256 bytes
51446 bytes +327 bytes (+0.64%) +260 bytes
51384 bytes +265 bytes (+0.52%) +198 bytes
51331 bytes +212 bytes (+0.41%) +145 bytes
51332 bytes +213 bytes (+0.42%) +146 bytes
51235 bytes +116 bytes (+0.23%) +49 bytes
51186 bytes +67 bytes (+0.13%)
51201 bytes +82 bytes (+0.16%) +15 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 40773 bytes -10346 bytes (-20.24%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 43404 bytes -7715 bytes (-15.09%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 44453 bytes -6666 bytes (-13.04%)
Brotli (Wikipedia) brotli brotli -q 11 46167 bytes -4952 bytes (-9.69%)
LZMA2 (Wikipedia) xz xz -9 46888 bytes -4231 bytes (-8.28%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 48871 bytes -2248 bytes (-4.40%)
ZSTD (Wikipedia) zstd zstd -19 49441 bytes -1678 bytes (-3.28%)

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