HTML Formatter
Untangle HTML that a template engine, email client or build step mangled — or shrink it before shipping.
About this tool
Copied HTML often comes with broken, inconsistent or missing indentation. This formatter rebuilds
the indentation level by level, treating void elements (img, br,
input and friends) and self-closing syntax correctly, so your markup reads like it was
written by hand.
How to use it
- Paste your HTML, or click Sample for a quick demo.
- Click Format / Beautify to indent it, or Minify to compress it.
- Copy the result back into your project.
Good to know
- This is a basic formatter: runs of whitespace inside text are treated as insignificant, and
pre-formatted
<pre>blocks are not specially protected. Review the output before publishing. - Comments are preserved during formatting.
- Minifying joins lines and collapses text whitespace — normally safe for browsers, but avoid it
for email templates or pages that depend on
<pre>content.