HTML Formatter and Minifier
Indent minified HTML so it can be read, or minify it, keeping the contents of pre, script, style and textarea exactly as they were.
Free · No sign-up · Your inputs stay in your browser
Input
Format or minify HTML
Output
Result
503 characters
Contents of pre, script, style and textarea are kept byte for byte. Minifying removes the whitespace between tags, which can close a visible gap between two inline-block elements; check the page after.
Runs in this browser. Nothing you paste is sent to a server.
About this tool
Method, assumptions, practical next steps, and limits.
Whitespace can be content
Between inline elements, whitespace renders as a space. Minifying <a>One</a> <a>Two</a> joins the two links, and removing the gap between inline-block elements changes a layout. Check the page after minifying; a build tool with an HTML-aware minifier knows these cases.
Reading generated HTML
The common use is the other direction: a server-rendered page, an email template or a scraped document arrives as one long line. Formatting it makes the structure visible. The browser's own view is in DevTools' Elements panel, which shows the DOM after scripts ran rather than the HTML that was sent.