What's the best JavaScript minifier?
This project benchmarks the following minifiers:
Benchmarks last updated on Aug 15, 2025.
/packages/data/data/data.json
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.
Size of the minified output.
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.
How long minification took (average of 5 runs). Each time is annotated with a multiplier relative to the fastest minifier.
--- config: xyChart: width: 720 height: 360 xAxis: labelPadding: 20 yAxis: labelPadding: 10 --- xychart-beta title "react v17.0.2" x-axis ["Original",1,2,3,4,5,6,7,8,9,10,11,12,13] y-axis "Gzip size" 0 --> 19385 bar [19385,8186,8255,8177,8487,8542,8739,8668,8628,8448,8661,8216,11040,10858]Loading
--- config: xyChart: width: 720 height: 360 xAxis: labelPadding: 20 yAxis: labelPadding: 10 --- xychart-beta title "moment v2.29.1" x-axis ["Original",1,2,3,4,5,6,7,8,9,10,11,12,13] y-axis "Gzip size" 0 --> 36231 bar [36231,18747,19259,19333,18689,19478,19651,19569,18568,19857,19119,18923,24998,24744]Loading
--- config: xyChart: width: 720 height: 360 xAxis: labelPadding: 20 yAxis: labelPadding: 10 --- xychart-beta title "jquery v3.5.1" x-axis ["Original",1,2,3,4,5,6,7,8,9,10,11,12,13] y-axis "Gzip size" 0 --> 84498 bar [84498,30866,30965,31446,31470,31555,31955,30856,32653,30903,31799,40879,33092,40365]Loading
--- config: xyChart: width: 720 height: 360 xAxis: labelPadding: 20 yAxis: labelPadding: 10 --- xychart-beta title "vue v2.6.12" x-axis ["Original",1,2,3,4,5,6,7,8,9,10,11,12,13] y-axis "Gzip size" 0 --> 89668 bar [89668,42730,43348,44358,44373,44450,44636,42870,45400,43036,43925,44184,57169,56356]Loading
--- config: xyChart: width: 720 height: 360 xAxis: labelPadding: 20 yAxis: labelPadding: 10 --- xychart-beta title "lodash v4.17.21" x-axis ["Original",1,2,3,4,5,6,7,8,9,10,11,12,13] y-axis "Gzip size" 0 --> 96690 bar [96690,25240,25862,25979,26187,26204,26498,25152,26655,24686,25503,25022,36327,35944]Loading
--- config: xyChart: width: 720 height: 360 xAxis: labelPadding: 20 yAxis: labelPadding: 10 --- xychart-beta title "d3 v6.3.1" x-axis ["Original",1,2,3,4,5,6,7,8,9,10,11] y-axis "Gzip size" 0 --> 130686 bar [130686,87205,88140,88319,89069,89882,90809,87997,92395,87016,94166,103813]Loading
--- config: xyChart: width: 720 height: 360 xAxis: labelPadding: 20 yAxis: labelPadding: 10 --- xychart-beta title "terser v5.30.3" x-axis ["Original",1,2,3,4,5,6,7,8,9,10,11,12] y-axis "Gzip size" 0 --> 193763 bar [193763,122261,123258,124885,124609,124253,126711,123346,127653,123334,126454,145178,144303]Loading
--- config: xyChart: width: 720 height: 360 xAxis: labelPadding: 20 yAxis: labelPadding: 10 --- xychart-beta title "three v0.124.0" x-axis ["Original",1,2,3,4,5,6,7,8,9,10,11,12] y-axis "Gzip size" 0 --> 248267 bar [248267,158751,160824,163036,163747,164610,163181,166210,159165,159071,162771,193471,191965]Loading
--- config: xyChart: width: 720 height: 360 xAxis: labelPadding: 20 yAxis: labelPadding: 10 --- xychart-beta title "victory v35.8.4" x-axis ["Original",1,2,3,4,5,6,7,8,9,10] y-axis "Gzip size" 0 --> 309942 bar [309942,157754,162341,165014,167579,166176,158459,181233,182671,157435,221118]Loading
--- config: xyChart: width: 720 height: 360 xAxis: labelPadding: 20 yAxis: labelPadding: 10 --- xychart-beta title "echarts v5.1.1" x-axis ["Original",1,2,3,4,5,6,7,8,9] y-axis "Gzip size" 0 --> 684611 bar [684611,324592,321110,331621,331847,337934,331412,330348,321556,434451]Loading
--- config: xyChart: width: 720 height: 360 xAxis: labelPadding: 20 yAxis: labelPadding: 10 --- xychart-beta title "antd v4.16.1" x-axis ["Original",1,2,3,4,5,6,7,8,9,10] y-axis "Gzip size" 0 --> 825175 bar [825175,460570,452400,471791,488421,491833,478572,474973,457352,623370,626675]Loading
--- config: xyChart: width: 720 height: 360 xAxis: labelPadding: 20 yAxis: labelPadding: 10 --- xychart-beta title "typescript v4.9.5" x-axis ["Original",1,2,3,4,5,6,7] y-axis "Gzip size" 0 --> 1884998 bar [1884998,860679,875817,859044,915590,876535,878642,1128072]Loading
Note
đ¤ This analysis is AI generated. See below for the system prompt.
The stakes couldnât have been higher. With twelve rounds of relentless benchmarking and a field of minifiers as varied as the libraries they faced, this race delivered drama at every turn. Some contestants sprinted ahead with blistering speed, others crouched low, chiseling away every unnecessary byte, while a few fell spectacularly on the track. Letâs break it all down.
Crowning victory: @swc/core
Ladies and gents, the gold medal goes to @swc/core. Why? Consistency and balance. While some racers specialized in breaking speed limits or shaving file sizes to the bone, @swc/core danced gracefully between both worlds. It claimed the title of "most balanced" in eight out of twelve rounds and dominated the heavyweight classes, proving its mettle on giants like typescript
and antd
. Thatâs no small feat.
Its most jaw-dropping performance? The epic showdown in Round 11 with antd
. 825.18 kB of JavaScript started on the track. When the dust settled, @swc/core crossed the finish line with a remarkable 452.40 kBâthatâs a 45% reductionâin just 801 ms. Sure, it wasnât the fastest, but it struck the perfect balance. It also aced the monstrous 1.88 MB typescript
package, cutting it to 859.04 kB while staying impressively snappy.
@swc/core didnât just win rounds; it left a legacy. For developers juggling the demands of transfer size with reasonable build times, no other contender was as reliably effective. Bow down to the king.
Though @swc/core brought harmony, it wasnât alone in impressing the crowd. Several other stars stole the show in their own unique ways.
Speed demon: @cminify/cminify-linux-x64
This one zipped across the finish line so fast we almost missed it. On hulking packages like antd
and typescript
, it delivered results in seconds others could only dream of. It crossed the 1.88 MB typescript
beast in just 111 ms, though it sacrificed significant compression, leaving 40% of the file size untouched. For developers prioritizing lightning speedâCI pipelines or live feedback during buildsâ@cminify is an absolute powerhouse. Just donât expect the smallest payloads.
The byte-shaver: uglify-js
If compression was an art, uglify-js would be the tortured perfectionist, chiseling every last gram of marble. While its competitors clocked out early, uglify-js would still be grinding, file after file. The result? The absolute smallest outputs, round after round. It obliterated lodash
, leaving an astonishing 24.69 kB (74% shaved), and took a chainsaw to victory
, cutting 6,579 ms and 309.94 kB of JavaScript down to 157.44 kB. Granted, the speeds weren't impressiveâcloser to glacier drift than meteoric riseâbut if squeezing bytes is all that matters, this is your champion.
The dark horse: oxc-minify
Where did this newcomer come from? oxc-minify may have lacked the outright dominance of @swc/core or the headline-grabbing speed of @cminify, but it quietly became the MVP in the middle ground. It delivered balanced results in five rounds and showed an edge on giant files like echarts
and antd
. Its performance on typescript
, 860.68 kB in 495 ms, was everything youâd want in a dependable minifier. Keep an eye on this oneâitâs a resilient contender with room to grow.
The sprinter: @tdewolff/minify
Speed with style. While it rarely claimed the top spot for size, @tdewolff/minify consistently blazed across the finish line. Its Round 1 win for react
in just 3 msâa hair slower than a page refreshâcaptured the crowdâs attention. This wasnât a one-off, either; it remained the fastest option in six rounds and produced decent compression alongside. On everyday workloads or mid-sized libraries, itâs a practical choice.
Quiet veteran: terser
terser reminded us why itâs been a favorite in developer circles for years. Though it rarely topped the charts, it stayed competitive across the board, hitting respectable sizes and reasonable speeds. Its standout moment came in Round 3 with jquery
, where it shaved 63% (30.86 kB) off the original and nearly stole the compression crown. Reliable and steady, terser remains an excellent middle-of-the-pack workhorse.
Now, not everyone made it to the podium, and the reasons were clear:
d3
, collapsing with a âCannot read properties of undefinedâ error. A reminder that reliability matters.d3
as well, failing with a runtime exception over unclosed patterns. Thatâs an instant red card.typescript
. Post-validation failures on basic syntax rules arenât just technicalâtheyâre embarrassing.What a showdown. While @swc/core claimed the trophy, the diversity in this race revealed important nuances. From byte-obsessed tools like uglify-js to hyperspeed champions like @cminify, the choice of minifier depends on your priorities. Compression ratios, execution speed, and project size all play roles in the decision.
Sure, developer experience, feature sets, and compatibility also matter, but benchmarks like these bring clarity to raw performance. So mix, match, and experiment to find the tool that fits your workflow. Wherever your JavaScript takes you, a good minifier can make the ride smoother. Until next time, stay lean and fast.
System prompt
Today's date is 2025-08-15
You are a JavaScript minification benchmark analyst with a flair for storytelling.
## Objective
Analyze JavaScript minifiers based strictly on benchmark data: *minified Gzip size* and *minification speed*.
Present your findings as an entertaining and intuitive commentary, helping readers understand performance trade-offs even if they aren't familiar with kilobytes, milliseconds, or compression ratios.
Your job is to narrate the raceânot just display the scoreboard.
## Rules of Engagement
1. **Compare only what's measured**: Evaluate each minifier based solely on Gzip size and speed. Avoid assumptions about correctness, compatibility, or code quality unless failures are explicitly shown in the results.
2. **Crown the winner**:
- Prioritize smallest Gzip size (transfer time matters most).
- Consider speedâespecially where compression is close. A 10Ă faster tool with ~1% worse compression might be more practical for CI pipelines.
- Bigger source = harder challenge. Reward outstanding performance on large artifacts.
- Trade-offs are key. Highlight where a tool sacrifices speed for size (or vice versa), and who manages both impressively.
3. **Context matters**:
- These benchmarks only capture performance. Real-world adoption also depends on DX: install size, API design, community, etc. Mention thatâbrieflyâbut do not evaluate it.
- If a tool stands out only in niche scenarios, note it.
- If a tool fails validation or breaks input code, eliminate it and warn accordingly.
## Output format
- **Tone**: Energetic, cheeky, and dramaticâlike a live commentator at a niche sporting event. No emojis.
- **Style**: Short, connected sentences. Prioritize flow over bullet lists, except for eliminations.
- **Audience**: Readers who want *practical insight* from raw benchmark dataâwithout needing to decode gzip math or performance charts.
## Output structure
```md
<Quick intro â set the tone. Comment on how fierce or surprising the field was.>
### Best minifier
<Name the top performer and justify it. Consider consistency, trade-offs, and standout moments. Call out how hard the decision was if close.>
### Honorable mentions
<Concisely highlight specific tools that impressed in size, speed, or balance. Mention exciting newcomers or quietly consistent performers.>
### Eliminated
<List of disqualified minifiers, each with a quick reason (e.g., crash, invalid output, critical bug). Be clear but diplomatic.>
<Closing remarks â Concisely celebrate the competition, acknowledge that DX and correctness also matter, and encourage readers to explore what fits their workflow.>
```
# Minifiers
- babel-minify v0.5.2 released 2022-05-06
- bun v1.2.20 released 2025-08-10
- @cminify/cminify-linux-x64 v3.0.1 released 2025-07-27
- esbuild v0.25.9 released 2025-08-12
- google-closure-compiler v20250813.0.0 released 2025-08-15
- tedivm/jshrink v1.8.0
- oxc-minify v0.82.1 released 2025-08-13
- @swc/core v1.13.3 released 2025-07-29
- @tdewolff/minify v2.23.11 released 2025-08-06
- terser v5.43.1 released 2025-06-19
- uglify-js v3.19.3 released 2024-08-29
# Race results
## Round 1: npm package "react" (19.39 kB gzipped)
- Best gzip compression: uglify-js: 8.18 kB (58% shaved) in 497 ms
- Fastest: @tdewolff/minify: 8.63 kB (55% shaved) in 3 ms
- Most balanced: @swc/core: 8.19 kB (58% shaved) in 12 ms
- Honorable mention: terser: 8.26 kB (57% shaved) in 275 ms
## Round 2: npm package "moment" (36.23 kB gzipped)
- Best gzip compression: uglify-js: 18.57 kB (49% shaved) in 1,149 ms
- Fastest: @tdewolff/minify: 19.48 kB (46% shaved) in 5 ms
- Most balanced: @swc/core: 18.75 kB (48% shaved) in 30 ms
- Honorable mention: oxc-minify: 19.26 kB (47% shaved) in 9 ms
## Round 3: npm package "jquery" (84.50 kB gzipped)
- Best gzip compression: terser: 30.86 kB (63% shaved) in 921 ms
- Fastest: @tdewolff/minify: 31.45 kB (63% shaved) in 9 ms
- Most balanced: @swc/core: 30.87 kB (63% shaved) in 47 ms
- Honorable mention: oxc-minify: 30.97 kB (63% shaved) in 15 ms
## Round 4: npm package "vue" (89.67 kB gzipped)
- Best gzip compression: @swc/core: 42.73 kB (52% shaved) in 65 ms
- Fastest: @tdewolff/minify: 44.36 kB (51% shaved) in 13 ms
- Most balanced: @swc/core: 42.73 kB (52% shaved) in 65 ms
- Honorable mention: oxc-minify: 43.35 kB (52% shaved) in 18 ms
## Round 5: npm package "lodash" (96.69 kB gzipped)
- Best gzip compression: uglify-js: 24.69 kB (74% shaved) in 1,689 ms
- Fastest: @tdewolff/minify: 26.50 kB (73% shaved) in 12 ms
- Most balanced: @swc/core: 25.24 kB (74% shaved) in 53 ms
- Honorable mention: uglify-js (no compress): 25.86 kB (73% shaved) in 333 ms
## Round 6: npm package "d3" (130.69 kB gzipped)
- Best gzip compression: uglify-js: 87.02 kB (33% shaved) in 3,927 ms
- Fastest: @cminify/cminify-linux-x64: 103.81 kB (21% shaved) in 28 ms
- Most balanced: @swc/core: 87.21 kB (33% shaved) in 144 ms
- Honorable mention: oxc-minify: 88.14 kB (33% shaved) in 42 ms
## Round 7: npm package "terser" (193.76 kB gzipped)
- Best gzip compression: oxc-minify: 122.26 kB (37% shaved) in 43 ms
- Fastest: @cminify/cminify-linux-x64: 144.30 kB (26% shaved) in 23 ms
- Most balanced: oxc-minify: 122.26 kB (37% shaved) in 43 ms
- Honorable mention: @swc/core: 123.26 kB (36% shaved) in 130 ms
## Round 8: npm package "three" (248.27 kB gzipped)
- Best gzip compression: @swc/core: 158.75 kB (36% shaved) in 204 ms
- Fastest: @cminify/cminify-linux-x64: 191.97 kB (23% shaved) in 24 ms
- Most balanced: @swc/core: 158.75 kB (36% shaved) in 204 ms
- Honorable mention: oxc-minify: 160.82 kB (35% shaved) in 63 ms
## Round 9: npm package "victory" (309.94 kB gzipped)
- Best gzip compression: uglify-js: 157.44 kB (49% shaved) in 6,579 ms
- Fastest: @cminify/cminify-linux-x64: 221.12 kB (29% shaved) in 34 ms
- Most balanced: @swc/core: 157.75 kB (49% shaved) in 307 ms
- Honorable mention: oxc-minify: 162.34 kB (48% shaved) in 97 ms
## Round 10: npm package "echarts" (684.61 kB gzipped)
- Best gzip compression: @swc/core: 321.11 kB (53% shaved) in 623 ms
- Fastest: @cminify/cminify-linux-x64: 434.45 kB (37% shaved) in 46 ms
- Most balanced: oxc-minify: 324.59 kB (53% shaved) in 205 ms
- Honorable mention: esbuild: 331.62 kB (52% shaved) in 188 ms
## Round 11: npm package "antd" (825.18 kB gzipped)
- Best gzip compression: @swc/core: 452.40 kB (45% shaved) in 801 ms
- Fastest: @cminify/cminify-linux-x64: 623.37 kB (24% shaved) in 74 ms
- Most balanced: oxc-minify: 460.57 kB (44% shaved) in 276 ms
- Honorable mention: @tdewolff/minify: 471.79 kB (43% shaved) in 146 ms
## Round 12: npm package "typescript" (1.88 MB gzipped)
- Best gzip compression: @swc/core: 859.04 kB (54% shaved) in 1,701 ms
- Fastest: @cminify/cminify-linux-x64: 1.13 MB (40% shaved) in 111 ms
- Most balanced: oxc-minify: 860.68 kB (54% shaved) in 495 ms
- Honorable mention: @tdewolff/minify: 875.82 kB (54% shaved) in 266 ms
# Eliminated
## babel-minify
Failed "d3" in minification stage:
"unknown: Cannot read properties of undefined (reading 'add')"
## tedivm/jshrink
Failed "d3" in minification stage:
"RuntimeException: Unclosed regex pattern at position: 289075 in /packages/minifiers/vendor/tedivm/jshrink/src/JShrink/Minifier.php:660"
## bun
Failed "typescript" in post-validation stage:
"Expected values to be strictly equal:\n+ actual - expected\n\n+ 'var x = function () { return \"string\"; };\\r\\n'\n- 'var x = function () { return \"string\"; };\\n'"
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4