WebTools

Format HTML

Indents and tidies up messy or minified markup.

Indent minified or badly laid-out HTML so it can be read. Useful for understanding code a tool spat out, reviewing a template, or seeing what is inside an HTML email.

It respects inline elements and does not break text in the middle of a paragraph, which is what makes automatic indentation useful rather than annoying.

How to use it

  1. Paste the markup.
  2. Adjust the indentation.
  3. Copy or download the result.

Frequently asked questions

Does it change how the page looks?
With well-formed HTML it should not. Whitespace between inline elements does count, so check if you have delicate inline-block layout.
Does it work for JSX or templates?
Only partly. JSX braces and tags like {{ }} or <?php ?> confuse it, because it parses HTML and nothing else.
What about minifying it?
This tool goes the other way. For page weight, the CSS and JavaScript matter most, and both have their own tools here.

Related tools