npm Package Size Estimator
Check the bundle size of npm packages before adding them to your project. Enter package names to see individual sizes, total bundle weight, a budget indicator, and suggestions for lighter alternatives. Built-in database of 60+ popular packages with minified+gzipped sizes.
Frequently Asked Questions
What is minified + gzipped size and why does it matter?▼
Minified + gzipped size is the closest approximation to what your users actually download. Minification removes whitespace, comments, and shortens variable names. Gzip compression further reduces the size by 60-80% on average. Most CDNs and web servers serve gzipped responses automatically. When evaluating package size, always use the min+gz number — the raw minified size is misleading because gzip handles repetition very efficiently.
What is a good JavaScript bundle size budget?▼
A common rule of thumb: keep your total JavaScript bundle (excluding React/framework) under 50 KB min+gz for fast loading on mobile. For the full initial load including framework, aim for under 100 KB min+gz. Google's Performance Budget recommends total transfer size under 200 KB on a 3G connection for Time to Interactive under 5 seconds. For critical path JS (blocking render), target under 14 KB — the TCP slow-start window. Libraries like moment (72 KB) or MUI (93 KB) alone can blow your budget.
Are these package sizes accurate?▼
Sizes in this tool are approximate based on common bundle sizes reported by bundlephobia.com and bundle.js.org. Actual sizes depend on which parts of the package you import (tree-shaking), your bundler configuration, and whether you're using the ESM or CJS build. For exact sizes, use bundlephobia.com or run your actual bundle through webpack-bundle-analyzer or vite-bundle-visualizer.
What is tree-shaking and how does it reduce bundle size?▼
Tree-shaking is a bundler optimization that removes unused exports from your bundle. If you import `import { format } from 'date-fns'`, only the format function is included — not the entire library. For tree-shaking to work, the package must be written as ES modules (ESM with import/export statements, not CommonJS require). Libraries like date-fns, lodash-es, and @radix-ui/* are fully tree-shakeable. Lodash (non-es) is not tree-shakeable — use `lodash-es` or individual imports like `lodash/debounce`.
What are the best lighter alternatives to popular heavy packages?▼
moment → dayjs (2.6 KB vs 72 KB). lodash → lodash-es with named imports or radash (4 KB). axios → ky (4 KB) or native fetch. @mui/material → headless UI + Tailwind or shadcn/ui. framer-motion → CSS transitions or motion/react (subset). redux + react-redux → zustand (1.2 KB) or jotai (3.1 KB). yup → zod (12 KB) or valibot (1.2 KB). formik → react-hook-form (8.6 KB). These alternatives often have better TypeScript support too.
How can I analyze my actual project's bundle?▼
For Vite projects: install `rollup-plugin-visualizer` and add it to vite.config.ts. For webpack: use `webpack-bundle-analyzer`. For Next.js: use `@next/bundle-analyzer`. For a quick check without building: use `bundlephobia.com` to check individual packages, or `bundlesize` CLI for CI budget enforcement. The Chrome DevTools Coverage tab shows unused JavaScript on an actual page load. For per-route analysis in Next.js, check the build output — it shows each route's JS size.
Related Products
on GumroadTypeScript Quick Reference Toolkit
5 practical reference files for TypeScript developers: cheatsheet, TS vs JS comparison, 20 utility types with real examples, tsconfig best practices template, and 15 common mistakes guide. Print it. Keep it on your desk.
Buy on Gumroad →Developer Productivity Bundle
Stop rebuilding the same setup every project. 51 VSCode snippets, 40 Git aliases, 5 Docker Compose stacks, 5 GitHub Actions workflows, 5 README templates, and a dotfiles kit. Set up a professional dev environment in under an hour.
Buy on Gumroad →AI Prompt Engineering Toolkit
58 structured prompt templates for Claude, ChatGPT, and Gemini — organized by use case. Code Review, Debugging, Documentation, Architecture, and 10 model-specific tips. Stop writing prompts from scratch.
Buy on Gumroad →You Might Also Need
Vitest Configuration Generator
Generate a complete vitest.config.ts visually. Configure test environment (node/jsdom/happy-dom), coverage provider, reporters, thresholds, and path aliases.
Open free tool →
npm Package Stats
Look up npm package weekly download counts, unpacked size, dependency count, latest version, license, and repository link. Live data from the npm registry.
Open free tool →
Bundle Size Estimator
Estimate JavaScript bundle size from npm packages. 200+ popular packages with load time estimates for 3G, 4G LTE, 5G, and WiFi connections.
Open free tool →
More Free Tools
Related Articles
Vite 6 vs Webpack 5 深度對決:2026 大型專案遷移實戰指南
2026 年最完整的 Vite 6 vs Webpack 5 深度比較與遷移指南。涵蓋效能基準測試、分塊策略、CSS Modules、環境變數轉換、常見陷阱與真實大型專案遷移清單。
Performance Optimization 2026: Complete Guide to Frontend, Backend, and Infrastructure
Comprehensive performance optimization guide for 2026 covering Core Web Vitals, JavaScript bundle optimization, server-side rendering, caching strategies, database query optimization, CDN configuration, and real-world benchmarks.
Vite 6 vs webpack vs esbuild vs Turbopack: Build Tool Comparison 2026
In-depth 2026 comparison of JavaScript build tools: Vite 6, webpack 5, esbuild, and Turbopack. Build speeds, HMR, plugin ecosystems, migration paths, and when to use each.
Vite 6 vs Webpack 5 vs Turbopack: Which Bundler Wins in 2026?
A detailed comparison of Vite 6, Webpack 5, and Turbopack build performance, HMR speed, configuration complexity, and production output. Includes real benchmark data and a decision guide for 2026.
Vite vs Webpack vs Turbopack vs esbuild: Build Tool Comparison 2026
Compare Vite, Webpack, Turbopack, and esbuild on cold start, HMR speed, bundle size, and ecosystem fit. Includes benchmarks, config examples, and migration guides for 2026.
Enjoying this tool? Get more like it.
Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.
Unlock AI-Powered Dev Tools
- ⚡ AI Code Review, Doc Generator & SQL Builder
- ⚡ All premium templates & early access
- ⚡ Member discounts on Gumroad products
$9/mo after trial · Cancel anytime
Want the full toolkit?
Get DevPlaybook Pro
Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.
MIT licensed · Instant download · No subscription
See what's included → Browse all deals →