Beautifies or minifies HTML markup instantly.
Input
<div><p>Hello</p></div>
Output
<div> <p> Hello </p> </div>
HTML pulled from a saved page a template file or a quick export often arrives as one long line or with indentation that doesn't match its actual nesting. That makes it hard to tell which closing tag belongs to which opening one just by looking. This tool reformats markup so each element sits at the indentation level its nesting actually calls for which makes the structure of a page visible again at a glance.
Beautify mode walks through your markup tag by tag tracking how deep the current position sits inside divs sections and other containers then rebuilds the document with two spaces of indent per level. Void elements like img br and input don't open a new level since they never have closing tags or children. Minify mode does the reverse job it strips out HTML comments and collapses the whitespace sitting between tags down to nothing which shrinks file size for production use.
This is a practical formatter rather than a full parser, and that distinction matters. It handles ordinary hand-written HTML well, nested divs, lists, forms, tables, the usual stuff, but it isn't running a browser-grade HTML parsing algorithm underneath. Markup with stray unescaped angle brackets in text content or tags left unclosed on purpose can confuse the indentation logic. For the vast majority of real pages and templates though, the output reads cleanly and matches what you'd expect from a code editor's own formatter.
One thing worth knowing: the minifier doesn't rewrite attribute values, merge adjacent text nodes, or shorten anything beyond whitespace and comments. Content and structure are preserved exactly, only the spacing changes, so round-tripping between beautify and minify won't ever alter what the page actually renders.
Everything runs in your browser using plain string processing, no markup is sent anywhere. That makes this safe to use on internal templates, client work, or anything else you'd rather keep off a third-party server.
More Developer Tools