HTML Formatter

Indent nested HTML and make long templates readable.

Runs in your browser Developer Tools Free · No account

Input

Processed locally

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

  1. Paste the HTML you want to clean up.
  2. Pick an indentation width.
  3. 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

More in this category