JavaScript Minifier

Paste your JavaScript below and get a minified version instantly. Whitespace, comments, and dead code are removed client-side — your code never leaves your browser.

Remove comments
Collapse whitespace
Shorten variable names
Input · JavaScript
Output · Minified
❤️ Support CodeConverter.net and donate ❤️

Why minify JavaScript?

What does JavaScript minification do?

JavaScript minification is the process of removing all unnecessary characters from source code — including whitespace, newlines, comments, and block delimiters — without changing its functionality. The result is a smaller file that browsers download and parse faster, directly improving page load times and Core Web Vitals scores.

Modern minifiers also perform more advanced transformations: shortening local variable and function names, eliminating dead code, and collapsing simple expressions. A well-minified JS bundle can be 30–80% smaller than the original source.

Faster page loads
  • Smaller files transfer faster over the network
  • Less bytes for the browser to parse and compile
  • Improved Time to Interactive (TTI) metric
  • Better Core Web Vitals & SEO rankings
100% private & client-side
  • All processing happens inside your browser
  • Zero data transmitted to any server
  • Safe for confidential or proprietary code
  • Works offline — no internet required after load
How to use this tool
  • Paste your JS or click Upload to load a file
  • Adjust options (comments, whitespace, var names)
  • Click Minify JavaScript to process
  • Copy the result or download as .min.js
What gets removed?
  • Single-line (//) and block (/* */) comments
  • Unnecessary spaces, tabs, and newlines
  • Trailing semicolons where optional
  • Optionally: long variable & function names

Is minified code still readable?

Minified code is intentionally hard to read — that's part of the point. For debugging, always keep your original source files and use source maps to map minified line positions back to the originals. Most modern bundlers (webpack, Rollup, Vite) generate source maps automatically.

For production deployments, the recommended workflow is: develop with readable source → bundle with your build tool → minify and optionally gzip the output → serve the minified version. This tool is ideal for quick one-off tasks or for projects without a formal build pipeline.