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

After GZIP compression these minified files vary in size:
Boot
  60735 bytes (59.3k)
CDN, direct link
jsdelivr
  60735 bytes (59.3k)
CDN, direct link
cdnjs
  55355 bytes (54.1k)
CDN, direct link
unpkg
  53345 bytes (52.1k)
CDN, direct link
gzip -6 (default)
  53227 bytes (52.0k)
local copy
cdnhttps
  53221 bytes (52.0k)
CDN, direct link
gzip -9
  53071 bytes (51.8k)
local copy
libdeflate -12
  51378 bytes (50.2k)
local copy
7zip -mx=9 -tgzip
  51360 bytes (50.2k)
local copy
pigz -11 -n
  51062 bytes (49.9k)
local copy
kzip -s0 -rn -b7
  51051 bytes (49.9k)
local copy
Zopfli
  50989 bytes (49.8k)
local copy
Zopfli (defluff)
  50987 bytes (49.8k)
local copy

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

You will automatically get the smallest D3 3.5.2 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 2232 bytes by using my D3 3.5.2 Zopfli version instead of the best available CDN (4.38% smaller than cdnhttps, 50989 vs. 53221 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 --mls2048 --bsr30 --lazy --ohh

(found December 22, 2015)
Description Value Parameter
iterations 100000  --i100000
maximum blocks 8  --mb8
maximum length score 2048  --mls2048
block splitting recursion 30  --bsr30
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 (50987 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.2/d3.min.js --location | md5sum
22cea7e169dd8298061db0ee2fd4483a  -
curl --silent --compressed http://minime.stephan-brumme.com/files/d3/d3-3.5.2.min.zopfli.js.gz | md5sum
22cea7e169dd8298061db0ee2fd4483a  -

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

All listed CDNs deliver identical contents:
CDN Size (compressed) MD5 (uncompressed) Timestamp
Boot 60735 bytes 22cea7e169dd8298061db0ee2fd4483a (invalid)
jsdelivr 60735 bytes 22cea7e169dd8298061db0ee2fd4483a (invalid)
cdnjs 55355 bytes 22cea7e169dd8298061db0ee2fd4483a (invalid)
unpkg 53345 bytes 22cea7e169dd8298061db0ee2fd4483a July 11, 2016 @ 16:30
cdnhttps 53221 bytes 22cea7e169dd8298061db0ee2fd4483a 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.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
50989 bytes -1 byte zopfli --i100000 --mls2048 --bsr30 --lazy --ohh December 22, 2015 @ 17:37
50990 bytes -3 bytes zopfli --i100000 --mls2048 --bsr23 --lazy --ohh September 28, 2015 @ 06:35
50993 bytes -9 bytes zopfli --i10000 --mls2048 --bsr23 --lazy --ohh September 26, 2015 @ 23:52
51002 bytes -1 byte zopfli --i1000 --mls2048 --bsr23 --lazy --ohh September 22, 2015 @ 16:13
51003 bytes -1 byte zopfli --i1000 --mls2048 --bsr21 --lazy --ohh September 22, 2015 @ 15:32
51004 bytes -1 byte zopfli --i1000 --mls2048 --bsr19 --lazy --ohh September 21, 2015 @ 15:07
51005 bytes -1 byte zopfli --i1000 --mls2048 --bsr20 --lazy --ohh September 19, 2015 @ 02:34
51006 bytes -3 bytes zopfli --i1000 --mls1024 --bsr20 --lazy --ohh September 19, 2015 @ 02:31
51009 bytes -1 byte zopfli --i1000 --mls1024 --bsr13 --lazy --ohh September 19, 2015 @ 02:30
51010 bytes -12 bytes zopfli --i1000 --mls8 --bsr10 --lazy --ohh September 19, 2015 @ 02:04
51022 bytes -3 bytes zopfli --i1000 --mls8 --bsr12 --lazy --ohh September 19, 2015 @ 02:03
51025 bytes -1 byte zopfli --i1000 --mls8 --bsr6 --lazy --ohh September 19, 2015 @ 02:03
51026 bytes zopfli --i100 --mls16384 --bsr18 --lazy --ohh September 18, 2015 @ 20:34

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 @ 21:39.

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
51176 51181 51152 51177 51182 51167 51171 51168 51122 51255 51273 51146 51273 51259 51269
51107 51021 51048 51045 51084 51057 51099 51040 51029 51038 51264 51147 51264 51135 51041
51082 51089 51019 51030 51060 51033 51061 51022 51032 51036 51264 51114 51267 51262 51041
51051 51057 51031 51069 51088 51110 51030 51034 51024 51013 51023 51119 51265 51013 51061
51077 51079 51048 51065 51067 51093 51116 51022 51009 51021 51260 51110 51277 51050 51263
51074 51087 51030 51047 51063 51027 51090 51034 51088 51008 51074 51125 51262 51022 51263
51043 51041 51001 51063 51183 51061 51111 51031 51009 51000 51264 51137 51260 51033 51263
51075 51013 51029 51064 51035 51028 51102 51030 51011 51010 51003 51110 51266 51122 51263
51050 51024 51013 51064 51025 51047 51153 51035 51006 51003 51000 51118 51257 51027 51042
51145 51060 51039 51059 51061 51025 51188 51032 51010 51003 51011 51122 51265 51014 51048
51145 51089 51027 51070 51063 51030 51192 51025 51006 51020 51010 51101 51262 51015 51054
51098 51067 51039 51065 51027 51024 51087 51080 51011 51022 51006 51106 51261 51013 51263
51073 51062 51040 51065 51060 51029 51107 51039 51006 51010 51263 51124 51263 51027 51040
51037 51019 51013 51048 51079 51035 51192 51032 51017 51006 51008 51121 51262 51010 51050
51052 51010 51038 51090 51031 51034 51094 51080 51008 51018 51264 51135 51266 51009 51039
51071 51051 51028 51090 51073 51033 51028 51047 51010 51022 50997 51105 51263 51024 51045
51072 51029 51005 51049 51062 51028 51148 51059 51015 51000 50991 51103 51262 51022 51087
51072 51061 51015 51051 51065 51032 51074 51036 51008 51011 50992 51117 51262 51021 51042
51055 51045 51039 51088 51091 51039 51065 51109 51020 50998 51077 51114 51265 51026 51038
51075 51057 51032 51043 51063 51032 51150 51039 51024 51019 50990 51107 51263 51025 51044
51080 51069 51030 51047 51031 51055 51120 51034 51011 51029 50990 51124 51261 51008 51044
51074 51059 51030 51065 51027 51035 51129 51036 51010 51001 50989 51116 51258 51023 51043
51051 51062 51034 51070 51066 51026 51133 51033 51017 50998 50999 51120 51262 51016 51046

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 51020 bytes 100%
1,000 51002 bytes -18 bytes 100%
10,000 50993 bytes -9 bytes 100%
100,000 50989 bytes -4 bytes 1.45%
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
51302 bytes +313 bytes (+0.61%) +251 bytes
51302 bytes +313 bytes (+0.61%) +251 bytes
51308 bytes +319 bytes (+0.63%) +257 bytes
51250 bytes +261 bytes (+0.51%) +199 bytes
51196 bytes +207 bytes (+0.41%) +145 bytes
51198 bytes +209 bytes (+0.41%) +147 bytes
51102 bytes +113 bytes (+0.22%) +51 bytes
51051 bytes +62 bytes (+0.12%)
51067 bytes +78 bytes (+0.15%) +16 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 40694 bytes -10295 bytes (-20.19%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 43302 bytes -7687 bytes (-15.08%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 44361 bytes -6628 bytes (-13.00%)
Brotli (Wikipedia) brotli brotli -q 11 46106 bytes -4883 bytes (-9.58%)
LZMA2 (Wikipedia) xz xz -9 46796 bytes -4193 bytes (-8.22%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 48739 bytes -2250 bytes (-4.41%)
ZSTD (Wikipedia) zstd zstd -19 49304 bytes -1685 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