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

After GZIP compression these minified files vary in size:
unpkg
  91238 bytes (89.1k)
CDN
Boot
  80013 bytes (78.1k)
CDN
cdnjs
  80013 bytes (78.1k)
CDN
gzip -6 (default)
  79299 bytes (77.4k)
local copy
gzip -9
  78995 bytes (77.1k)
local copy
libdeflate -12
  75731 bytes (74.0k)
local copy
7zip -mx=9 -tgzip
  75372 bytes (73.6k)
local copy
kzip -s0 -rn -b8
  75092 bytes (73.3k)
local copy
zultra
  75083 bytes (73.3k)
local copy
pigz -11 -n
  74899 bytes (73.1k)
local copy
Zopfli
  74797 bytes (73.0k)
local copy
Zopfli (defluff)
  74796 bytes (73.0k)
local copy

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

You will automatically get the smallest D3 5.9.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 5216 bytes by using my D3 5.9.0 Zopfli version instead of the best available CDN (6.97% smaller than cdnjs, 74797 vs. 80013 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 --bsr11 --lazy --ohh

(found February 16, 2019)
Description Value Parameter
iterations 1000000  --i1000000
maximum blocks 8  --mb8
maximum length score 8192  --mls8192
block splitting recursion 11  --bsr11
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 (74796 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.9.0/d3.zip --location | md5sum
448f69b806acc52cdea4d375b76dd367  -
curl --silent --compressed https://minime.stephan-brumme.com/files/d3/d3-5.9.0.min.zopfli.js.gz | md5sum
448f69b806acc52cdea4d375b76dd367  -

SHA1:
curl --silent --compressed https://raw.githubusercontent.com/mbostock/d3/v5.9.0/d3.zip --location | sha1sum
5c6d8214f3441561b77e28ce0ef7aa70bbbd8ebd  -
curl --silent --compressed https://minime.stephan-brumme.com/files/d3/d3-5.9.0.min.zopfli.js.gz | sha1sum
5c6d8214f3441561b77e28ce0ef7aa70bbbd8ebd  -

All listed CDNs deliver identical contents:
CDN Size (compressed) MD5 (uncompressed) Timestamp
unpkg 91238 bytes 448f69b806acc52cdea4d375b76dd367 (invalid)
Boot 80013 bytes 448f69b806acc52cdea4d375b76dd367 February 7, 2019 @ 21:45
cdnjs 80013 bytes 448f69b806acc52cdea4d375b76dd367 February 7, 2019 @ 21: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
74797 bytes -2 bytes zopfli --i1000000 --mls8192 --bsr11 --lazy --ohh February 16, 2019 @ 17:06
74799 bytes -11 bytes zopfli --i100000 --mls8192 --bsr11 --lazy --ohh February 15, 2019 @ 22:11
74810 bytes -8 bytes zopfli --i10000 --mls8192 --bsr11 --lazy --ohh February 13, 2019 @ 15:32
74818 bytes -26 bytes zopfli --i1000 --mls8192 --bsr11 --lazy --ohh February 11, 2019 @ 19:45
74844 bytes zopfli --i100 --mls8192 --bsr11 --lazy --ohh February 11, 2019 @ 16:26

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:54.

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
75093 75084 75047 75052 75058 75246 75250 75197 75247 75115 75241 75121 75104 75126 75247
74904 74973 75270 75263 74962 74932 75265 75467 74862 74945 74962 74905 74968 74974 74991
74873 74870 74892 74908 75063 75075 74870 74868 74858 74925 74941 74891 74888 75097 74845
75103 75207 75206 75182 75063 75064 75073 75080 74864 75316 75079 74874 75081 74963 74859
74878 75217 74926 74914 75129 75136 75137 75117 75107 74954 75231 75032 75008 74958 75022
74889 74879 75072 74878 74882 75089 74895 74881 75064 74887 74872 74871 75045 75013 74858
74893 74887 74894 74881 74872 74886 74877 74878 74881 75022 74882 75018 75023 75001 74991
74894 74879 74876 74916 74937 75150 74909 74882 75073 74875 74876 74875 74797 74833 75087
75180 75203 74892 74873 75083 75055 74874 74876 75065 74890 74877 74878 74839 75021 74999
75182 75203 75183 74873 75061 75091 75069 75067 75060 75067 75063 74877 74993 75105 74841
75184 75206 75178 75185 75063 75087 75090 75068 75103 75138 75066 74873 75041 75023 75001
75176 75058 75210 75187 75087 75087 75088 75069 75064 74994 75068 74876 74938 75005 74996
74872 74886 75208 74879 74872 75063 74893 74876 75071 74876 74874 74871 74837 74837 74993
74874 74893 75115 74878 74887 74918 74880 74882 74873 74878 74887 74875 74845 75001 74999
75080 74893 74873 74869 74867 75087 74876 74880 75078 74876 74872 74868 75039 74806 74987
75182 75159 75213 74871 75082 75089 75089 75068 74878 74879 74883 74869 75042 75000 74997
75185 74872 75181 74874 75061 75084 75087 75062 75101 75060 75065 74868 74990 74998 74997
75180 75208 75209 75178 75085 74886 75088 75066 75071 75069 75073 74868 75043 74880 74998
75190 75205 75200 75177 75086 75087 75093 75071 75063 75060 75062 74874 74937 75001 75000
75179 75212 75186 75061 74873 74866 75070 75069 75059 75131 75062 74868 75026 75001 74883
75188 75207 75208 74875 74875 75093 74891 74876 75062 74876 74875 74873 75045 75011 74999
75205 75209 75207 75055 75063 75056 75089 75069 75064 75062 75064 74876 74997 75163 74995
75183 75208 75208 75179 75064 75068 75070 75074 75059 74878 74876 74874 75015 75055 75000

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 74844 bytes 100%
1,000 74818 bytes -26 bytes 100%
10,000 74810 bytes -8 bytes 100%
100,000 74799 bytes -11 bytes 0.58%
1,000,000 74797 bytes -2 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
75253 bytes +456 bytes (+0.61%) +161 bytes
76618 bytes +1821 bytes (+2.43%) +1526 bytes
76498 bytes +1701 bytes (+2.27%) +1406 bytes
75254 bytes +457 bytes (+0.61%) +162 bytes
75278 bytes +481 bytes (+0.64%) +186 bytes
75257 bytes +460 bytes (+0.61%) +165 bytes
75276 bytes +479 bytes (+0.64%) +184 bytes
75093 bytes +296 bytes (+0.40%) +1 byte
75092 bytes +295 bytes (+0.39%)

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 59024 bytes -15773 bytes (-21.09%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 65769 bytes -9028 bytes (-12.07%)
LZMA2 (Wikipedia) xz xz -9 66524 bytes -8273 bytes (-11.06%)
Brotli (Wikipedia) brotli brotli -q 11 66757 bytes -8040 bytes (-10.75%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 68452 bytes -6345 bytes (-8.48%)
Zstandard (Wikipedia) zstd zstd -19 71969 bytes -2828 bytes (-3.78%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 74599 bytes -198 bytes (-0.26%)

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.