Code minifier & beautifier

Pick a language (HTML, CSS or JavaScript), paste your code, then click Beautify for human-readable formatting or Minify to strip whitespace and comments. The character-count stat shows your savings.

Code beautifier

Notes

  • The HTML beautifier handles inline tags (span, a, strong, em…) on the same line as their parent text and block tags on their own lines.
  • The CSS beautifier puts each declaration on its own line and adds a blank line between rules.
  • The JavaScript formatter handles braces, semicolons and basic indentation. Complex source (template literals, nested ternaries) may not format perfectly — for production use a dedicated tool like Prettier.
  • Minifiers strip comments, collapse whitespace and remove redundant separators. They do not rename variables (no full mangling).

FAQ

Is anything sent to a server?

No — formatting happens entirely in your browser via plain JavaScript.

Can I use this output in production?

For HTML/CSS — generally yes. For JavaScript, simple programs are fine; for serious bundling or mangling use Prettier, terser, swc, esbuild, etc.

Related calculators