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

After GZIP compression these minified files vary in size:
Boot
  83024 bytes (81.1k)
CDN
cdnjs
  73421 bytes (71.7k)
CDN
gzip -6 (default)
  72978 bytes (71.3k)
local copy
jsdelivr
  72808 bytes (71.1k)
CDN
gzip -9
  72686 bytes (71.0k)
local copy
libdeflate -12
  69881 bytes (68.2k)
local copy
7zip -mx=9 -tgzip
  69621 bytes (68.0k)
local copy
zultra
  69319 bytes (67.7k)
local copy
kzip -s0 -rn -b8
  69305 bytes (67.7k)
local copy
pigz -11 -n
  69142 bytes (67.5k)
local copy
Zopfli
  69056 bytes (67.4k)
local copy
Zopfli (defluff)
  69055 bytes (67.4k)
local copy

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

You will automatically get the smallest D3 4.7.4 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 3752 bytes by using my D3 4.7.4 Zopfli version instead of the best available CDN (5.43% smaller than jsdelivr, 69056 vs. 72808 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 --mls512 --bsr9 --lazy --ohh

(found May 4, 2017)
Description Value Parameter
iterations 1000000  --i1000000
maximum blocks 8  --mb8
maximum length score 512  --mls512
block splitting recursion 9  --bsr9
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 (69055 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.4/d3.zip --location | md5sum
df8b584f13760fca40f57c90d657c9a4  -
curl --silent --compressed https://minime.stephan-brumme.com/files/d3/d3-4.7.4.min.zopfli.js.gz | md5sum
df8b584f13760fca40f57c90d657c9a4  -

SHA1:
curl --silent --compressed https://raw.githubusercontent.com/mbostock/d3/v4.7.4/d3.zip --location | sha1sum
4ee91f31be6e23f5c907e284bfe0c35d5bca2810  -
curl --silent --compressed https://minime.stephan-brumme.com/files/d3/d3-4.7.4.min.zopfli.js.gz | sha1sum
4ee91f31be6e23f5c907e284bfe0c35d5bca2810  -

All listed CDNs deliver identical contents:
CDN Size (compressed) MD5 (uncompressed) Timestamp
Boot 83024 bytes df8b584f13760fca40f57c90d657c9a4 March 31, 2017 @ 05:03
cdnjs 73421 bytes df8b584f13760fca40f57c90d657c9a4 March 24, 2017 @ 17:48
jsdelivr 72808 bytes df8b584f13760fca40f57c90d657c9a4 March 24, 2017 @ 17:33

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
69056 bytes -6 bytes zopfli --i1000000 --mls512 --bsr9 --lazy --ohh May 4, 2017 @ 01:25
69062 bytes -8 bytes zopfli --i100000 --mls512 --bsr9 --lazy --ohh May 3, 2017 @ 01:21
69070 bytes -11 bytes zopfli --i10000 --mls512 --bsr9 --lazy --ohh April 29, 2017 @ 06:08
69081 bytes -1 byte zopfli --i1000 --mls512 --bsr9 --lazy --ohh April 28, 2017 @ 15:53
69082 bytes -11 bytes zopfli --i1000 --mls2 --bsr21 --lazy --ohh April 28, 2017 @ 15:36
69093 bytes -15 bytes zopfli --i1000 --mls16 --bsr30 --lazy --ohh April 28, 2017 @ 15:34
69108 bytes zopfli --i100 --mls512 --bsr9 --lazy --ohh April 28, 2017 @ 15:19

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
69346 69346 69361 69373 69479 69427 69331 69323 69361 69354 69337 69313 69313 69305 69356
69350 69345 69133 69132 69171 69128 69179 69137 69129 69253 69223 69247 69227 69245 69243
69127 69085 69181 69093 69102 69101 69228 69223 69127 69237 69228 69247 69241 69265 69254
69102 69080 69085 69090 69080 69228 69459 69222 69204 69222 69221 69262 69245 69246 69257
69152 69106 69106 69084 69337 69328 69289 69201 69299 69219 69231 69244 69246 69236 69234
69079 69078 69095 69081 69084 69092 69220 69224 69056 69232 69222 69167 69261 69163 69263
69087 69084 69103 69092 69254 69213 69218 69228 69212 69203 69222 69115 69256 69222 69243
69079 69080 69089 69083 69084 69082 69223 69223 69086 69209 69218 69235 69263 69226 69234
69120 69080 69089 69139 69255 69223 69259 69213 69085 69222 69231 69234 69237 69257 69252
69081 69080 69109 69086 69214 69211 69212 69250 69202 69218 69218 69233 69253 69172 69248
69132 69083 69091 69079 69254 69225 69254 69225 69208 69221 69223 69252 69255 69223 69261
69079 69084 69086 69084 69081 69232 69211 69222 69227 69215 69219 69248 69225 69217 69254
69163 69116 69087 69082 69206 69231 69210 69227 69084 69217 69219 69237 69248 69197 69262
69124 69082 69090 69081 69256 69227 69206 69223 69092 69234 69217 69104 69222 69220 69231
69122 70172 70150 69200 69250 69223 69256 69223 69201 69184 69230 69265 69210 69233 69262
69079 69080 69089 69301 69206 69227 69223 69220 69223 69180 69195 69235 69203 69224 69261
69081 69084 69249 69203 69210 69224 69222 69225 69226 69184 69188 69250 69194 69226 69230
69070 69080 69090 69138 69200 69216 69333 69231 69201 69187 69229 69241 69212 69220 69250
69123 69081 69088 69085 69253 69223 69215 69225 69205 69183 69198 69243 69210 69222 69231
69121 69080 69090 69090 69080 69086 69211 69223 69215 69181 69224 69235 69197 69231 69227
69079 69084 69088 69084 69087 69088 69262 69226 69072 69183 69224 69116 69204 69225 69228
69129 69081 69084 69086 69201 69213 69258 69241 69210 69182 69183 69319 69214 69225 69194
69123 69080 69088 69229 69255 69206 69217 69225 69086 69186 69216 69202 69227 69204 69193

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 69108 bytes 100%
1,000 69081 bytes -27 bytes 100%
10,000 69070 bytes -11 bytes 100%
100,000 69062 bytes -8 bytes 0.87%
1,000,000 69056 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
69328 bytes +272 bytes (+0.39%) +23 bytes
70640 bytes +1584 bytes (+2.29%) +1335 bytes
70321 bytes +1265 bytes (+1.83%) +1016 bytes
69448 bytes +392 bytes (+0.57%) +143 bytes
69327 bytes +271 bytes (+0.39%) +22 bytes
69336 bytes +280 bytes (+0.41%) +31 bytes
69347 bytes +291 bytes (+0.42%) +42 bytes
69308 bytes +252 bytes (+0.36%) +3 bytes
69305 bytes +249 bytes (+0.36%)

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 54323 bytes -14733 bytes (-21.33%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 60364 bytes -8692 bytes (-12.59%)
LZMA2 (Wikipedia) xz xz -9 61204 bytes -7852 bytes (-11.37%)
Brotli (Wikipedia) brotli brotli -q 11 61350 bytes -7706 bytes (-11.16%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 62340 bytes -6716 bytes (-9.73%)
Zstandard (Wikipedia) zstd zstd -19 66740 bytes -2316 bytes (-3.35%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 67824 bytes -1232 bytes (-1.78%)

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.