HTML Formatter
Format and indent HTML markup for readability.
Processed locally in your browser. Nothing you enter is uploaded or stored.
- Re-indents nested elements so structure is visible at a glance.
- Choose your indent size.
- Runs in your browser; markup isn't uploaded.
Why this is private
- Processed locally in your browser. Nothing you enter is uploaded or stored.
- Open your browser's DevTools → Network tab while using this tool — you won't see a request carrying your input, because it never leaves your device.
- Nothing you enter is uploaded to a server or shared with us — the processing happens entirely on your device.
Overview
Reformats minified or inconsistently indented HTML into clean, nested markup that's easy to read.
How to use it
- 1Paste HTML markup.
- 2Choose indent size.
- 3The formatted output appears instantly.
Frequently asked questions
What people use it for
Read minified HTML from view-sourceExpand a single-line page or fragment into inspectable markup.
Clean up HTML from a CMS or email builderNormalise output before committing it to a template.
Review a diff of markup changesFormat both sides so the real change isn't buried in whitespace noise.
Tidy pasted snippetsMake a copied component consistent with your codebase's indentation.
Related guides
- How to read JSON with a tree viewerA tree viewer turns a wall of brackets into a structure you can expand, search and copy paths from. Here's how to use one effectively.
- JSON parse errors explained: 'Unexpected token', 'Expected comma or brace', and the restWhat each common JSON error message actually means, the usual cause, and how to find the spot fast using line and column.
- How to format JSON (and actually understand the errors)JSON looks like a JavaScript object but follows stricter rules. Here's what those rules are and how to read the errors when they're broken.
Related tools
All developer toolsHTML MinifierCompress HTML by stripping comments and whitespace.HTML PreviewEdit HTML and see it rendered live in a sandboxed preview, with a console panel.JSON Viewer & FormatterView, format, validate, edit and beautify JSON with an interactive tree view, plus a shareable link.SQL FormatterFormat and indent SQL queries for readability.
Ready to use HTML Formatter?
HTML Formatter