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

After GZIP compression these minified files vary in size:
Boot
  58104 bytes (56.7k)
CDN
Baidu
  51133 bytes (49.9k)
CDN
cdnjs
  51124 bytes (49.9k)
CDN
unpkg
  50799 bytes (49.6k)
CDN
gzip -6 (default)
  50735 bytes (49.5k)
local copy
cdnhttps
  50698 bytes (49.5k)
CDN
gzip -9
  50560 bytes (49.4k)
local copy
libdeflate -12
  48983 bytes (47.8k)
local copy
7zip -mx=9 -tgzip
  48890 bytes (47.7k)
local copy
pigz -11 -n
  48677 bytes (47.5k)
local copy
kzip -s0 -rn -b6
  48675 bytes (47.5k)
local copy
Zopfli
  48559 bytes (47.4k)
local copy
Zopfli (defluff)
  48557 bytes (47.4k)
local copy

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

You will automatically get the smallest D3 3.3.8 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 2139 bytes by using my D3 3.3.8 Zopfli version instead of the best available CDN (4.40% smaller than cdnhttps, 48559 vs. 50698 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 --mls4 --bsr18 --lazy --ohh

(found December 21, 2015)
Description Value Parameter
iterations 100000  --i100000
maximum blocks 8  --mb8
maximum length score 4  --mls4
block splitting recursion 18  --bsr18
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 (48557 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.3.8/d3.min.js --location | md5sum
e9b675a2c8f8d0b12777348652800c60  -
curl --silent --compressed http://minime.stephan-brumme.com/files/d3/d3-3.3.8.min.zopfli.js.gz | md5sum
e9b675a2c8f8d0b12777348652800c60  -

SHA1:
curl --silent --compressed https://raw.githubusercontent.com/mbostock/d3/v3.3.8/d3.min.js --location | sha1sum
51ad9265066de0311c1e0723460ba9f12f3136a8  -
curl --silent --compressed http://minime.stephan-brumme.com/files/d3/d3-3.3.8.min.zopfli.js.gz | sha1sum
51ad9265066de0311c1e0723460ba9f12f3136a8  -

These CDNs send you the original file:
CDN Size (compressed) MD5 (uncompressed) Timestamp
Boot 58104 bytes e9b675a2c8f8d0b12777348652800c60 (invalid)
cdnjs 51124 bytes e9b675a2c8f8d0b12777348652800c60 (invalid)
unpkg 50799 bytes e9b675a2c8f8d0b12777348652800c60 July 11, 2016 @ 16:31
cdnhttps 50698 bytes e9b675a2c8f8d0b12777348652800c60 December 24, 2015 @ 07:33

And some CDNs send you a different file:
CDN Size (compressed) MD5 (uncompressed) Comment / Diff Timestamp
Baidu 51133 bytes 6056e8ae951d11c46638ad1ca27a61aa 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.12.0, 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
48559 bytes -6 bytes zopfli --i100000 --mls4 --bsr18 --lazy --ohh December 21, 2015 @ 18:47
48565 bytes -3 bytes zopfli --i10000 --mls4 --bsr18 --lazy --ohh November 23, 2015 @ 17:52
48568 bytes -5 bytes zopfli --i10000 --mls4 --bsr15 --lazy --ohh October 13, 2015 @ 23:20
48573 bytes -1 byte zopfli --i1000 --mls4 --bsr18 --lazy --ohh September 21, 2015 @ 21:56
48574 bytes -3 bytes zopfli --i1000 --mls4 --bsr15 --lazy --ohh September 21, 2015 @ 21:53
48577 bytes -7 bytes zopfli --i1000 --mls4 --bsr7 --lazy --ohh September 21, 2015 @ 21:51
48584 bytes -6 bytes zopfli --i1000 --mls4 --bsr8 --lazy --ohh September 21, 2015 @ 21:49
48590 bytes -3 bytes zopfli --i1000 --mls8 --bsr18 --lazy --ohh September 19, 2015 @ 18:17
48593 bytes -4 bytes zopfli --i1000 --mls8 --bsr15 --lazy --ohh September 19, 2015 @ 18:14
48597 bytes -5 bytes zopfli --i1000 --mls8 --bsr14 --lazy --ohh September 19, 2015 @ 18:12
48602 bytes zopfli --i100 --mls8 --bsr18 --lazy --ohh September 18, 2015 @ 20:52

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

Most recent activity on February 27, 2017 @ 10:17.

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
48841 48855 48789 48732 48728 48774 48775 48724 48659 48706 48717 48704 48859 48866 48869
48695 48652 48657 48658 48628 48702 48712 48752 48717 48632 48640 48710 48859 48767 48856
48745 48671 48649 48659 48669 48679 48691 48707 48713 48723 48704 48638 48859 48857 48847
48603 48561 48586 48670 48656 48698 48705 48705 48703 48705 48715 48826 48856 48857 48850
48621 48573 48675 48655 48726 48694 48716 48720 48703 48618 48711 48715 48854 48856 48850
48699 48667 48676 48648 48723 48581 48719 48714 48707 48734 48693 48604 48855 48855 48851
48706 48653 48614 48646 48652 48672 48713 48717 48670 48698 48713 48781 48750 48758 48849
48720 48752 48703 48730 48698 48684 48774 48681 48696 48721 48711 48644 48853 48776 48850
48605 48590 48669 48654 48646 48669 48712 48710 48670 48617 48675 48674 48857 48860 48850
48671 48625 48586 48646 48669 48709 48718 48718 48708 48715 48683 48683 48843 48849 48851
48604 48627 48585 48657 48688 48694 48720 48713 48693 48619 48616 48615 48849 48751 48846
48592 48561 48587 48649 48652 48689 48715 48711 48706 48706 48719 48700 48847 48780 48685
48691 48612 48665 48638 48675 48699 48720 48705 48698 48711 48705 48618 48753 48853 48849
48639 48595 48616 48634 48638 48681 48703 48718 48704 48695 48708 48705 48856 48850 48849
48609 48559 48584 48619 48644 48695 48714 48717 48704 48736 48719 48701 48845 48849 48850
48634 48589 48643 48643 48685 48708 48713 48716 48705 48705 48716 48705 48847 48849 48852
48627 48669 48601 48642 48641 48695 48706 48715 48702 48704 48705 48785 48847 48850 48833
48603 48592 48589 48635 48659 48689 48715 48718 48694 48737 48714 48613 48846 48851 48851
48594 48588 48592 48647 48631 48697 48707 48702 48700 48704 48715 48758 48849 48851 48844
48636 48627 48592 48643 48685 48690 48671 48710 48710 48707 48715 48705 48848 48851 48850
48596 48634 48573 48653 48655 48698 48715 48717 48695 48619 48704 48709 48850 48766 48851
48607 48597 48643 48643 48681 48682 48717 48719 48680 48730 48714 48709 48847 48749 48838
48593 48561 48588 48642 48682 48680 48708 48713 48706 48706 48718 48700 48849 48848 48852

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 48592 bytes 100%
1,000 48573 bytes -19 bytes 100%
10,000 48565 bytes -8 bytes 100%
100,000 48559 bytes -6 bytes 1.16%
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
48819 bytes +260 bytes (+0.54%) +144 bytes
48901 bytes +342 bytes (+0.70%) +226 bytes
48902 bytes +343 bytes (+0.71%) +227 bytes
48821 bytes +262 bytes (+0.54%) +146 bytes
48827 bytes +268 bytes (+0.55%) +152 bytes
48741 bytes +182 bytes (+0.37%) +66 bytes
48675 bytes +116 bytes (+0.24%)
48694 bytes +135 bytes (+0.28%) +19 bytes
48691 bytes +132 bytes (+0.27%) +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 38874 bytes -9685 bytes (-19.94%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 41302 bytes -7257 bytes (-14.94%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 42002 bytes -6557 bytes (-13.50%)
Brotli (Wikipedia) brotli brotli -q 11 44001 bytes -4558 bytes (-9.39%)
LZMA2 (Wikipedia) xz xz -9 44660 bytes -3899 bytes (-8.03%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 46570 bytes -1989 bytes (-4.10%)
ZSTD (Wikipedia) zstd zstd -19 47094 bytes -1465 bytes (-3.02%)

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