Choose a version:
43% The original file has 115048 bytes (112.4k) and is available from the project website.
There you can find the official minified version, too, which brings down the size to 48944 bytes (47.8k, 43%).

After GZIP compression these minified files vary in size:
Boot
  16088 bytes (15.7k)
CDN
MaxCDN
  14848 bytes (14.5k)
CDN
cdnjs
  13216 bytes (12.9k)
CDN
gzip -6 (default)
  13128 bytes (12.8k)
local copy
Sina
  13105 bytes (12.8k)
CDN
Microsoft
  13103 bytes (12.8k)
CDN
gzip -9
  13069 bytes (12.8k)
local copy
unpkg
  13054 bytes (12.7k)
CDN
7zip -mx=9 -tgzip
  12661 bytes (12.4k)
local copy
libdeflate -12
  12635 bytes (12.3k)
local copy
kzip -s0 -rn -b2
  12633 bytes (12.3k)
local copy
pigz -11 -n
  12611 bytes (12.3k)
local copy
zultra
  12610 bytes (12.3k)
local copy
Zopfli
  12595 bytes (12.3k)
local copy
jsdelivr
  12031 bytes (11.7k)
CDN

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

You will automatically get the smallest Bootstrap 4.0.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

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 --mls8192 --bsr9 --lazy --ohh

(found January 19, 2018)
Description Value Parameter
iterations 100000  --i100000
maximum blocks 8  --mb8
maximum length score 8192  --mls8192
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

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.0.0/dist/js/bootstrap.min.js --location | md5sum
14d449eb8876fa55e1ef3c2cc52b0c17  -
curl --silent --compressed https://minime.stephan-brumme.com/files/bootstrap/bootstrap-4.0.0.min.zopfli.js.gz | md5sum
14d449eb8876fa55e1ef3c2cc52b0c17  -

SHA1:
curl --silent --compressed https://raw.githubusercontent.com/twbs/bootstrap/v4.0.0/dist/js/bootstrap.min.js --location | sha1sum
a9545831803b1359cfeed47e3b4d6bae68e40e99  -
curl --silent --compressed https://minime.stephan-brumme.com/files/bootstrap/bootstrap-4.0.0.min.zopfli.js.gz | sha1sum
a9545831803b1359cfeed47e3b4d6bae68e40e99  -

These CDNs send you the original file:
CDN Size (compressed) MD5 (uncompressed) Timestamp
Boot 16088 bytes 14d449eb8876fa55e1ef3c2cc52b0c17 (invalid)
MaxCDN 14848 bytes 14d449eb8876fa55e1ef3c2cc52b0c17 (invalid)
cdnjs 13216 bytes 14d449eb8876fa55e1ef3c2cc52b0c17 (invalid)
Sina 13105 bytes 14d449eb8876fa55e1ef3c2cc52b0c17 April 25, 2019 @ 14:09
Microsoft 13103 bytes 14d449eb8876fa55e1ef3c2cc52b0c17 January 22, 2018 @ 20:17
unpkg 13054 bytes 14d449eb8876fa55e1ef3c2cc52b0c17 (invalid)

And some CDNs send you a different file:
CDN Size (compressed) MD5 (uncompressed) Comment / Diff Timestamp
jsdelivr 12031 bytes 0827a0bdcd9a917990eee461a77dd33e < * Bootstrap v4.0.0 (https://getbootstrap.com)
< * Copyright 2011-2018 The Bootstrap Authors (https://git [...]
> * Bootstrap v4.0.0-alpha.6 (https://getbootstrap.com)
> * Copyright 2011-2017 The Bootstrap Authors (https://gith [...]
< !function(t,e){"object"==typeof exports&&"undefined"!=type [...]
< //# sourceMappingURL=bootstrap.min.js.map
> if("undefined"==typeof jQuery)throw new Error("Bootstrap's [...]
> if(n||(n=new h(this,o),t(this).data(a,n)),"string"==typeof [...]
January 19, 2018 @ 14:17

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

Other Versions

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

5.2.3, 5.2.2, 5.2.1, 5.2.0,
5.1.3, 5.1.2, 5.1.1, 5.1.0,
5.0.2, 5.0.1, 5.0.0,
4.6.0,
4.5.3, 4.5.2, 4.5.1, 4.5.0,
4.4.1, 4.4.0,
4.3.1, 4.3.0,
4.2.1, 4.2.0,
4.1.3, 4.1.2, 4.1.1, 4.1.0, 4.0.0,
3.4.1, 3.4.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
12595 bytes -1 byte zopfli --i100000 --mls8192 --bsr9 --lazy --ohh January 19, 2018 @ 15:01
12596 bytes -1 byte zopfli --i10000 --mls8192 --bsr9 --lazy --ohh January 19, 2018 @ 14:40
12597 bytes -1 byte zopfli --i10000 --mls8192 --bsr4 --lazy --ohh January 19, 2018 @ 14:36
12598 bytes -1 byte zopfli --i1000 --mls8192 --bsr4 --lazy --ohh January 19, 2018 @ 14:25
12599 bytes -1 byte zopfli --i1000 --mls1024 --bsr18 --lazy --ohh January 19, 2018 @ 14:25
12600 bytes -1 byte zopfli --i1000 --mls256 --bsr22 --lazy --ohh January 19, 2018 @ 14:25
12601 bytes zopfli --i100 --mls8192 --bsr17 --lazy --ohh January 19, 2018 @ 14:23

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

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
12604 12604 12603 12605 12605 12604 12604 12604 12603 12612 12601 12600 12602 12605 12618
12604 12604 12605 12604 12603 12604 12605 12603 12598 12599 12606 12601 12596 12599 12614
12601 12601 12606 12606 12614 12605 12605 12598 12605 12599 12612 12600 12604 12600 12599
12604 12604 12602 12602 12602 12604 12605 12599 12604 12599 12606 12607 12602 12599 12599
12601 12601 12604 12605 12604 12604 12605 12600 12601 12612 12606 12599 12600 12605 12604
12603 12603 12605 12604 12603 12616 12610 12598 12605 12599 12608 12596 12595 12599 12616
12601 12601 12618 12617 12605 12611 12605 12598 12602 12599 12599 12596 12603 12614 12614
12604 12604 12604 12604 12611 12602 12605 12599 12601 12598 12607 12600 12597 12601 12609
12602 12602 12605 12603 12604 12616 12606 12598 12602 12599 12600 12600 12603 12599 12604
12601 12601 12609 12605 12605 12602 12605 12599 12605 12599 12599 12604 12613 12613 12604
12606 12606 12605 12605 12603 12616 12612 12598 12599 12599 12607 12600 12602 12613 12599
12602 12602 12604 12603 12605 12603 12605 12602 12604 12599 12604 12600 12603 12600 12599
12610 12610 12605 12605 12611 12611 12605 12599 12601 12598 12604 12601 12603 12605 12604
12605 12605 12605 12605 12611 12604 12605 12599 12605 12599 12595 12596 12596 12605 12600
12605 12605 12605 12604 12605 12616 12605 12603 12605 12599 12607 12601 12603 12605 12611
12603 12603 12605 12602 12614 12604 12611 12598 12599 12599 12607 12600 12603 12605 12610
12603 12603 12617 12605 12603 12604 12605 12598 12602 12599 12614 12603 12603 12605 12602
12605 12605 12615 12610 12611 12604 12605 12602 12605 12599 12607 12603 12602 12605 12606
12612 12612 12604 12605 12599 12615 12605 12599 12602 12599 12605 12597 12603 12605 12608
12602 12602 12605 12605 12603 12604 12605 12598 12602 12599 12604 12600 12603 12600 12614
12603 12603 12604 12605 12599 12614 12605 12598 12605 12599 12595 12599 12603 12605 12604
12603 12603 12604 12605 12603 12602 12605 12600 12605 12599 12610 12596 12595 12600 12604
12601 12601 12604 12604 12603 12605 12605 12604 12602 12599 12609 12599 12603 12604 12614

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 12601 bytes 100%
1,000 12598 bytes -3 bytes 100%
10,000 12596 bytes -2 bytes 100%
100,000 12595 bytes -1 byte 3.48%
1,000,000 12595 bytes 1.16%
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
12666 bytes +71 bytes (+0.56%) +33 bytes
12667 bytes +72 bytes (+0.57%) +34 bytes
12633 bytes +38 bytes (+0.30%)
12656 bytes +61 bytes (+0.48%) +23 bytes
12662 bytes +67 bytes (+0.53%) +29 bytes
12688 bytes +93 bytes (+0.74%) +55 bytes
12729 bytes +134 bytes (+1.06%) +96 bytes
12768 bytes +173 bytes (+1.37%) +135 bytes
12813 bytes +218 bytes (+1.73%) +180 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
RAR (proprietary) RAR rar a -m5 -md64m -mc63:128t -mt1 10522 bytes -2073 bytes (-16.46%)
ZPAQ (Wikipedia) zpaq zpaq -method 69 11002 bytes -1593 bytes (-12.65%)
Brotli (Wikipedia) brotli brotli -q 11 11521 bytes -1074 bytes (-8.53%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 12226 bytes -369 bytes (-2.93%)
LZMA2 (Wikipedia) xz xz -9 12272 bytes -323 bytes (-2.56%)
Zstandard (Wikipedia) zstd zstd -19 12460 bytes -135 bytes (-1.07%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 12667 bytes +72 bytes (+0.57%)

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.