JavaScript Minifier
Minify JavaScript code by removing whitespace, comments, and unnecessary characters.
What is JavaScript Minification?
JavaScript minification is the process of removing every byte from a script that doesn't affect its execution: comments, indentation, blank lines, optional semicolons, and unnecessary parentheses. Aggressive minifiers go further — renaming local variables to single characters, inlining short constants, and dead-code-eliminating unreachable branches. The output is functionally identical to the input but typically 30–50% smaller before gzip. Combined with brotli, you get another 15–30% reduction. Since JavaScript is parser-blocking on initial load, minified code directly improves Time to Interactive on mobile. Production bundlers (Vite, webpack, esbuild) ship terser, swc, or esbuild's own minifier as part of the build — but for one-off snippets, this tool runs the same kind of pass in your browser. Pair it with the CSS Minifier and HTML Minifier for a complete static-site optimization pass.
Input JavaScript
Minified Output
Original Size
0bytes
Minified Size
0bytes
Savings
0.0%
Options
Remove Comments
Collapse Whitespace
Remove Operator Spacing
Remove Blank Lines
How to use this tool
- 1Paste your JavaScriptDrop your source code into the input editor. ES2015+ syntax including template strings, classes, and async/await is supported.
- 2Click MinifyThe output editor shows the compressed JS instantly, along with the original size, minified size, and percentage saved.
- 3Copy or downloadUse the Copy button to grab the minified code for your build pipeline, or Download to save as a .min.js file.
