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

After GZIP compression these minified files vary in size:
Boot
  17040 bytes (16.6k)
CDN
gzip -6 (default)
  14061 bytes (13.7k)
local copy
MaxCDN
  14038 bytes (13.7k)
CDN
jsdelivr
  14038 bytes (13.7k)
CDN
gzip -9
  14016 bytes (13.7k)
local copy
cdnjs
  13978 bytes (13.7k)
CDN
unpkg
  13978 bytes (13.7k)
CDN
libdeflate -12
  13582 bytes (13.3k)
local copy
7zip -mx=9 -tgzip
  13571 bytes (13.3k)
local copy
zultra
  13530 bytes (13.2k)
local copy
kzip -s0 -rn -b3
  13504 bytes (13.2k)
local copy
pigz -11 -n
  13497 bytes (13.2k)
local copy
Zopfli
  13470 bytes (13.2k)
local copy
Zopfli (defluff)
  13469 bytes (13.2k)
local copy

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

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

Save 508 bytes by using my Bootstrap 4.1.0 Zopfli version instead of the best available CDN (3.77% smaller than unpkg, 13470 vs. 13978 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 --mls2 --bsr23 --lazy --ohh

(found April 24, 2018)
Description Value Parameter
iterations 1000000  --i1000000
maximum blocks 8  --mb8
maximum length score 2  --mls2
block splitting recursion 23  --bsr23
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 (13469 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.0/dist/js/bootstrap.min.js --location | md5sum
ce6e785579ae4cb555c9de311d1b9271  -
curl --silent --compressed https://minime.stephan-brumme.com/files/bootstrap/bootstrap-4.1.0.min.zopfli.js.gz | md5sum
ce6e785579ae4cb555c9de311d1b9271  -

SHA1:
curl --silent --compressed https://raw.githubusercontent.com/twbs/bootstrap/v4.1.0/dist/js/bootstrap.min.js --location | sha1sum
5ef2c15b47d7290698c737676ba9c3056b45f2e8  -
curl --silent --compressed https://minime.stephan-brumme.com/files/bootstrap/bootstrap-4.1.0.min.zopfli.js.gz | sha1sum
5ef2c15b47d7290698c737676ba9c3056b45f2e8  -

All listed CDNs deliver identical contents:
CDN Size (compressed) MD5 (uncompressed) Timestamp
Boot 17040 bytes ce6e785579ae4cb555c9de311d1b9271 (invalid)
MaxCDN 14038 bytes ce6e785579ae4cb555c9de311d1b9271 (invalid)
jsdelivr 14038 bytes ce6e785579ae4cb555c9de311d1b9271 December 1, 2019 @ 05:24
cdnjs 13978 bytes ce6e785579ae4cb555c9de311d1b9271 (invalid)
unpkg 13978 bytes ce6e785579ae4cb555c9de311d1b9271 (invalid)

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
13470 bytes -1 byte zopfli --i1000000 --mls2 --bsr23 --lazy --ohh April 24, 2018 @ 15:12
13471 bytes -1 byte zopfli --i100000 --mls2 --bsr23 --lazy --ohh April 24, 2018 @ 10:28
13472 bytes -1 byte zopfli --i10000 --mls2 --bsr23 --lazy --ohh April 23, 2018 @ 11:17
13473 bytes -2 bytes zopfli --i1000 --mls2 --bsr23 --lazy --ohh April 23, 2018 @ 09:57
13475 bytes -1 byte zopfli --i1000 --mls4 --bsr40 --lazy --ohh April 23, 2018 @ 09:57
13476 bytes zopfli --i100 --mls4 --bsr14 --lazy --ohh April 23, 2018 @ 09:13

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

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
13493 13493 13497 13494 13494 13494 13494 13496 13498 13497 13494 13511 13526 13520 13497
13480 13480 13516 13519 13478 13515 13515 13515 13487 13516 13504 13506 13520 13519 13482
13485 13485 13481 13518 13482 13518 13481 13483 13486 13486 13485 13485 13489 13502 13490
13481 13474 13481 13518 13482 13518 13480 13481 13484 13486 13483 13503 13501 13481 13481
13478 13478 13520 13484 13482 13518 13480 13482 13484 13483 13486 13520 13518 13503 13487
13480 13481 13474 13480 13482 13518 13481 13482 13494 13486 13482 13481 13520 13498 13484
13514 13514 13515 13517 13482 13493 13480 13483 13485 13486 13482 13501 13519 13501 13497
13480 13481 13518 13484 13481 13489 13480 13480 13484 13518 13485 13520 13496 13497 13483
13483 13483 13483 13519 13482 13482 13480 13482 13472 13490 13480 13488 13521 13480 13499
13477 13477 13521 13480 13480 13519 13479 13480 13486 13491 13483 13490 13509 13519 13480
13470 13470 13521 13519 13518 13520 13479 13481 13485 13491 13483 13520 13520 13518 13482
13472 13472 13479 13518 13481 13519 13480 13482 13474 13486 13483 13490 13489 13487 13487
13481 13481 13520 13518 13482 13491 13481 13481 13485 13487 13481 13520 13482 13520 13481
13474 13474 13516 13514 13471 13483 13480 13482 13486 13491 13482 13483 13483 13520 13479
13479 13479 13490 13518 13481 13488 13480 13481 13470 13487 13490 13503 13520 13525 13483
13481 13481 13519 13518 13482 13490 13480 13482 13484 13487 13484 13489 13518 13498 13482
13475 13475 13479 13518 13518 13518 13480 13480 13484 13491 13480 13489 13527 13479 13481
13481 13481 13518 13518 13482 13519 13480 13481 13485 13518 13482 13488 13481 13481 13483
13482 13482 13518 13518 13482 13519 13480 13482 13485 13519 13481 13489 13484 13497 13484
13470 13472 13518 13519 13518 13518 13481 13483 13485 13518 13498 13504 13504 13520 13488
13475 13475 13482 13518 13482 13517 13486 13483 13470 13518 13484 13520 13520 13498 13499
13470 13470 13477 13518 13483 13518 13480 13482 13485 13518 13482 13490 13520 13520 13488
13473 13473 13518 13518 13482 13519 13481 13483 13485 13486 13480 13519 13519 13520 13504

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 13476 bytes 100%
1,000 13473 bytes -3 bytes 100%
10,000 13472 bytes -1 byte 100%
100,000 13471 bytes -1 byte 4.06%
1,000,000 13470 bytes -1 byte 2.32%
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
13597 bytes +127 bytes (+0.94%) +93 bytes
13598 bytes +128 bytes (+0.95%) +94 bytes
13541 bytes +71 bytes (+0.53%) +37 bytes
13504 bytes +34 bytes (+0.25%)
13531 bytes +61 bytes (+0.45%) +27 bytes
13561 bytes +91 bytes (+0.68%) +57 bytes
13583 bytes +113 bytes (+0.84%) +79 bytes
13613 bytes +143 bytes (+1.06%) +109 bytes
13650 bytes +180 bytes (+1.34%) +146 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 11411 bytes -2059 bytes (-15.29%)
ZPAQ (Wikipedia) zpaq zpaq -method 69 11719 bytes -1751 bytes (-13.00%)
Brotli (Wikipedia) brotli brotli -q 11 12226 bytes -1244 bytes (-9.24%)
LZMA2 (Wikipedia) xz xz -9 13032 bytes -438 bytes (-3.25%)
Burrows-Wheeler transform (Wikipedia) bzip2 bzip2 -9 13247 bytes -223 bytes (-1.66%)
Zstandard (Wikipedia) zstd zstd -19 13316 bytes -154 bytes (-1.14%)
PPMd (Wikipedia) 7zip 7za a -mx=9 -m0=ppmd 13382 bytes -88 bytes (-0.65%)

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.