Choose a version:
47% The original file has 455400 bytes (444.7k) and is available from the project website.
There you can find the official minified version, too, which brings down the size to 215791 bytes (210.7k, 47%).

After GZIP compression these minified files vary in size:
Boot
  82804 bytes (80.9k)
CDN
cdnjs
  81214 bytes (79.3k)
CDN
gzip -6 (default)
  72725 bytes (71.0k)
local copy
jsdelivr
  72587 bytes (70.9k)
CDN
gzip -9
  72454 bytes (70.8k)
local copy
libdeflate -12
  69765 bytes (68.1k)
local copy
7zip -mx=9 -tgzip
  69401 bytes (67.8k)
local copy
zultra
  69192 bytes (67.6k)
local copy
kzip -s0 -rn -b4
  69030 bytes (67.4k)
local copy
pigz -11 -n
  68949 bytes (67.3k)
local copy
Zopfli
  68828 bytes (67.2k)
local copy
Zopfli (defluff)
  68827 bytes (67.2k)
local copy

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

You will automatically get the smallest D3 4.7.1 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 3759 bytes by using my D3 4.7.1 Zopfli version instead of the best available CDN (5.46% smaller than jsdelivr, 68828 vs. 72587 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 --mls32 --bsr7 --lazy --ohh

(found May 4, 2017)
Description Value Parameter
iterations 1000000  --i1000000
maximum blocks 8  --mb8
maximum length score 32  --mls32
block splitting recursion 7  --bsr7
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 (68827 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/v4.7.1/d3.zip --location | md5sum
924f1e35638d515812b650c135fd25ef  -
curl --silent --compressed https://minime.stephan-brumme.com/files/d3/d3-4.7.1.min.zopfli.js.gz | md5sum
924f1e35638d515812b650c135fd25ef  -

SHA1:
curl --silent --compressed https://raw.githubusercontent.com/mbostock/d3/v4.7.1/d3.zip --location | sha1sum
7055a0920b0ddc577d49b4c123b37d4218de040e  -
curl --silent --compressed https://minime.stephan-brumme.com/files/d3/d3-4.7.1.min.zopfli.js.gz | sha1sum
7055a0920b0ddc577d49b4c123b37d4218de040e  -

All listed CDNs deliver identical contents:
CDN Size (compressed) MD5 (uncompressed) Timestamp
Boot 82804 bytes 924f1e35638d515812b650c135fd25ef March 3, 2017 @ 17:52
cdnjs 81214 bytes 924f1e35638d515812b650c135fd25ef March 2, 2017 @ 21:48
jsdelivr 72587 bytes 924f1e35638d515812b650c135fd25ef March 2, 2017 @ 22:03

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
68828 bytes -6 bytes zopfli --i1000000 --mls32 --bsr7 --lazy --ohh May 4, 2017 @ 01:19
68834 bytes -5 bytes zopfli --i100000 --mls32 --bsr7 --lazy --ohh May 3, 2017 @ 00:15
68839 bytes -8 bytes zopfli --i10000 --mls32 --bsr7 --lazy --ohh April 29, 2017 @ 08:11
68847 bytes -2 bytes zopfli --i10000 --mls2 --bsr20 --lazy --ohh April 29, 2017 @ 08:10
68849 bytes -3 bytes zopfli --i10000 --mls4 --bsr11 --lazy --ohh April 29, 2017 @ 08:03
68852 bytes -4 bytes zopfli --i1000 --mls32 --bsr7 --lazy --ohh April 28, 2017 @ 16:18
68856 bytes -20 bytes zopfli --i1000 --mls2 --bsr20 --lazy --ohh April 28, 2017 @ 15:37
68876 bytes zopfli --i100 --mls32 --bsr7 --lazy --ohh April 28, 2017 @ 14:56

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

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
69105 69102 69130 69145 69168 69165 69116 69144 69135 69094 69079 69091 69076 69056 69100
68944 68944 68932 68962 68992 69004 69005 68981 68994 69000 68976 68990 68980 68987 68978
68903 68856 68859 68906 68963 68968 68975 68972 68975 68983 68964 68985 68982 69002 68970
68907 68846 68874 68878 68828 68874 68974 68969 68967 68962 68983 68978 68999 69003 68978
68856 68909 68852 69023 69051 68933 68967 69010 68999 68970 68987 69034 69011 68985 69012
68892 68901 68874 68850 68936 68894 68954 68979 68968 68971 68957 68993 68985 68984 68987
68892 68974 68866 68903 69019 69104 68989 69122 68959 68966 68955 69005 68990 68974 68982
68845 68849 68904 68903 68899 68893 68983 68973 68962 68963 68956 68991 68976 69000 68978
68839 68847 68857 68849 69050 69050 68992 68974 68973 68959 68956 68981 68976 68969 68967
68915 68846 68924 68898 68999 69058 68986 68985 68987 68957 68957 68978 68974 68990 68990
68900 68906 68897 68849 68997 69045 68968 68969 68975 68963 68950 68990 68980 68982 68988
68847 68855 68853 68847 68929 68895 68961 69029 68959 68961 68959 68990 68978 68993 68991
68972 68866 68850 68905 68979 68930 68955 68963 68965 68963 68967 68980 68975 69010 68974
68898 68899 68894 68903 68963 69014 68963 68984 68975 68958 68960 68987 68971 68974 68973
68977 68902 69948 69948 69080 69049 68966 68986 68973 68952 68961 68987 68982 68975 68974
68895 68899 68853 69983 68973 69014 69042 68987 68971 68957 68958 68977 68976 68992 68978
68847 68900 68853 69019 69049 69051 68946 69022 68976 68958 68959 69009 68958 68977 68993
68847 68897 68903 68903 69849 68977 68969 69023 68971 68956 68952 68962 68963 68979 68977
68895 68900 68850 68897 68930 68899 68965 68985 68972 68961 68973 68983 68959 68984 68979
68897 68899 68850 68907 68899 68935 68965 68966 68968 68957 68956 68978 68976 68967 68978
68895 68899 68854 68906 68892 68893 68974 69032 68960 68968 68960 68994 68979 68981 68987
68902 68902 68894 68896 69013 69053 68968 69026 68976 68957 68961 68981 68958 68977 68979
68896 68898 68996 69025 69075 68896 68946 69016 68990 68951 68950 68987 68956 69000 68979

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 68876 bytes 100%
1,000 68852 bytes -24 bytes 100%
10,000 68839 bytes -13 bytes 100%
100,000 68834 bytes -5 bytes 1.45%
1,000,000 68828 bytes -6 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
69036 bytes +208 bytes (+0.30%) +6 bytes
70385 bytes +1557 bytes (+2.26%) +1355 bytes
70065 bytes +1237 bytes (+1.80%) +1035 bytes
69150 bytes +322 bytes (+0.47%) +120 bytes
69030 bytes +202 bytes (+0.29%)
69036 bytes +208 bytes (+0.30%) +6 bytes
69061 bytes +233 bytes (+0.34%) +31 bytes
69050 bytes +222 bytes (+0.32%) +20 bytes
69061 bytes +233 bytes (+0.34%) +31 bytes

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 - for example, your browser actually supports it !
Algorithm Program Parameters Size Compared To Best Zopfli
ZPAQ (Wikipedia) zpaq zpaq -method 69 54030 bytes -14798 bytes (-21.50%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 60090 bytes -8738 bytes (-12.70%)
LZMA2 (Wikipedia) xz xz -9 60952 bytes -7876 bytes (-11.44%)
Brotli (Wikipedia) brotli brotli -q 11 61129 bytes -7699 bytes (-11.19%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 62062 bytes -6766 bytes (-9.83%)
Zstandard (Wikipedia) zstd zstd -19 66475 bytes -2353 bytes (-3.42%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 67515 bytes -1313 bytes (-1.91%)

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.