Developer Utilities · Free tool
HTML Formatter
Paste HTML — get a cleanly indented version or a minified one. In-browser, safe, no ads.
Updated April 2026
What it does
Beautify messy HTML into clean, 2-space indented markup, or minify it by stripping whitespace between tags. The formatter walks the token stream, handles void tags and self-closing elements, and preserves text content. Minify mode produces the smallest HTML possible while keeping the structure valid.
Great for cleaning up scraped markup, email templates, or dumping production HTML for inspection. For CSS/JS compression see CSS minifier and JS minifier; for JSON work, JSON formatter.
How to use it
- Paste HTML into the input.
- Pick beautify or minify.
- Read the formatted output.
- Copy or download the result.