HTML, CSS & JS Minifier and Beautifier

Link copied

A two-way code formatter for the web's three core languages. Switch between HTML, CSS, and JavaScript, then choose a direction: Minify strips comments and collapses whitespace to shrink files for production, while Beautify re-indents compressed or messy code into a clean, readable layout with your choice of indent width. The minifier is deliberately safe — it preserves string and template literals, regular expressions, and quoted HTML attribute values, and keeps JavaScript line breaks so automatic semicolon insertion behaves exactly as written. A live size readout shows how many bytes you saved. Everything runs entirely on your device; no code is ever uploaded.

Size: 163 B

Size: 114 B · 30% smaller

How to use

Pick a language tab (HTML, CSS, or JavaScript) and choose Minify or Beautify. Paste your code into the input box, or press Sample to load an example. The result updates instantly in the output box, where you can read the new size and, when minifying, the percentage saved. When beautifying, set the indent to 2 or 4 spaces. Use Copy to grab the output, or "Use as input" to feed it back in and switch direction.

Frequently asked questions

Is my code uploaded to a server?
No. All minifying and beautifying happens locally in your browser with no network requests. Your code is never transmitted, logged, or stored, and the tool works offline once the page has loaded.
How aggressive is the minifier?
It uses a safe, lightweight approach: comments are removed and whitespace collapsed, but string/template literals, regular expressions, and quoted HTML attribute values are preserved exactly, and JavaScript keeps its line breaks so semicolon-insertion behaviour never changes. This favours correctness over squeezing out the very last byte.
Will beautify reformat already-minified code?
Yes. Beautify re-indents code based on its structure, so it works just as well on a single-line minified file as on hand-written code. Choose a 2- or 4-space indent to match your project's style.