Format minified or messy HTML with consistent indentation, making it readable again.
Google AdSense Banner
This area will contain advertisements after approval.
Google AdSense Banner
This area will contain advertisements after approval.
This tool tokenizes your HTML into tags and text using its own hand-written tokenizer, then re-indents based on tag nesting depth, two spaces per level. Void elements (like <br>, <img>, <input>, <meta>) don't affect indentation depth, since they never have closing tags. A single text-only child is kept on the same line as its parent tag for readability.
Unlike our XML Formatter, this tool doesn't throw an error on mismatched or unclosed tags. Real-world HTML5 permits optional closing tags for several elements (like <li>, <p>, and <td> in certain contexts), so a strict well-formedness check would produce false errors on perfectly valid HTML, this tool prioritizes producing a reasonable, readable result over strict validation.
Beautifying the minified '<div><p>Hello</p></div>' expands it back to three lines: '<div>' on its own line, ' <p>Hello</p>' indented two spaces beneath it (kept together since 'Hello' is a single text child), and '</div>' back at the left margin, restoring the readable structure that was collapsed during minification.
Expecting an error message when the HTML has mismatched or unclosed tags, this tool is deliberately lenient (real HTML5 allows optional closing tags in several cases), it does its best to produce readable output rather than flagging structural problems the way the XML Formatter does.
Assuming void elements like <br>, <img>, or <input> need closing tags, they never do, and this tool correctly excludes them from affecting indentation depth.
Expecting semantic reformatting (like reordering attributes or wrapping long attribute lists), this tool only handles indentation based on tag nesting depth, it doesn't touch anything inside a tag's opening bracket.
No, this is a formatter, not a validator, it re-indents based on tag structure but doesn't check whether your HTML follows the full HTML5 specification.
No, all formatting happens entirely in your browser, your code is never transmitted anywhere.
Google AdSense Banner
This area will contain advertisements after approval.