What does the HTML prettifier do?
It re-indents HTML following the WHATWG parsing rules: block elements go on their own lines, while inline text, <pre>, <textarea>, scripts and styles keep their exact whitespace, and optional end tags (</li>, </p>, </td>) are understood rather than added. Only whitespace that doesn't render is changed, so the page looks the same.
It also lists what a browser would repair without telling you: unclosed or stray tags, duplicate attributes, <div/> written as if self-closing. Sanitizing with DOMPurify strips scripts and event handlers from untrusted markup.
How to use this tool
- Paste HTML into the editor.
- Read the prettified or minified output and any warnings.
- Sanitize untrusted markup with DOMPurify, then copy the result.
Frequently asked questions
Will formatting change how my page renders?
No. Whitespace is only added or removed next to block-level elements, where it doesn't render. Minify also removes it between blocks, which can matter if CSS makes those elements inline.
Is HTML uploaded?
No. Formatting and sanitization run 100% in the browser.