HTML, CSS & JS Minifier

Minify HTML, CSS and JavaScript by removing comments and whitespace.

About this tool

Smaller files load faster. Paste CSS, HTML or JavaScript to strip comments and unnecessary whitespace and see how many characters you saved. JavaScript is minified with Terser, the same engine used by many build tools, which compresses code and can shorten local variable names. Syntax errors are reported with a line and column.

How to use it

  1. Choose CSS, HTML or JavaScript.
  2. Paste your code and click Minify.
  3. Check the savings and copy the output.

Frequently asked questions

Is the minified code safe to use?

CSS and HTML are minified using standard whitespace rules. Always test the result, and keep your original source file.

Will minified JavaScript behave the same?

Terser preserves behavior, but test the output. Untick 'Shorten local variable names' if your code relies on function or variable names at runtime.

Why does JavaScript fail with an error?

Terser needs valid syntax. The message shows the line and column of the problem. Modules using import/export are supported.

Is my code uploaded?

No. Everything runs in your browser.