npm Package Size Checker
See the minified and gzipped size of any npm package, its download time, dependency count and whether it tree-shakes.
npm Package Size Checker tool
Example
Input: Package react-dom, version 18.2.0
Result: 132.9 kB minified, 42.7 kB minified and gzipped. Slow 3G 854 ms, 4G 49 ms. 2 dependencies, not tree-shakeable, side effects possible.
Sizes from a live Bundlephobia response. Download times divide the gzipped size (42,679 bytes) by the assumed speeds of 50 kB/s for slow 3G and 875 kB/s for 4G.
- Type the npm package name, such as react-dom or @tanstack/react-query.
- Leave the version empty for the latest release, type an exact version or tag, or click Browse versions to pick one from the list.
- Click Check package size and wait a few seconds while Bundlephobia measures the package.
- Compare the minified and gzipped sizes, the download times and the dependency count.
- Check the Tree-shakeable and Side effects flags to see whether importing only part of the package will shrink its cost.
Measuring What an npm Package Costs
Type an npm package name and this tool shows what it adds to a JavaScript bundle. You get its minified size, its size after gzip compression and how long that takes to download. For example, react-dom 18.2.0 is 132.9 kB minified and 42.7 kB minified and gzipped. The sizes come from Bundlephobia, which builds the package with a bundler and measures the output. Details such as license and weekly downloads come from the public npm registry.
The gzipped number matters most, since it is close to what a browser actually downloads. The download times assume slow 3G at 50 kB per second and 4G at 875 kB per second, with no latency or caching. Use them to compare packages, not to predict a real page load.
Two flags help you judge the true cost. Tree-shakeable means the package ships an ES module build, so a bundler can drop the parts you never import. Side effects shows whether package.json declares "sideEffects": false. Without it, bundlers keep more code to be safe. Bundlephobia measures the whole package, so importing one function from a tree-shakeable library usually costs much less.
You can check an exact version or a tag such as next. Browse versions loads the full version list from the registry. For a package as popular as react that list is over 1 MB, so it only loads when you ask. Scoped names such as @tanstack/react-query work too.
Bundlephobia builds a version the first time anyone asks for it, which can take 30 seconds or more. It also limits how many requests one visitor can make. Packages with no runtime code, such as @types packages, cannot be sized. Your browser sends only the package name and version. Before you add a dependency, it is worth running it through the Package Vulnerability Checker as well. To shrink your own scripts, try the JavaScript Minifier.
Sources
Frequently Asked Questions
Related Tools
Package Vulnerability Checker
Check npm, PyPI, Maven, Go and other packages for known vulnerabilities and CVEs, and see which version fixes each.
Developer ToolsJavaScript Minifier
Minify JavaScript by removing whitespace, line breaks, and comments for smaller files, without renaming your code.
Developer ToolsCSS Minifier
Minify CSS by removing whitespace, comments, and redundant code to reduce file size.
Developer Tools