Skip to content

privatenumber/minification-benchmarks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

955 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

minification benchmarks

What's the best JavaScript minifier?

This project benchmarks the following minifiers:

Minifier Version Release date ↓
oxc-minify 0.123.0 2026-03-31
@swc/core 1.15.21 2026-03-22
bun 1.3.11 2026-03-18
terser 5.46.1 2026-03-16
esbuild 0.27.4 2026-03-12
google-closure-compiler 20251216.0.0 2025-12-18
@tdewolff/minify 2.24.8 2025-12-08
@cminify/cminify-linux-x64 3.0.1 2025-07-27
uglify-js 3.19.3 2024-08-29
babel-minify 0.5.2 2022-05-07
tedivm/jshrink 1.8.1

Benchmarks last updated on Apr 30, 2026.


πŸ™‹β€β™‚οΈ Why?

  1. To help you pick a minifier that fits your needs
  2. To promote JS minifiers and document their performances
  3. To encourage healthy competition and improvement amongst minifiers

πŸ‘Ÿ Methodology

  • Each minifier is executed in its own process with a 10s timeout
  • Artifact integrity is verified by a test before and after minification
  • Each minifier is minimally configured (sourcemaps & comments disabled), comparing out-of-the-box experience
  • Minifier upgrade PRs are automated via WhiteSource Renovate
  • Benchmarks are updated on every PR via GitHub Actions
  • The raw benchmark data is available in /packages/data/data/data.json

⏱ Metrics

Ranking

For each benchmark, minifiers are ranked by a score that reflects the best balance of trade-offs.

The score combines minzipped size and minification time, with size weighted more heavily by default (85% size, 15% time) since it's usually the top priority. If a minifier is unusually slow, the weights shift toward time using a logistic sigmoid function, up to a 50/50 split. This avoids harsh cutoffs while still penalizing extreme slowness.

Both size and time are scaled using min-max normalization so they can be compared fairly. The result is a context-aware score that helps surface the best overall choiceβ€”but make sure to check each column directly if size or speed matters more to you.

Minified size

Size of the minified output.

Minzipped size

Size of the minified output with Gzip compression.

For minifiers, this measures how compressable the output is.

For users, this measures network transfer size, which is usually the metric that matters most.

Time

How long minification took (average of 5 runs). Each time is annotated with a multiplier relative to the fastest minifier.

πŸ“‹ Results

Artifact Original size Gzip size
react v17.0.2 (Source) 72.13 KB 19.39 KB
Minifier Minified size Minzipped size Time
1. @swc/core -68% 22.82 KB -58% 8.19 KB 5x 18 ms
2. terser -68% 23.05 KB -57% 8.26 KB 69x 215 ms
3. oxc-minify -68% 23.22 KB -57% 8.40 KB πŸ† 3 ms
4. uglify-js πŸ†-69% 22.64 KB πŸ†-58% 8.18 KB 135x 420 ms
5. esbuild -67% 23.70 KB -56% 8.54 KB 5x 18 ms
6. @tdewolff/minify -67% 23.49 KB -55% 8.63 KB 1x 4 ms
7. bun -67% 23.98 KB -55% 8.66 KB 4x 13 ms
8. uglify-js (no compress) -65% 25.03 KB -55% 8.67 KB 24x 75 ms
9. terser (no compress) -65% 25.06 KB -55% 8.74 KB 29x 93 ms
10. google-closure-compiler -68% 22.81 KB -58% 8.22 KB 1023x 3,169 ms
11. @cminify/cminify-linux-x64 -44% 40.04 KB -44% 10.86 KB 3x 12 ms
12. tedivm/jshrink -43% 40.82 KB -43% 11.04 KB 40x 126 ms
13. babel-minify ❌ Failed to find ❌ ❌  -

Artifact Original size Gzip size
moment v2.29.1 (Source) 173.90 KB 36.23 KB
Minifier Minified size Minzipped size Time
1. @swc/core -66% 58.37 KB -48% 18.75 KB 3x 28 ms
2. terser -66% 59.01 KB -48% 18.69 KB 68x 505 ms
3. oxc-minify -66% 59.40 KB -47% 19.24 KB 1x 9 ms
4. esbuild -66% 59.80 KB -47% 19.33 KB 2x 20 ms
5. uglify-js πŸ†-67% 57.73 KB πŸ†-49% 18.57 KB 123x 906 ms
6. @tdewolff/minify -66% 59.89 KB -46% 19.48 KB πŸ† 7 ms
7. uglify-js (no compress) -64% 62.50 KB -46% 19.57 KB 24x 177 ms
8. bun -64% 61.76 KB -45% 19.85 KB 2x 17 ms
9. terser (no compress) -64% 63.01 KB -46% 19.65 KB 30x 225 ms
10. google-closure-compiler -66% 58.28 KB -48% 18.90 KB 545x 3,994 ms
11. @cminify/cminify-linux-x64 -45% 95.93 KB -32% 24.74 KB 1x 12 ms
12. tedivm/jshrink -44% 97.63 KB -31% 25.00 KB 39x 285 ms
13. babel-minify ❌ Failed to find ❌ ❌  -

Artifact Original size Gzip size
jquery v3.5.1 (Source) 287.63 KB 84.50 KB
Minifier Minified size Minzipped size Time
1. @swc/core -69% 89.16 KB -63% 30.86 KB 4x 50 ms
2. oxc-minify -69% 89.26 KB -63% 30.92 KB 1x 14 ms
3. @tdewolff/minify -69% 89.68 KB -63% 31.45 KB πŸ† 12 ms
4. uglify-js (no compress) -67% 94.08 KB -63% 31.47 KB 20x 244 ms
5. terser -69% 89.24 KB πŸ†-63% 30.86 KB 61x 712 ms
6. esbuild -69% 90.07 KB -62% 31.96 KB 3x 40 ms
7. terser (no compress) -67% 94.26 KB -63% 31.56 KB 25x 294 ms
8. bun -68% 92.39 KB -61% 32.64 KB 1x 20 ms
9. uglify-js πŸ†-69% 88.45 KB -63% 30.90 KB 114x 1,336 ms
10. google-closure-compiler -68% 92.71 KB -61% 33.05 KB 345x 4,028 ms
11. @cminify/cminify-linux-x64 -51% 141.45 KB -52% 40.37 KB 1x 14 ms
12. tedivm/jshrink -50% 144.14 KB -52% 40.88 KB 30x 361 ms
13. babel-minify ❌ Failed to find ❌ ❌  -

Artifact Original size Gzip size
vue v2.6.12 (Source) 342.15 KB 89.67 KB
Minifier Minified size Minzipped size Time
1. @swc/core -66% 115.53 KB πŸ†-52% 42.72 KB 4x 72 ms
2. oxc-minify -66% 116.98 KB -52% 43.23 KB 1x 17 ms
3. @tdewolff/minify -66% 117.70 KB -51% 44.37 KB πŸ† 15 ms
4. esbuild -65% 118.14 KB -51% 44.37 KB 2x 42 ms
5. terser -66% 116.60 KB -52% 42.87 KB 63x 935 ms
6. uglify-js (no compress) -63% 126.14 KB -50% 44.45 KB 20x 302 ms
7. terser (no compress) -63% 126.39 KB -50% 44.64 KB 25x 372 ms
8. bun -65% 121.28 KB -49% 45.39 KB 1x 24 ms
9. uglify-js πŸ†-67% 113.80 KB -52% 43.04 KB 125x 1,857 ms
10. google-closure-compiler -66% 115.55 KB -51% 44.24 KB 324x 4,789 ms
11. @cminify/cminify-linux-x64 -43% 193.91 KB -37% 56.36 KB 1x 15 ms
12. tedivm/jshrink -42% 197.36 KB -36% 57.17 KB 32x 481 ms
13. babel-minify ❌ Failed to find ❌ ❌  -

Artifact Original size Gzip size
lodash v4.17.21 (Source) 544.09 KB 96.69 KB
Minifier Minified size Minzipped size Time
1. @swc/core -87% 69.82 KB -74% 25.24 KB 3x 52 ms
2. oxc-minify -87% 71.04 KB -73% 25.90 KB 1x 13 ms
3. esbuild -87% 72.50 KB -73% 26.20 KB 2x 31 ms
4. uglify-js (no compress) -86% 74.61 KB -73% 25.86 KB 20x 271 ms
5. terser -87% 70.41 KB -74% 25.15 KB 60x 785 ms
6. @tdewolff/minify -87% 71.90 KB -73% 26.50 KB 1x 17 ms
7. bun -87% 73.45 KB -72% 26.66 KB 1x 21 ms
8. terser (no compress) -86% 75.04 KB -73% 26.19 KB 25x 333 ms
9. uglify-js πŸ†-87% 68.17 KB πŸ†-74% 24.69 KB 107x 1,394 ms
10. google-closure-compiler -86% 73.49 KB -74% 25.03 KB 330x 4,283 ms
11. @cminify/cminify-linux-x64 -73% 146.27 KB -63% 35.94 KB πŸ† 13 ms
12. tedivm/jshrink -73% 148.78 KB -62% 36.33 KB 28x 374 ms
13. babel-minify ❌ Failed to find ❌ ❌  -

Artifact Original size Gzip size
d3 v6.3.1 (Source) 555.77 KB 130.69 KB
Minifier Minified size Minzipped size Time
1. @swc/core -52% 265.20 KB -33% 87.22 KB 6x 149 ms
2. oxc-minify -52% 267.39 KB -33% 87.96 KB 1x 41 ms
3. uglify-js (no compress) -50% 275.35 KB -32% 88.32 KB 26x 617 ms
4. @tdewolff/minify -52% 269.07 KB -31% 89.87 KB 1x 36 ms
5. terser (no compress) -50% 276.13 KB -32% 89.07 KB 38x 913 ms
6. esbuild -51% 270.21 KB -31% 90.81 KB 3x 73 ms
7. terser -52% 267.42 KB -33% 88.00 KB 82x 1,940 ms
8. uglify-js πŸ†-53% 263.56 KB πŸ†-33% 87.02 KB 139x 3,272 ms
9. bun -51% 272.73 KB -29% 92.34 KB 1x 47 ms
10. @cminify/cminify-linux-x64 -29% 393.70 KB -21% 103.81 KB πŸ† 23 ms
11. google-closure-compiler -51% 270.32 KB -28% 94.15 KB 266x 6,241 ms
12. babel-minify ❌ Minification ❌ ❌  -
13. tedivm/jshrink ❌ Minification ❌ ❌  -

Artifact Original size Gzip size
terser v5.30.3 (Source) 1.01 MB 193.76 KB
Minifier Minified size Minzipped size Time
1. oxc-minify πŸ†-56% 439.37 KB πŸ†-37% 122.00 KB 1x 37 ms
2. @swc/core -55% 455.45 KB -36% 123.29 KB 6x 132 ms
3. @tdewolff/minify -55% 456.59 KB -36% 124.88 KB 1x 34 ms
4. uglify-js (no compress) -53% 472.16 KB -36% 124.61 KB 32x 670 ms
5. terser (no compress) -53% 472.58 KB -36% 124.25 KB 40x 837 ms
6. esbuild -55% 458.93 KB -35% 126.71 KB 3x 62 ms
7. terser -55% 456.59 KB -36% 123.35 KB 89x 1,847 ms
8. bun -54% 466.69 KB -34% 127.64 KB 1x 41 ms
9. uglify-js -55% 451.19 KB -36% 123.33 KB 152x 3,153 ms
10. google-closure-compiler -56% 439.93 KB -35% 126.44 KB 292x 6,042 ms
11. @cminify/cminify-linux-x64 -38% 625.93 KB -26% 144.30 KB πŸ† 21 ms
12. tedivm/jshrink -37% 633.71 KB -25% 145.18 KB 64x 1,328 ms
13. babel-minify ❌ Minification ❌ ❌  -

Artifact Original size Gzip size
three v0.124.0 (Source) 1.25 MB 248.27 KB
Minifier Minified size Minzipped size Time
1. @swc/core -48% 642.75 KB πŸ†-36% 158.73 KB 8x 199 ms
2. oxc-minify -48% 642.65 KB -36% 159.91 KB 2x 56 ms
3. esbuild -48% 646.93 KB -34% 163.75 KB 3x 90 ms
4. @tdewolff/minify -49% 642.20 KB -34% 164.60 KB 2x 49 ms
5. uglify-js (no compress) -46% 674.49 KB -34% 163.04 KB 38x 872 ms
6. terser -48% 653.18 KB -36% 159.17 KB 107x 2,471 ms
7. terser (no compress) -46% 675.43 KB -34% 163.18 KB 48x 1,112 ms
8. bun -47% 655.59 KB -33% 166.17 KB 2x 58 ms
9. uglify-js πŸ†-49% 641.59 KB -36% 159.07 KB 188x 4,320 ms
10. google-closure-compiler -48% 644.51 KB -34% 162.81 KB 338x 7,766 ms
11. @cminify/cminify-linux-x64 -25% 941.06 KB -23% 191.97 KB πŸ† 23 ms
12. tedivm/jshrink -24% 952.01 KB -22% 193.47 KB 74x 1,712 ms
13. babel-minify ❌ Timed out - - ⚠️ +10,000 ms

Artifact Original size Gzip size
victory v35.8.4 (Source) 2.13 MB 309.94 KB
Minifier Minified size Minzipped size Time
1. @swc/core -67% 705.93 KB -49% 157.74 KB 6x 301 ms
2. oxc-minify -67% 711.09 KB -48% 160.88 KB 2x 95 ms
3. @tdewolff/minify -66% 716.62 KB -47% 164.95 KB 1x 69 ms
4. uglify-js (no compress) -65% 756.53 KB -46% 167.58 KB 25x 1,105 ms
5. terser (no compress) -65% 756.62 KB -46% 166.18 KB 31x 1,381 ms
6. terser -67% 712.87 KB -49% 158.46 KB 78x 3,435 ms
7. esbuild -66% 725.65 KB -42% 181.23 KB 3x 136 ms
8. bun -66% 726.80 KB -41% 182.61 KB 1x 84 ms
9. uglify-js πŸ†-67% 694.78 KB πŸ†-49% 157.44 KB 131x 5,712 ms
10. @cminify/cminify-linux-x64 -33% 1.43 MB -29% 221.12 KB πŸ† 44 ms
11. babel-minify ❌ Minification ❌ ❌  -
12. google-closure-compiler ❌ Timed out - - ⚠️ +10,000 ms
13. tedivm/jshrink ❌ Post-validation ❌ ❌  -

Artifact Original size Gzip size
echarts v5.1.1 (Source) 3.20 MB 684.61 KB
Minifier Minified size Minzipped size Time
1. oxc-minify -69% 1.00 MB -53% 323.08 KB 4x 224 ms
2. @swc/core πŸ†-69% 993.62 KB πŸ†-53% 321.08 KB 11x 551 ms
3. @tdewolff/minify -68% 1.01 MB -52% 331.76 KB 2x 120 ms
4. esbuild -68% 1.01 MB -52% 331.62 KB 3x 193 ms
5. bun -68% 1.02 MB -51% 337.87 KB 2x 122 ms
6. uglify-js (no compress) -67% 1.07 MB -52% 331.41 KB 31x 1,582 ms
7. terser (no compress) -67% 1.07 MB -52% 330.35 KB 49x 2,485 ms
8. terser -69% 998.45 KB -53% 321.56 KB 109x 5,461 ms
9. @cminify/cminify-linux-x64 -45% 1.77 MB -37% 434.45 KB πŸ† 50 ms
10. babel-minify ❌ Timed out - - ⚠️ +10,000 ms
11. google-closure-compiler ❌ Timed out - - ⚠️ +10,000 ms
12. tedivm/jshrink ❌ Minification ❌ ❌  -
13. uglify-js ❌ Timed out - - ⚠️ +10,000 ms

Artifact Original size Gzip size
antd v4.16.1 (Source) 6.67 MB 825.18 KB
Minifier Minified size Minzipped size Time
1. oxc-minify -67% 2.22 MB -45% 456.09 KB 3x 282 ms
2. @swc/core πŸ†-68% 2.15 MB πŸ†-45% 452.46 KB 9x 690 ms
3. @tdewolff/minify -66% 2.29 MB -43% 471.64 KB 1x 140 ms
4. esbuild -65% 2.31 MB -41% 488.41 KB 3x 281 ms
5. bun -66% 2.30 MB -40% 491.71 KB 2x 162 ms
6. uglify-js (no compress) -64% 2.42 MB -42% 478.57 KB 32x 2,313 ms
7. terser (no compress) -64% 2.42 MB -42% 474.97 KB 38x 2,784 ms
8. terser -66% 2.24 MB -45% 457.35 KB 84x 6,086 ms
9. @cminify/cminify-linux-x64 -34% 4.43 MB -24% 623.37 KB πŸ† 72 ms
10. babel-minify ❌ Timed out - - ⚠️ +10,000 ms
11. google-closure-compiler ❌ Timed out - - ⚠️ +10,000 ms
12. tedivm/jshrink ❌ Timed out - - ⚠️ +10,000 ms
13. uglify-js ❌ Timed out - - ⚠️ +10,000 ms

Artifact Original size Gzip size
typescript v4.9.5 (Source) 10.95 MB 1.88 MB
Minifier Minified size Minzipped size Time
1. oxc-minify -70% 3.33 MB πŸ†-55% 853.09 KB 6x 688 ms
2. @tdewolff/minify -69% 3.35 MB -54% 875.77 KB 2x 266 ms
3. @swc/core πŸ†-70% 3.31 MB -54% 859.06 KB 14x 1,528 ms
4. esbuild -68% 3.49 MB -51% 915.54 KB 4x 468 ms
5. bun -68% 3.54 MB -51% 923.27 KB 2x 289 ms
6. uglify-js (no compress) -68% 3.54 MB -53% 876.54 KB 33x 3,631 ms
7. terser (no compress) -68% 3.53 MB -53% 878.64 KB 43x 4,684 ms
8. @cminify/cminify-linux-x64 -47% 5.85 MB -40% 1.13 MB πŸ† 108 ms
9. babel-minify ❌ Timed out - - ⚠️ +10,000 ms
10. google-closure-compiler ❌ Timed out - - ⚠️ +10,000 ms
11. tedivm/jshrink ❌ Timed out - - ⚠️ +10,000 ms
12. terser ❌ Timed out - - ⚠️ +10,000 ms
13. uglify-js ❌ Timed out - - ⚠️ +10,000 ms

βš”οΈ Minifier showdown

Note

πŸ€– This analysis is AI generated. See below for the system prompt.

Three... two... one... compress! Welcome to the Minification Grand Prix, where every byte fights for survival and every millisecond screams for mercy. The field was full of specialists: the old-school size hunters, the new-school speed demons, and a few hybrid contenders that managed to do both without tripping over semicolons. Let’s unpack the race.

Best minifier

@swc/core takes the trophy. It didn’t always have the single smallest number on every tiny package, but it won the big, meaningful rounds and kept a gorgeous balance between squeeze and speed. On large bundles it frequently produced the smallest (or nearly the smallest) gzipped outputβ€”echarts, antd, threeβ€”and did it hundreds to thousands of times faster than the pure size champion. Where uglify-js eked out the very last kilobyte, @swc/core typically matched that compression within a hair while finishing in a fraction of the time. For teams shipping big bundles or running minification in CI, that trade-off is decisive: tiny transfer wins, without the lava-slow wait.

Honorable mentions

  • uglify-js β€” The pure size monarch. Five rounds with the absolute smallest gzip size. If absolute minimal bytes are your religion and you can tolerate multi-second runs on huge artifacts, keep uglify on the altar. Example: β€œvictory” was squeezed to 157.44 KB, but it cost several seconds where swc did almost the same in a few hundred milliseconds.
  • oxc-minify β€” The surprise giant-slayer. Won the largest TypeScript bundle and showed up fast and tight on several large inputs. Excellent when you want near-top compression on very large codebases and still care about build speed.
  • @cminify/cminify-linux-x64 β€” The speed demon for big files. Consistently among the fastest, often completing massive bundles in a few dozen milliseconds, but with noticeably worse gzip sizes compared to the top compressors.
  • @tdewolff/minify β€” Blink-and-you-miss-it speed on smaller packages with solid compression. Great for quick local runs or tiny CI steps.
  • terser β€” A reliable all-rounder that still commands wins on some classic libs (notably jquery). Good balance for many conventional use cases.

Eliminated

  • babel-minify β€” Failed during the "react" run with: "Failed to find JSON start: [baseline-browser-mapping] The data in this module is over two months old. To ensure accurate Baseline data, please update: npm i baseline-browser-mapping@latest -D". Disqualified from the leaderboard.
  • tedivm/jshrink β€” Crashed during "d3" minification: "RuntimeException: Unclosed regex pattern at position: 289075". Crashed and eliminated.

Closing remarks

This was a contest of trade-offs, not moral superiority. Uglify-js is the go-to if you worship minimal bytes and can wait. @swc/core is the pragmatic champion: near-best compression, far better speed, and strong results on the largest, hardest artifacts. oxc-minify and cminify earned their stripes as specialist toolsβ€”one squeezing large TypeScript bundles, the other blitzing them at the cost of extra bytes.

Remember: these results only measure gzipped size and minification time. Developer experience, compatibility, and correctness matter in the real world too. Pick the tool that matches your pipeline: if you ship huge bundles and hate long CI times, start with @swc/core. If every kilobyte must be wrung out, give uglify-js a spin. And if you want instant local feedback, try the speed demons and see how they fit. Until next raceβ€”keep your bytes tight and your builds fast.

System prompt

Sponsors

About

πŸƒβ€β™‚οΈπŸƒβ€β™€οΈπŸƒ JS minification benchmarks: babel-minify, esbuild, terser, uglify-js, swc, google closure compiler, tdewolff/minify, oxc-minify

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Sponsor this project

 

Contributors