HTML Formatter
Indent nested HTML and make long templates readable.
Input
This tool runs entirely in your browser. The data you paste or load is never uploaded.
Result
Enter your input, then run the tool.
About this tool
Re-indents HTML by tracking open and closed tags while leaving inline text, attributes and quoted values intact. Script and style blocks keep their own formatting, so embedded code is not mangled.
How to use it
- Paste the HTML you want to clean up.
- Pick an indentation width.
- Format, then copy the result or download it as .html.
Frequently asked questions
Will inline elements be put on separate lines?
Block-level structure is indented; short inline runs stay together to avoid changing how the page renders.
Does it validate HTML?
No. It reformats markup; use the HTML section of a validator when you need conformance checks.
Keep going
Related tools
HTML Minifier
Remove comments and redundant whitespace from HTML.
XML Formatter
Indent XML documents while preserving their content.
CSS Formatter
Expand compressed CSS into readable rules.
JSON Formatter
Pretty-print compact or broken JSON with a readable indentation.
JSON Validator
Check JSON syntax and see exactly where it breaks.
JSON Minifier
Strip whitespace from JSON to shrink payloads.