Developer tools · free · no signup

CSS, JS & HTML Minifier

Remove unnecessary whitespace from front-end code. Your work stays on this device whenever possible.

Free to useNo accountClear results
Preparing tool…
Simple, transparent workflow

How to use CSS, JS & HTML Minifier

  1. Paste your code into the box and set 'Code language' to CSS, JavaScript or HTML, or leave 'Auto-detect language'.
  2. Keep 'Preserve license/copyright comments (/*! ... */)' ticked to retain banner comments.
  3. Tick 'Remove console.log statements (JS only)' if you want logging calls stripped.
  4. Press 'Minify code' and read the savings card for original size, minified size and percentage saved.
  5. Save the result with 'Download Minified File'.

Worked example

Set 'Code language' to CSS and paste a comment /* card */ followed by .card { margin: 0 auto; color: #333; background: url(a.png); } across four lines. The comment is dropped and whitespace collapses, giving .card{margin:0 auto;color:#333;background:url(a.png)} with the final semicolon removed. The card reports 79 bytes reduced to 53, saving 26 bytes, or 32.9%.

When to use this tool

  • Shrinking a small landing-page stylesheet by hand before inlining it.
  • Trimming whitespace from an HTML snippet destined for an email template.

Important limitations

By default performs safe lexical whitespace and comment compaction without destructive AST mangling or variable renaming; an optional real-parser (Terser) mode with variable mangling and source maps is available for JavaScript.

Frequently asked questions

Is this a full minifier?

No. It only removes comments and whitespace; it does not rename variables or drop dead code. Savings are therefore smaller than from a compiler-style build tool.

Why can minified JavaScript break?

Newlines become spaces, so code relying on automatic semicolons can fail. A // inside a string, like a web address, is treated as a comment and cut, and spaces inside string literals collapse.

Which CSS values does it damage?

It strips spaces around the plus sign, so calc(1px + 2px) becomes calc(1px+2px), which browsers treat as invalid. Keep spaced operators in such rules, or check them after minifying, because the tool will not warn you.

How well does console removal work?

It removes console.log, debug, info, warn and dir calls, but the pattern stops at the first closing bracket. A nested call such as console.log(fn(x)) therefore leaves a stray ');' behind that you must delete.

How is the language detected?

HTML if it sees a doctype or common tags, CSS if it finds a rule block with no JavaScript keywords, otherwise JavaScript. Choose manually when the guess is wrong.