Formatting rules this tool applies
Block-level elements (div, section, p, table rows) each start on their own line and increase the indent level for their children. Inline elements (a, span, strong, code) stay in the flow of their parent line, preserving the spacing semantics of inline content. Void elements like img, br, and input are never given closing tags, and boolean attributes (disabled, checked) are left bare — matching the HTML Living Standard rather than XHTML conventions.
Formatter vs editor: where this fits
If you work in a project with a build chain, Prettier or your IDE’s format-on-save should own HTML formatting — consistency comes from automation, not discipline. This tool covers everything outside that loop: HTML copied from a browser’s “View Source”, CMS template fields, email markup, scraped fragments, and generated output from tools that emit single-line HTML. Beautify here, inspect or edit, then paste back.
Minified HTML in production
HTML minification removes inter-tag whitespace and comments, typically saving 5–15% before compression. Two cautions: conditional comments and comment-based hooks (some frameworks and A/B-testing snippets target comments) must survive, so review what was stripped if a third-party script breaks; and don’t minify templates that still go through a server-side template engine — minify the final rendered output instead, at the edge or in the framework’s build step.
Debugging markup by re-indenting it
A surprisingly effective debugging technique: when a layout breaks because of an unclosed tag, beautify the page source and read the indentation. The first element whose indent level looks wrong — nested deeper than it should be — is almost always sitting inside the element that was never closed. The browser’s “Inspect Element” view shows the repaired DOM, which hides the mistake; formatted raw source shows what you actually wrote.