Choose a version:
48% The original file has 505572 bytes (493.7k) and is available from the project website.
There you can find the official minified version, too, which brings down the size to 241983 bytes (236.3k, 48%).

After GZIP compression these minified files vary in size:
unpkg
  90999 bytes (88.9k)
CDN
Boot
  79813 bytes (77.9k)
CDN
cdnjs
  79813 bytes (77.9k)
CDN
gzip -6 (default)
  79100 bytes (77.2k)
local copy
gzip -9
  78802 bytes (77.0k)
local copy
libdeflate -12
  75565 bytes (73.8k)
local copy
7zip -mx=9 -tgzip
  75144 bytes (73.4k)
local copy
kzip -s0 -rn -b8
  74908 bytes (73.2k)
local copy
zultra
  74898 bytes (73.1k)
local copy
pigz -11 -n
  74722 bytes (73.0k)
local copy
Zopfli
  74628 bytes (72.9k)
local copy
Zopfli (defluff)
  74625 bytes (72.9k)
local copy

perma-link to the smallest file on my server:
http://minime.stephan-brumme.com/files/d3/d3-5.8.0.min.js (or via HTTPS)

You will automatically get the smallest D3 5.8.0 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 5185 bytes by using my D3 5.8.0 Zopfli version instead of the best available CDN (6.95% smaller than cdnjs, 74628 vs. 79813 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 --mls8192 --bsr18 --lazy --ohh

(found January 30, 2019)
Description Value Parameter
iterations 1000000  --i1000000
maximum blocks 8  --mb8
maximum length score 8192  --mls8192
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 3 more bytes (74625 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/v5.8.0/d3.zip --location | md5sum
f3a01b196d643b5f3a13eb03aef12c6a  -
curl --silent --compressed https://minime.stephan-brumme.com/files/d3/d3-5.8.0.min.zopfli.js.gz | md5sum
f3a01b196d643b5f3a13eb03aef12c6a  -

SHA1:
curl --silent --compressed https://raw.githubusercontent.com/mbostock/d3/v5.8.0/d3.zip --location | sha1sum
3c5dc1c4b9cd999e31bab7f72fa0fae10efb7760  -
curl --silent --compressed https://minime.stephan-brumme.com/files/d3/d3-5.8.0.min.zopfli.js.gz | sha1sum
3c5dc1c4b9cd999e31bab7f72fa0fae10efb7760  -

All listed CDNs deliver identical contents:
CDN Size (compressed) MD5 (uncompressed) Timestamp
unpkg 90999 bytes f3a01b196d643b5f3a13eb03aef12c6a (invalid)
Boot 79813 bytes f3a01b196d643b5f3a13eb03aef12c6a January 28, 2019 @ 19:45
cdnjs 79813 bytes f3a01b196d643b5f3a13eb03aef12c6a January 28, 2019 @ 19:45

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

Other Versions

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

6.7.0, 6.6.2, 6.6.1, 6.6.0, 6.5.0, 6.4.0, 6.3.1, 6.2.0, 6.1.1, 6.1.0, 6.0.0,
5.16.0, 5.15.1, 5.15.0, 5.14.2, 5.14.1, 5.14.0, 5.13.1, 5.13.0, 5.12.0, 5.11.0, 5.10.1, 5.10.0,
5.9.7, 5.9.6, 5.9.5, 5.9.4, 5.9.3, 5.9.2, 5.9.1, 5.9.0, 5.8.2, 5.8.1, 5.8.0, 5.7.0, 5.6.0, 5.5.0, 5.4.0, 5.3.0, 5.2.0, 5.1.0, 5.0.1, 5.0.0,
4.13.0, 4.12.2, 4.12.1, 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
74628 bytes -5 bytes zopfli --i1000000 --mls8192 --bsr18 --lazy --ohh January 30, 2019 @ 07:03
74633 bytes -3 bytes zopfli --i100000 --mls8192 --bsr18 --lazy --ohh January 29, 2019 @ 18:22
74636 bytes -8 bytes zopfli --i10000 --mls8192 --bsr18 --lazy --ohh January 29, 2019 @ 16:45
74644 bytes -4 bytes zopfli --i1000 --mls8192 --bsr18 --lazy --ohh January 29, 2019 @ 15:52
74648 bytes -3 bytes zopfli --i1000 --mls8192 --bsr20 --lazy --ohh January 29, 2019 @ 15:51
74651 bytes -24 bytes zopfli --i1000 --mls8192 --bsr13 --lazy --ohh January 29, 2019 @ 15:50
74675 bytes -2 bytes zopfli --i1000 --mls16384 --bsr17 --lazy --ohh January 29, 2019 @ 15:50
74677 bytes zopfli --i100 --mls8192 --bsr20 --lazy --ohh January 29, 2019 @ 14:40

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

Most recent activity on July 20, 2020 @ 12:49.

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, 100,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
75053 75051 74874 75077 75074 75086 74900 75069 74901 74872 75067 74908 74914 74838 75034
74731 74992 74927 75077 74765 74763 74905 75072 75294 74735 74736 74785 74824 74811 74861
74905 74698 74705 74702 74685 74690 74678 74879 74675 74710 74822 74708 74727 75046 74830
74997 74906 74686 74874 74871 74873 74690 74697 74691 74705 74686 74689 74694 74780 74806
74884 74874 74964 74739 74954 74960 74967 74963 74977 74741 74794 74817 74766 74967 74898
74901 74682 74696 74704 74701 74875 74697 74694 74691 74683 74685 74692 74686 74688 74680
74687 74693 74683 74689 74680 74692 74695 74693 74820 74687 74691 74688 74644 74823 74859
74879 74874 74684 74740 74680 74689 74696 74872 74877 74699 74687 74689 74755 74668 74870
74995 74874 74870 74683 74874 74684 74684 74709 74695 74707 74714 74688 74673 74882 74863
74878 74869 74981 74877 74869 74870 74885 74886 74865 74690 74691 74687 74642 74755 74822
74999 74881 74991 74876 74868 74898 74886 74880 74978 74739 74688 74689 74684 74857 74875
75004 74878 74884 74873 74879 74695 74885 74884 74892 74687 74712 74707 74689 74834 74833
75002 74683 74683 74682 74682 74680 74692 74700 74685 74687 74688 74668 74686 74664 74806
74682 74683 74741 74736 74684 74739 74756 74694 74694 74690 74709 74691 74865 74666 74762
74683 74870 74682 74681 74877 74685 74879 74884 74683 74686 74689 74689 74628 74835 74803
74997 74880 74872 74877 74883 74685 74691 74694 74697 74690 74692 74690 74690 74877 74840
74874 74875 74984 74875 74875 74872 74883 74888 74975 74740 74684 74689 74637 74852 74836
74870 74877 74870 74875 74875 74687 74886 74880 74880 74698 74802 74687 74683 74765 74653
75005 74881 74985 74876 74876 74876 74879 74883 74979 74686 74686 74696 74682 74831 74662
74878 74878 74873 74875 74870 74684 74696 74700 74696 74687 74685 74691 74682 74876 74819
74993 74875 74982 74679 74874 74687 74887 74692 74687 74685 74693 74688 74689 74819 74770
74989 74876 74987 74876 74873 74680 74885 74888 74879 74687 74689 74689 74837 74986 74651
74994 74880 74872 74876 74876 74875 74880 74883 74693 74686 74688 74690 74864 74880 74760

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 74677 bytes 100%
1,000 74644 bytes -33 bytes 100%
10,000 74636 bytes -8 bytes 100%
100,000 74633 bytes -3 bytes 0.58%
1,000,000 74628 bytes -5 bytes 0.29%
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
75058 bytes +430 bytes (+0.58%) +150 bytes
76423 bytes +1795 bytes (+2.41%) +1515 bytes
76309 bytes +1681 bytes (+2.25%) +1401 bytes
75069 bytes +441 bytes (+0.59%) +161 bytes
75085 bytes +457 bytes (+0.61%) +177 bytes
75058 bytes +430 bytes (+0.58%) +150 bytes
75091 bytes +463 bytes (+0.62%) +183 bytes
75092 bytes +464 bytes (+0.62%) +184 bytes
74908 bytes +280 bytes (+0.38%)

Non-DEFLATE Algorithms

Archivers based on completely different compression algorithms often produce superior results.
Unfortunately, browsers only support gzip compression at the moment.
However, support for Brotli is constantly growing - but your browser doesn't support it.
Algorithm Program Parameters Size Compared To Best Zopfli
ZPAQ (Wikipedia) zpaq zpaq -method 69 58827 bytes -15801 bytes (-21.17%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 65626 bytes -9002 bytes (-12.06%)
LZMA2 (Wikipedia) xz xz -9 66424 bytes -8204 bytes (-10.99%)
Brotli (Wikipedia) brotli brotli -q 11 66738 bytes -7890 bytes (-10.57%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 68328 bytes -6300 bytes (-8.44%)
Zstandard (Wikipedia) zstd zstd -19 71817 bytes -2811 bytes (-3.77%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 74456 bytes -172 bytes (-0.23%)

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 2024.
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

All trademarks are property of their respective owners. You know, the boring legal stuff.