HTML Formatter
Reformat minified or messy HTML into readable, indented markup.
Overview
This tool pretty-prints HTML with js-beautify, the same engine behind many
editor extensions. Nested elements are indented two spaces per level, tags are
placed on sensible lines, and blank lines you already had are kept. It does
not wrap long lines, so attribute-heavy tags remain intact. Useful for reading
minified page sources, tidying CMS or email-template output, and normalizing
markup before a code review diff.
How to use
- Paste your markup into the HTML field — minified or single-line input is fine.
- The beautified result appears in the Formatted field instantly as you type.
- Copy the output from the read-only field.
Examples
-
<div><p>hello</p><span>world</span></div>→<div> <p>hello</p> <span>world</span> </div>
Notes
This is a formatter, not a validator: unclosed or misnested tags are indented
on a best-effort basis without warnings. Embedded <script> and <style>
blocks are indented along with the document. For whitespace-sensitive HTML
(inline-block layouts, <pre> content), verify rendering after formatting.