Updated · Built and checked by the PlinzoTools team, formulas tested against published sources
Indent minified or messy HTML for readability.
<div>
<p>
Hello
<br>
World
</p>
</div>This tool indents HTML markup by tag nesting depth, turning a minified or poorly formatted block into a readable structure. It correctly recognizes HTML's "void elements" (like <br>, <img>, and <input>), which never nest content and so don't increase indentation depth.
Paste minified or messy HTML. The indented, readable version appears instantly.
The formatter tokenizes on tag boundaries and tracks nesting depth as it encounters opening and closing tags, indenting each line accordingly. Void elements (area, base, br, col, embed, hr, img, input, link, meta, param, source, track, wbr) are recognized and don't increase the indentation depth for what follows.
For CSS specifically, see the CSS Beautifier. To minify HTML instead of formatting it, see the existing Code Minifier.
Suppose you paste this single line of markup: a div containing a paragraph, and inside the paragraph the text Hello, a line break, and the text World. The tool first removes any whitespace that sits between a closing bracket and the next opening bracket, then splits the string into tokens: each tag is one token and each run of text is one token. It walks through the tokens keeping a depth counter. An opening tag such as the div is printed at the current depth and then increases the depth by one. The paragraph is printed one level deeper (two spaces per level) and increases the depth again. The text Hello is printed on its own line at that deeper level. The br tag is on the built-in list of void elements, so it is printed but does not increase the depth. Finally each closing tag lowers the depth before it is printed, so the closing paragraph and closing div line up exactly with their openers.
Indent width = 2 spaces x current depth. Opening tag: print, then depth + 1. Closing tag: depth - 1, then print. Void tag or self-closed tag: print only.
Because indentation is driven purely by the tags it finds, the output doubles as a quick structural check. If the closing tags at the bottom of the result do not return to the left margin, an element was probably left open. If the indentation drops to zero in the middle of the document and then resumes, an extra closing tag may exist. The tool does not repair or validate anything: it never adds a missing tag, removes a stray one, or reorders elements. Treat it as a reading aid, and run the page through an HTML validator when you need a definitive correctness check.
The formatter uses a fixed indent of two spaces and offers no options for tabs, line wrapping or attribute alignment. Attributes stay exactly as written inside their tag. It works entirely in your browser, so the size of what you can paste is limited only by your device, and nothing is uploaded. Because it collapses whitespace between tags before formatting, any deliberate spacing between adjacent inline elements is lost in the beautified copy, so keep your original if exact rendering matters.
No -- it's a formatter, not a validator; it reformats whatever tag structure it finds without checking HTML spec compliance.
Because they're "void elements" that never contain nested content in HTML -- treating them as non-nesting matches how browsers actually parse the HTML spec.
No -- whitespace between tags is generally not significant in HTML rendering, so adding readable indentation doesn't change the page's visual output.
The tool puts every tag and every run of text on its own line, regardless of whether the element is block or inline. This keeps the algorithm simple and predictable, but it means a sentence with bold or link tags is split across several lines.
Usually, but not always. Removing whitespace between tags and adding line breaks can change spacing between inline elements or inside preformatted blocks. Compare the rendered page before replacing production markup.
No. It only indents what it finds. Unbalanced tags show up as odd indentation, which can help you locate them, but the tool will not correct them.
No. The interface uses a fixed two-space indent per nesting level. If you need tabs or four spaces, paste the output into an editor and convert the leading whitespace there.
Reference: MDN Web Docs