HTML / CSS / JS Minifier

Paste your code below, select the language, and minify it instantly.

What Is Code Minification?

Minification is the process of removing all unnecessary characters from source code without changing its functionality. This includes whitespace, newlines, comments, and sometimes shortening variable names. The result is a smaller file that downloads faster and consumes less bandwidth.

How Each Language Is Minified

  • HTML: Removes HTML comments (<!-- -->), collapses whitespace between tags, and strips empty lines. Uses regex-based processing.
  • CSS: Removes CSS comments (/* */), collapses whitespace, strips spaces around :, ;, , , and removes empty rules. Regex-based.
  • JavaScript: Uses the Terser library, a production-grade JavaScript minifier that performs dead-code elimination, mangling, and advanced compression.

Why Minify?

Minified assets load faster in the browser, reduce bandwidth costs, and improve Core Web Vitals scores. For production websites, minification is a standard optimization step typically handled by build tools like Vite, Webpack, or esbuild.