Choose a version:
46% The original file has 308962 bytes (301.7k) and is available from the project website.
There you can find the official minified version, too, which brings down the size to 143293 bytes (139.9k, 46%).

After GZIP compression these minified files vary in size:
Boot
  56198 bytes (54.9k)
CDN, direct link
Baidu
  49072 bytes (47.9k)
CDN, direct link
cdnjs
  49062 bytes (47.9k)
CDN, direct link
gzip -6 (default)
  48691 bytes (47.5k)
local copy
cdnhttps
  48646 bytes (47.5k)
CDN, direct link
unpkg
  48623 bytes (47.5k)
CDN, direct link
gzip -9
  48520 bytes (47.4k)
local copy
7zip -mx=9 -tgzip
  46978 bytes (45.9k)
local copy
libdeflate -12
  46958 bytes (45.9k)
local copy
pigz -11 -n
  46920 bytes (45.8k)
local copy
kzip -s0 -rn -b7
  46784 bytes (45.7k)
local copy
Zopfli
  46690 bytes (45.6k)
local copy
Zopfli (defluff)
  46689 bytes (45.6k)
local copy

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

You will automatically get the smallest D3 3.2.5 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 1933 bytes by using my D3 3.2.5 Zopfli version instead of the best available CDN (4.14% smaller than unpkg, 46690 vs. 48623 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 --mls8 --bsr10 --lazy --ohh

(found December 21, 2015)
Description Value Parameter
iterations 100000  --i100000
maximum blocks 8  --mb8
maximum length score 8  --mls8
block splitting recursion 10  --bsr10
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 (46689 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.2.5/d3.min.js --location | md5sum
e354f0ac782d2341017c71c4db2d5d46  -
curl --silent --compressed http://minime.stephan-brumme.com/files/d3/d3-3.2.5.min.zopfli.js.gz | md5sum
e354f0ac782d2341017c71c4db2d5d46  -

SHA1:
curl --silent --compressed https://raw.githubusercontent.com/mbostock/d3/v3.2.5/d3.min.js --location | sha1sum
6defec8c1cee7858fc3d6e2814d429f92871cc39  -
curl --silent --compressed http://minime.stephan-brumme.com/files/d3/d3-3.2.5.min.zopfli.js.gz | sha1sum
6defec8c1cee7858fc3d6e2814d429f92871cc39  -

These CDNs send you the original file:
CDN Size (compressed) MD5 (uncompressed) Timestamp
Boot 56198 bytes e354f0ac782d2341017c71c4db2d5d46 (invalid)
cdnjs 49062 bytes e354f0ac782d2341017c71c4db2d5d46 (invalid)
cdnhttps 48646 bytes e354f0ac782d2341017c71c4db2d5d46 December 24, 2015 @ 07:33
unpkg 48623 bytes e354f0ac782d2341017c71c4db2d5d46 July 11, 2016 @ 16:32

And some CDNs send you a different file:
CDN Size (compressed) MD5 (uncompressed) Comment / Diff Timestamp
Baidu 49072 bytes db468825c4e83da45a8512e19c71a33e only whitespaces differ (invalid)

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

Other Versions

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

4.11.0, 4.10.2, 4.10.1, 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
46690 bytes -4 bytes zopfli --i100000 --mls8 --bsr10 --lazy --ohh December 21, 2015 @ 15:49
46694 bytes -4 bytes zopfli --i10000 --mls8 --bsr10 --lazy --ohh November 23, 2015 @ 17:39
46698 bytes -12 bytes zopfli --i1000 --mls8 --bsr10 --lazy --ohh September 20, 2015 @ 03:33
46710 bytes zopfli --i100 --mls8 --bsr10 --lazy --ohh September 18, 2015 @ 22:07

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

Most recent activity on March 1, 2017 @ 03:01.

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
46863 46861 46870 46860 46760 46792 46880 46868 46890 46882 46893 46864 46857 46892 46887
46877 46853 46719 46817 46823 46872 46888 46879 46889 46738 46883 46865 46859 46769 46890
46752 46807 46753 46740 46743 46833 46765 46811 46834 46721 46888 46736 46879 46863 46890
46880 46834 46786 46809 46830 46837 46837 46841 46841 46729 46775 46736 46859 46867 46868
46829 46768 46762 46796 46770 46814 46778 46783 46836 46730 46885 46772 46880 46768 46859
46773 46805 46784 46775 46840 46839 46816 46821 46827 46798 46747 46774 46873 46865 46862
46828 46816 46690 46808 46711 46844 46858 46845 46844 46833 46884 46816 46867 46767 46885
46740 46744 46793 46789 46768 46824 46764 46827 46827 46740 46734 46757 46859 46790 46891
46861 46792 46784 46769 46846 46822 46823 46815 46831 46718 46735 46719 46863 46778 46880
46854 46850 46799 46778 46752 46878 46766 46780 46882 46734 46889 46714 46873 46767 46881
46882 46880 46794 46764 46724 46820 46833 46833 46843 46738 46746 46720 46859 46763 46857
46881 46880 46817 46821 46830 46820 46813 46815 46832 46734 46864 46837 46858 46777 46868
46863 46881 46749 46782 46748 46828 46818 46815 46843 46734 46719 46874 46889 46775 46860
46848 46750 46754 46743 46751 46884 46875 46880 46882 46731 46720 46739 46858 46766 46861
46879 46861 46785 46781 46744 46861 46861 46881 46762 46734 46889 46877 46880 46790 46884
46798 46806 46794 46777 46720 46816 46822 46814 46884 46738 46721 46719 46859 46769 46855
46806 46806 46700 46770 46742 46815 46832 46815 46844 46739 46865 46834 46859 46765 46890
46832 46814 46809 46832 46812 46820 46833 46835 46844 46738 46731 46835 46875 46868 46859
46818 46810 46780 46786 46773 46814 46822 46821 46844 46730 46718 46721 46880 46766 46859
46794 46762 46773 46762 46721 46839 46818 46816 46830 46829 46889 46718 46897 46766 46859
46813 46816 46786 46753 46719 46833 46824 46835 46827 46726 46889 46835 46859 46766 46857
46862 46861 46766 46763 46713 46820 46819 46827 46838 46880 46727 46834 46858 46763 46862
46801 46796 46805 46790 46749 46841 46821 46815 46837 46829 46859 46722 46881 46767 46859

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 46710 bytes 100%
1,000 46698 bytes -12 bytes 100%
10,000 46694 bytes -4 bytes 100%
100,000 46690 bytes -4 bytes 0.29%
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
46889 bytes +199 bytes (+0.43%) +105 bytes
46907 bytes +217 bytes (+0.46%) +123 bytes
46895 bytes +205 bytes (+0.44%) +111 bytes
46851 bytes +161 bytes (+0.34%) +67 bytes
46876 bytes +186 bytes (+0.40%) +92 bytes
46871 bytes +181 bytes (+0.39%) +87 bytes
46849 bytes +159 bytes (+0.34%) +65 bytes
46784 bytes +94 bytes (+0.20%)
46808 bytes +118 bytes (+0.25%) +24 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 37502 bytes -9188 bytes (-19.68%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 39735 bytes -6955 bytes (-14.90%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 40329 bytes -6361 bytes (-13.62%)
Brotli (Wikipedia) brotli brotli -q 11 42388 bytes -4302 bytes (-9.21%)
LZMA2 (Wikipedia) xz xz -9 43076 bytes -3614 bytes (-7.74%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 44922 bytes -1768 bytes (-3.79%)
ZSTD (Wikipedia) zstd zstd -19 45093 bytes -1597 bytes (-3.42%)

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