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

After GZIP compression these minified files vary in size:
Boot
  61021 bytes (59.6k)
CDN
cdnjs
  53916 bytes (52.7k)
CDN
unpkg
  53642 bytes (52.4k)
CDN
gzip -6 (default)
  53516 bytes (52.3k)
local copy
jsdelivr
  53410 bytes (52.2k)
CDN
gzip -9
  53374 bytes (52.1k)
local copy
libdeflate -12
  51672 bytes (50.5k)
local copy
zultra
  51653 bytes (50.4k)
local copy
7zip -mx=9 -tgzip
  51630 bytes (50.4k)
local copy
pigz -11 -n
  51351 bytes (50.1k)
local copy
kzip -s0 -rn -b7
  51323 bytes (50.1k)
local copy
Zopfli
  51280 bytes (50.1k)
local copy
Zopfli (defluff)
  51278 bytes (50.1k)
local copy

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

You will automatically get the smallest D3 3.5.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 2130 bytes by using my D3 3.5.8 Zopfli version instead of the best available CDN (4.15% smaller than jsdelivr, 51280 vs. 53410 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 --mls32768 --bsr18 --lazy --ohh

(found November 11, 2015)
Description Value Parameter
iterations 1000000  --i1000000
maximum blocks 8  --mb8
maximum length score 32768  --mls32768
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 (51278 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.5.8/d3.min.js --location | md5sum
2581f5217734cd0e979c3b431ccedb0d  -
curl --silent --compressed https://minime.stephan-brumme.com/files/d3/d3-3.5.8.min.zopfli.js.gz | md5sum
2581f5217734cd0e979c3b431ccedb0d  -

SHA1:
curl --silent --compressed https://raw.githubusercontent.com/mbostock/d3/v3.5.8/d3.min.js --location | sha1sum
f3a59f3c98a7728a251aa38d7814b4c500b796e0  -
curl --silent --compressed https://minime.stephan-brumme.com/files/d3/d3-3.5.8.min.zopfli.js.gz | sha1sum
f3a59f3c98a7728a251aa38d7814b4c500b796e0  -

All listed CDNs deliver identical contents:
CDN Size (compressed) MD5 (uncompressed) Timestamp
Boot 61021 bytes 2581f5217734cd0e979c3b431ccedb0d November 29, 2015 @ 12:58
cdnjs 53916 bytes 2581f5217734cd0e979c3b431ccedb0d (invalid)
unpkg 53642 bytes 2581f5217734cd0e979c3b431ccedb0d July 11, 2016 @ 16:30
jsdelivr 53410 bytes 2581f5217734cd0e979c3b431ccedb0d (invalid)

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
51280 bytes -3 bytes zopfli --i1000000 --mls32768 --bsr18 --lazy --ohh November 11, 2015 @ 21:26
51283 bytes -5 bytes zopfli --i100000 --mls32768 --bsr18 --lazy --ohh November 11, 2015 @ 10:58
51288 bytes -6 bytes zopfli --i10000 --mls32768 --bsr18 --lazy --ohh November 11, 2015 @ 09:26
51294 bytes -12 bytes zopfli --i1000 --mls32768 --bsr18 --lazy --ohh November 11, 2015 @ 08:57
51306 bytes zopfli --i100 --mls32768 --bsr18 --lazy --ohh November 11, 2015 @ 08:45

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

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
51458 51467 51504 51459 51454 51468 51431 51431 51434 51446 51532 51431 51560 51435 51561
51398 51370 51350 51421 51403 51395 51414 51346 51397 51416 51417 51423 51397 51392 51344
51391 51386 51399 51402 51427 51419 51404 51428 51407 51322 51409 51424 51388 51310 51325
51363 51324 51349 51387 51312 51392 51376 51318 51346 51416 51415 51413 51395 51389 51336
51325 51322 51368 51399 51433 51397 51480 51413 51396 51412 51546 51427 51549 51398 51322
51383 51333 51468 51397 51366 51407 51409 51420 51354 51327 51382 51422 51399 51324 51315
51390 51316 51401 51375 51362 51371 51489 51482 51353 51318 51383 51409 51391 51396 51338
51386 51331 51392 51344 51374 51399 51361 51430 51405 51313 51393 51424 51393 51388 51319
51363 51319 51369 51383 51408 51360 51383 51425 51345 51314 51397 51406 51394 51389 51323
51359 51381 51395 51399 51369 51409 51408 51419 51359 51306 51402 51411 51394 51397 51341
51315 51379 51337 51368 51383 51372 51447 51412 51399 51306 51409 51397 51548 51385 51326
51322 51341 51406 51390 51484 51411 51349 51394 51402 51309 51382 51400 51392 51389 51320
51353 51402 51381 51414 51482 51408 51364 51486 51403 51320 51382 51414 51396 51386 51329
51359 51323 51362 51368 51366 51409 51375 51426 51402 51299 51381 51413 51389 51390 51321
51380 51353 51332 51392 51483 51375 51401 51413 51363 51323 51387 51425 51394 51388 51280
51358 51330 51329 51361 51436 51459 51360 51434 51357 51320 51385 51409 51395 51389 51319
51385 51330 51407 51385 51400 51377 51377 51416 51365 51299 51382 51424 51390 51389 51336
51382 51334 51402 51367 51406 51406 51376 51416 51354 51317 51388 51418 51397 51389 51343
51355 51360 51377 51361 51428 51408 51405 51487 51392 51317 51386 51416 51400 51389 51324
51383 51323 51370 51397 51478 51377 51376 51425 51411 51307 51409 51403 51390 51385 51322
51355 51326 51317 51354 51427 51350 51382 51423 51353 51306 51385 51425 51391 51386 51324
51386 51321 51393 51395 51361 51391 51480 51428 51362 51313 51398 51424 51388 51389 51324
51379 51332 51379 51389 51362 51371 51489 51491 51401 51314 51385 51410 51394 51388 51316

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 51306 bytes 100%
1,000 51294 bytes -12 bytes 100%
10,000 51288 bytes -6 bytes 100%
100,000 51283 bytes -5 bytes 10.72%
1,000,000 51280 bytes -3 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
51587 bytes +307 bytes (+0.60%) +264 bytes
51590 bytes +310 bytes (+0.60%) +267 bytes
51594 bytes +314 bytes (+0.61%) +271 bytes
51525 bytes +245 bytes (+0.48%) +202 bytes
51471 bytes +191 bytes (+0.37%) +148 bytes
51475 bytes +195 bytes (+0.38%) +152 bytes
51373 bytes +93 bytes (+0.18%) +50 bytes
51323 bytes +43 bytes (+0.08%)
51336 bytes +56 bytes (+0.11%) +13 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 - but your browser doesn't support it.
Algorithm Program Parameters Size Compared To Best Zopfli
ZPAQ (Wikipedia) zpaq zpaq -method 69 40869 bytes -10411 bytes (-20.30%)
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 43491 bytes -7789 bytes (-15.19%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 44560 bytes -6720 bytes (-13.10%)
Brotli (Wikipedia) brotli brotli -q 11 46329 bytes -4951 bytes (-9.65%)
LZMA2 (Wikipedia) xz xz -9 47032 bytes -4248 bytes (-8.28%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 48956 bytes -2324 bytes (-4.53%)
Zstandard (Wikipedia) zstd zstd -19 49579 bytes -1701 bytes (-3.32%)

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.