JavaScript Bundle Size Analyzer
Is your bundle too big — and what's bloating it?
To know whether your JavaScript will load fast, drop a built .js/.css file and get its real gzip and Brotli size, measured with the browser's native compression — or paste a webpack/Next.js/Vite stats.json and explore an interactive treemap of exactly which modules and packages make up the weight. Every bundle is graded against the ~170 KB mobile JavaScript budget, with real load times from Slow 3G to fibre and a duplicate-package finder. Everything is measured in your browser — your code never leaves your machine.
Budget per web.dev / Alex Russell mobile JS guidance · gzip via the native CompressionStream API · parse cost modelled on Addy Osmani's “Cost of JavaScript”
Bundle analyzer console
Why bundle size is the number that moves revenue
web.dev and Alex Russell's 'Can You Afford It?' set ~170 KB of gzipped JS as the ceiling for a snappy time-to-interactive on a median phone over 4G. Past it, the parse cost alone starts to hurt.
and Google found 53% of mobile visits are abandoned if a page takes over 3 seconds. Bundle size is the most controllable input to that number.
(HTTP Archive, mobile) — and most of it is framework and dependency code the user never sees, which is exactly what the treemap below exposes.
on a median Android phone — before a single line runs. Compression shrinks transfer, but the CPU still has to parse the full uncompressed bytes, so raw size matters too.
What popular libraries cost — typical min + gzip
| Library | Min + gzip | Notes |
|---|---|---|
| preact | 4 KB | React-compatible API at a fraction of the weight. |
| react + react-dom | 44 KB | The baseline cost of React on a page. |
| vue | 34 KB | Runtime + reactivity, before your app code. |
| jquery | 30 KB | Still everywhere; rarely needed in 2026. |
| lodash (full) | 25 KB | Import single functions (lodash-es) to pay only for what you use. |
| moment | 72 KB | Huge and not tree-shakeable — the classic bundle villain. |
| date-fns | 6 KB | Tree-shakeable per-function; pay only for the dates you format. |
| dayjs | 3 KB | Moment-compatible API at ~1/20th the size. |
| axios | 13 KB | Native fetch is 0 KB if you can drop the polyfill ergonomics. |
| chart.js | 60 KB | Register only the controllers you use to shrink it. |
| three.js | 160 KB | 3D is expensive; lazy-load it off the critical path. |
| framer-motion | 60 KB | Animation is heavy — import the LazyMotion subset. |
Approximate full-import min+gzip, rounded; tree-shaking and version change these. Check the live transitive footprint of any of these in the npm dependency analyzer.
How the numbers are computed
Load time
total = gzipKB / throughput + RTT + rawKB × 1.1msWorked: 170 KB gzip / (50 KB/s Slow 3G) = 3.4 s download + 0.4 s RTT + parse of the raw bytes. Transfer scales with the compressed size; parse with the uncompressed size.
- ≤50 KBFeatherweight
- ≤170 KBWithin budget
- ≤350 KBOver budget
- ≤700 KBHeavy
- ≤∞Bloated
How size is measured
- 1. Raw size = the UTF-8 byte length of the file — what the browser must decompress and parse.
- 2. Gzip = the file run through the browser's native
CompressionStream('gzip')— the real DEFLATE bytes a server sends. - 3. Brotli ≈ gzip × 0.84, the typical advantage Brotli holds over gzip for JavaScript.
- 4. For a stats.json, module sizes are summed (uncompressed) and the treemap is laid out with a squarified algorithm — area is proportional to bytes.
- 5. Duplicate packages are detected by grouping modules under their
node_modules/<pkg>path across chunks.
How to analyze your bundle in 5 steps
Drop a bundle or paste a stats file
Upload (or paste) a built JavaScript/CSS file to measure its real size, or paste a webpack/Next.js/Vite stats.json (generated with --json or the bundle-stats plugin) to explore what's inside module-by-module.
Pick your depth
Quick gives the size and the mobile budget verdict. Pro adds the network load-time matrix, the duplicate-package finder and the composition breakdown. Engineer exposes the full module table and JSON export.
Analyze
Click Analyze. Gzip size is measured for real with the browser's native compression — nothing is uploaded. For stats files, the treemap, heaviest modules and duplicate packages are computed from the module sizes you provided.
Read the budget verdict and the treemap
The verdict compares your gzip size to the ~170 KB mobile JS budget and shows load time from Slow 3G to fibre. The treemap shows, at a glance, which modules and packages actually account for the weight.
Trim the biggest tiles, then re-measure
Target the largest treemap tiles and any duplicate packages first — swapping moment for dayjs or deduping a doubled library is usually the fastest win. Re-run after each change to watch the budget verdict improve.
Why bundle size became a first-class metric
In 2026, a frontend team ships a feature, the build succeeds, the tests pass — and the site gets measurably slower for everyone on a phone, because the new dependency added 90 KB of gzipped JavaScript that nobody measured. Bundle size is the rare performance metric that is both entirely within a developer's control and almost completely invisible without a tool. This analyzer exists to make it visible at the moment of the decision: before the merge, not after the regression.
The problem is a side effect of how the modern web is built. When webpack popularised module bundling around 2015, it let developers import freely from a vast npm ecosystem and ship one optimised file. That convenience hid the cost: a single import could pull in a library, its dependencies, and their dependencies, all concatenated into the bundle. moment.js became the cautionary tale — 72 KB gzipped, not tree-shakeable, included in full whether you used one date format or fifty — and the reason date-fnsand dayjs exist.
The countermeasures shaped today's tooling. Tree-shaking — dead-code elimination across ES modules, pioneered by Rollup and adopted by webpack — meant libraries that shipped as ES modules could be pruned to only the functions you imported. Code-splitting let apps load JavaScript per-route instead of all at once. And webpack-bundle-analyzer gave the world the treemap: the now-iconic picture of a bundle where the size of each box is the size of each module, and the moment-shaped rectangle dominating the view became a meme and a to-do item at the same time. The treemap on this page is that same visualization, rendered from your stats file in the browser.
Measurement turned into governance through the idea of a performance budget. Alex Russell's "Can You Afford It?" and the web.dev guidance crystallised a number — roughly 170 KB of gzipped JavaScript for the initial load — as the ceiling that keeps time-to-interactive tolerable on the median phone over 4G. The figure is deliberately strict because, as Addy Osmani documented in "The Cost of JavaScript," bytes are not equal: a megabyte of images decodes lazily, but a megabyte of JavaScript must be downloaded, parsed, compiled and executed on the main thread before the page is interactive — roughly a second of CPU on a median Android, before a line of it runs.
That is why this tool reports raw size next to gzip size, and parse time next to download time. Compression is a transport optimisation: gzip and Brotli shrink the bytes on the wire, which helps users on slow networks, but the browser still parses the full decompressed payload, which is what hurts users on slow CPUs — and slow CPUs and slow networks are usually the same users. A bundle that is small over the wire can still feel sluggish if its uncompressed size is large, so the honest verdict needs both numbers, which is what the budget bands and the network matrix here are built from.
The discipline that keeps bundles small is the same one that keeps dependency trees small: ask, before adding anything, what it costs. The leanest sites lazy-load everything off the critical path, prefer tree-shakeable libraries, swap heavyweight dependencies for modern featherweight ones, and wire a size check into CI so the budget is enforced by a robot rather than remembered by a human. This analyzer answers the "what does it cost" question in seconds — and pairs naturally with the npm dependency analyzer for the install footprint and the vulnerability scanner for the security of everything you ship.
Trusted by Performance, Frontend & Platform Teams
“The budget verdict plus the Slow-3G load time is exactly the framing I use to make the case to product. Pasting our stats.json and pointing at a 540 KB lodash tile in the treemap ended a six-month argument about whether bundle size 'really mattered' in one meeting.”
“We dropped our main chunk in and the duplicate-package finder immediately showed two copies of a date library from a stale transitive dep. Real gzip measured in-browser, no upload, no CLI — I now keep this open in a tab during every release. The treemap is genuinely as good as the webpack one.”
“I check every heavy library here before adding it — seeing three.js cost 160 KB gzip next to my whole app's budget made me lazy-load it off the critical path. The min+gzip reference table is the cheat sheet I wish I'd had years ago.”
“Engineer mode's full module table exported straight into our performance-budget review doc, and the raw-vs-gzip split finally got the team to care about parse cost, not just transfer. Would love direct Lighthouse import next, but as a zero-upload first pass it's become standard in our PR template.”
Love using our calculator?
Related tools
Similar Calculators
More tools in the same category
NPM Package Dependency Tree
Visualize npm package dependencies and identify potential issues
Package Vulnerability Scanner
Scan packages for known security vulnerabilities and outdated versions
Python Requirements Analyzer
Analyze Python package dependencies and compatibility issues
Circular Dependency Detector
Detect circular dependencies in codebases across multiple languages
Difference Checker
Compare text, PDFs, images, and code to highlight differences side-by-side
License Compliance Checker
Check package license compliance
Often Used Together
Complementary tools for complete analysis
Related Articles
Dive deeper with our expert guides and tutorials related to JavaScript Bundle Size Analyzer
Budget per web.dev / Alex Russell · parse model per Addy Osmani “Cost of JavaScript” · gzip via native CompressionStream · Last reviewed: 2026-06