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

After GZIP compression these minified files vary in size:
Boot
  60903 bytes (59.5k)
CDN, direct link
jsdelivr
  60903 bytes (59.5k)
CDN, direct link
cdnjs
  53768 bytes (52.5k)
CDN, direct link
unpkg
  53481 bytes (52.2k)
CDN, direct link
gzip -6 (default)
  53349 bytes (52.1k)
local copy
cdnhttps
  53343 bytes (52.1k)
CDN, direct link
gzip -9
  53194 bytes (51.9k)
local copy
libdeflate -12
  51536 bytes (50.3k)
local copy
7zip -mx=9 -tgzip
  51475 bytes (50.3k)
local copy
pigz -11 -n
  51184 bytes (50.0k)
local copy
kzip -s0 -rn -b7
  51162 bytes (50.0k)
local copy
Zopfli
  51101 bytes (49.9k)
local copy
Zopfli (defluff)
  51099 bytes (49.9k)
local copy

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

You will automatically get the smallest D3 3.5.4 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 2242 bytes by using my D3 3.5.4 Zopfli version instead of the best available CDN (4.39% smaller than cdnhttps, 51101 vs. 53343 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 --bsr23 --lazy --ohh

(found December 22, 2015)
Description Value Parameter
iterations 100000  --i100000
maximum blocks 8  --mb8
maximum length score 512  --mls512
block splitting recursion 23  --bsr23
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 (51099 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.4/d3.min.js --location | md5sum
3255ea1f743500a5460a1edde9995eb7  -
curl --silent --compressed http://minime.stephan-brumme.com/files/d3/d3-3.5.4.min.zopfli.js.gz | md5sum
3255ea1f743500a5460a1edde9995eb7  -

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

All listed CDNs deliver identical contents:
CDN Size (compressed) MD5 (uncompressed) Timestamp
Boot 60903 bytes 3255ea1f743500a5460a1edde9995eb7 (invalid)
jsdelivr 60903 bytes 3255ea1f743500a5460a1edde9995eb7 (invalid)
cdnjs 53768 bytes 3255ea1f743500a5460a1edde9995eb7 (invalid)
unpkg 53481 bytes 3255ea1f743500a5460a1edde9995eb7 July 11, 2016 @ 16:30
cdnhttps 53343 bytes 3255ea1f743500a5460a1edde9995eb7 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:

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
51101 bytes -3 bytes zopfli --i100000 --mls512 --bsr23 --lazy --ohh December 22, 2015 @ 17:39
51104 bytes -7 bytes zopfli --i10000 --mls512 --bsr23 --lazy --ohh September 25, 2015 @ 04:20
51111 bytes -7 bytes zopfli --i1000 --mls512 --bsr23 --lazy --ohh September 22, 2015 @ 14:18
51118 bytes -11 bytes zopfli --i1000 --mls512 --bsr8 --lazy --ohh September 19, 2015 @ 01:11
51129 bytes -8 bytes zopfli --i1000 --mls256 --bsr7 --lazy --ohh September 19, 2015 @ 00:55
51137 bytes zopfli --i100 --mls512 --bsr8 --lazy --ohh September 18, 2015 @ 20:29

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

Most recent activity on February 20, 2017 @ 14:45.

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
51254 51259 51264 51263 51294 51290 51273 51294 51231 51371 51374 51268 51390 51262 51384
51133 51153 51174 51193 51219 51229 51200 51153 51227 51156 51237 51269 51234 51135 51377
51179 51199 51202 51240 51235 51171 51212 51148 51146 51191 51223 51250 51231 51149 51396
51177 51235 51208 51190 51219 51183 51160 51119 51152 51176 51218 51248 51237 51143 51139
51190 51145 51193 51237 51203 51146 51313 51225 51105 51386 51386 51252 51379 51132 51380
51175 51208 51190 51320 51229 51146 51242 51228 51234 51159 51245 51251 51237 51135 51129
51133 51219 51192 51226 51203 51234 51309 51166 51141 51221 51248 51239 51378 51151 51135
51132 51199 51200 51315 51200 51193 51190 51161 51147 51144 51232 51251 51222 51131 51182
51197 51214 51197 51315 51231 51235 51313 51228 51146 51147 51246 51243 51229 51132 51169
51124 51214 51188 51178 51227 51211 51128 51156 51138 51136 51231 51244 51228 51146 51125
51192 51207 51208 51317 51200 51170 51196 51199 51129 51140 51245 51238 51236 51135 51126
51173 51210 51168 51208 51158 51200 51160 51156 51152 51150 51233 51240 51231 51147 51211
51195 51157 51195 51193 51228 51223 51320 51225 51140 51136 51253 51240 51237 51158 51127
51219 51200 51202 51317 51146 51232 51315 51209 51135 51145 51249 51248 51231 51149 51158
51190 51148 51146 51212 51202 51236 51238 51228 51148 51143 51244 51247 51383 51138 51373
51174 51150 51203 51318 51232 51155 51223 51231 51147 51145 51131 51232 51233 51131 51138
51174 51214 51199 51316 51228 51230 51318 51228 51151 51141 51227 51247 51236 51131 51184
51187 51214 51201 51318 51231 51148 51318 51192 51148 51141 51249 51241 51240 51143 51171
51192 51192 51200 51315 51224 51160 51314 51239 51147 51144 51242 51248 51230 51133 51139
51194 51215 51210 51213 51200 51233 51192 51231 51101 51142 51231 51248 51229 51131 51196
51191 51216 51192 51315 51226 51139 51192 51159 51146 51144 51223 51248 51233 51135 51167
51177 51150 51198 51215 51200 51195 51197 51208 51115 51143 51253 51241 51230 51131 51176
51194 51214 51197 51225 51224 51235 51318 51195 51150 51143 51231 51248 51378 51137 51168

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 51137 bytes 100%
1,000 51111 bytes -26 bytes 100%
10,000 51104 bytes -7 bytes 100%
100,000 51101 bytes -3 bytes 0.58%
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
51416 bytes +315 bytes (+0.62%) +254 bytes
51416 bytes +315 bytes (+0.62%) +254 bytes
51427 bytes +326 bytes (+0.64%) +265 bytes
51362 bytes +261 bytes (+0.51%) +200 bytes
51305 bytes +204 bytes (+0.40%) +143 bytes
51306 bytes +205 bytes (+0.40%) +144 bytes
51212 bytes +111 bytes (+0.22%) +50 bytes
51162 bytes +61 bytes (+0.12%)
51179 bytes +78 bytes (+0.15%) +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 40770 bytes -10331 bytes (-20.22%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 43388 bytes -7713 bytes (-15.09%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 44452 bytes -6649 bytes (-13.01%)
Brotli (Wikipedia) brotli brotli -q 11 46187 bytes -4914 bytes (-9.62%)
LZMA2 (Wikipedia) xz xz -9 46872 bytes -4229 bytes (-8.28%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 48848 bytes -2253 bytes (-4.41%)
ZSTD (Wikipedia) zstd zstd -19 49413 bytes -1688 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