Choose a version:
41% The original file has 123765 bytes (120.9k) and is available from the project website.
There you can find the official minified version, too, which brings down the size to 51039 bytes (49.8k, 41%).

After GZIP compression these minified files vary in size:
cdnjs
  14199 bytes (13.9k)
CDN
gzip -6 (default)
  14113 bytes (13.8k)
local copy
MaxCDN
  14090 bytes (13.8k)
CDN
gzip -9
  14061 bytes (13.7k)
local copy
unpkg
  14028 bytes (13.7k)
CDN
libdeflate -12
  13609 bytes (13.3k)
local copy
7zip -mx=9 -tgzip
  13605 bytes (13.3k)
local copy
kzip -s0 -rn -b3
  13531 bytes (13.2k)
local copy
pigz -11 -n
  13530 bytes (13.2k)
local copy
Zopfli
  13496 bytes (13.2k)
local copy
Zopfli (defluff)
  13495 bytes (13.2k)
local copy

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

You will automatically get the smallest Bootstrap 4.1.3 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 532 bytes by using my Bootstrap 4.1.3 Zopfli version instead of the best available CDN (3.94% smaller than unpkg, 13496 vs. 14028 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 --i100000 --mb8 --mls32 --bsr17 --lazy --ohh

(found July 26, 2018)
Description Value Parameter
iterations 100000  --i100000
maximum blocks 8  --mb8
maximum length score 32  --mls32
block splitting recursion 17  --bsr17
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 (13495 bytes).

Verify file integrity

After decompression, my uncompressed files are identical to the original ones:

MD5:
curl --silent --compressed https://raw.githubusercontent.com/twbs/bootstrap/v4.1.3/dist/js/bootstrap.min.js --location | md5sum
67176c242e1bdc20603c878dee836df3  -
curl --silent --compressed https://minime.stephan-brumme.com/files/bootstrap/bootstrap-4.1.3.min.zopfli.js.gz | md5sum
67176c242e1bdc20603c878dee836df3  -

SHA1:
curl --silent --compressed https://raw.githubusercontent.com/twbs/bootstrap/v4.1.3/dist/js/bootstrap.min.js --location | sha1sum
27a71b00383d61ef3c489326b3564d698fc1227c  -
curl --silent --compressed https://minime.stephan-brumme.com/files/bootstrap/bootstrap-4.1.3.min.zopfli.js.gz | sha1sum
27a71b00383d61ef3c489326b3564d698fc1227c  -

All listed CDNs deliver identical contents:
CDN Size (compressed) MD5 (uncompressed) Timestamp
cdnjs 14199 bytes 67176c242e1bdc20603c878dee836df3 (invalid)
MaxCDN 14090 bytes 67176c242e1bdc20603c878dee836df3 (invalid)
unpkg 14028 bytes 67176c242e1bdc20603c878dee836df3 (invalid)

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

Other Versions

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

4.1.3, 4.1.2, 4.1.1, 4.1.0,
4.0.0,
3.3.7, 3.3.6, 3.3.5, 3.3.4, 3.3.2, 3.3.1, 3.3.0,
3.2.0,
3.1.1, 3.1.0,
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, D3, Dojo, Ember, jQuery, Knockout, lodash, React, Socket.IO, ThreeJS, UnderscoreJS and Vue.

Changelog

Best Zopfli parameters so far:
Size Improvement Parameters Found
13496 bytes -1 byte zopfli --i100000 --mls32 --bsr17 --lazy --ohh July 26, 2018 @ 14:10
13497 bytes -1 byte zopfli --i100000 --mls512 --bsr6 --lazy --ohh July 26, 2018 @ 12:43
13498 bytes -1 byte zopfli --i10000 --mls32 --bsr14 --lazy --ohh July 26, 2018 @ 12:04
13499 bytes -1 byte zopfli --i1000 --mls32 --bsr10 --lazy --ohh July 26, 2018 @ 11:45
13500 bytes -1 byte zopfli --i1000 --mls32 --bsr15 --lazy --ohh July 26, 2018 @ 11:44
13501 bytes -3 bytes zopfli --i1000 --mls32 --bsr17 --lazy --ohh July 26, 2018 @ 11:44
13504 bytes zopfli --i100 --mls2 --bsr11 --lazy --ohh July 26, 2018 @ 11:23

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

Most recent activity on July 26, 2018 @ 17:16.

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
13562 13562 13561 13561 13519 13535 13535 13519 13540 13542 13541 13529 13551 13554 13544
13524 13524 13522 13503 13522 13522 13519 13512 13500 13515 13557 13553 13523 13532 13532
13501 13502 13512 13500 13500 13521 13512 13511 13497 13528 13516 13515 13538 13525 13514
13512 13514 13521 13503 13503 13512 13508 13510 13511 13511 13510 13526 13546 13515 13515
13501 13501 13522 13508 13510 13523 13510 13511 13520 13522 13511 13557 13559 13528 13516
13514 13514 13513 13499 13500 13522 13510 13516 13509 13521 13529 13551 13513 13513 13519
13499 13501 13521 13497 13498 13520 13510 13511 13510 13521 13511 13553 13544 13515 13516
13499 13501 13522 13511 13510 13521 13510 13510 13513 13521 13529 13511 13541 13511 13512
13501 13501 13522 13503 13510 13512 13510 13501 13509 13521 13511 13532 13532 13533 13516
13522 13505 13522 13511 13512 13522 13510 13511 13512 13521 13511 13534 13547 13527 13511
13521 13521 13525 13509 13497 13510 13507 13514 13515 13521 13550 13558 13540 13527 13528
13511 13511 13522 13503 13497 13521 13507 13510 13515 13510 13510 13520 13560 13531 13534
13510 13520 13521 13510 13510 13521 13510 13513 13513 13521 13511 13529 13542 13515 13513
13515 13515 13512 13503 13496 13509 13499 13500 13500 13511 13519 13511 13538 13529 13516
13501 13501 13521 13510 13510 13521 13510 13501 13500 13510 13509 13554 13543 13529 13530
13522 13521 13521 13509 13510 13521 13511 13511 13512 13521 13511 13554 13536 13515 13515
13501 13501 13500 13503 13497 13509 13503 13501 13499 13512 13510 13558 13540 13514 13514
13520 13520 13522 13509 13510 13522 13511 13500 13509 13520 13510 13510 13536 13515 13515
13519 13517 13522 13511 13512 13521 13514 13512 13513 13522 13510 13514 13542 13530 13530
13500 13500 13517 13498 13501 13522 13510 13512 13500 13510 13520 13519 13545 13540 13529
13501 13504 13522 13515 13514 13510 13510 13503 13500 13512 13511 13558 13543 13514 13514
13512 13512 13513 13502 13497 13511 13510 13511 13512 13521 13552 13554 13528 13527 13514
13502 13500 13522 13500 13509 13522 13510 13510 13510 13520 13511 13535 13541 13532 13530

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 13504 bytes 100%
1,000 13499 bytes -5 bytes 100%
10,000 13498 bytes -1 byte 100%
100,000 13496 bytes -2 bytes 2.61%
1,000,000 13496 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
13634 bytes +138 bytes (+1.02%) +103 bytes
13634 bytes +138 bytes (+1.02%) +103 bytes
13571 bytes +75 bytes (+0.56%) +40 bytes
13531 bytes +35 bytes (+0.26%)
13539 bytes +43 bytes (+0.32%) +8 bytes
13562 bytes +66 bytes (+0.49%) +31 bytes
13598 bytes +102 bytes (+0.76%) +67 bytes
13622 bytes +126 bytes (+0.93%) +91 bytes
13667 bytes +171 bytes (+1.27%) +136 bytes

Non-DEFLATE Algorithms

Archivers based on completely different compression algorithms often produce superior results.
Unfortunately, browsers only support gzip compression at the moment.
Algorithm Program Parameters Size Compared To Best Zopfli
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 11440 bytes -2056 bytes (-15.23%)
ZPAQ (Wikipedia) zpaq zpaq -method 69 11692 bytes -1804 bytes (-13.37%)
Brotli (Wikipedia) brotli brotli -q 11 12242 bytes -1254 bytes (-9.29%)
LZMA2 (Wikipedia) xz xz -9 13076 bytes -420 bytes (-3.11%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 13255 bytes -241 bytes (-1.79%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 13268 bytes -228 bytes (-1.69%)
Zstandard (Wikipedia) zstd zstd -19 13299 bytes -197 bytes (-1.46%)

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