HTML Formatter

Re-indent messy HTML so every element lines up, with inline tags kept tidy and void elements handled correctly.

How it works

  • Block elements are indented by the depth they sit at; <pre>, <textarea> and <script> contents are left completely alone.
  • Void elements (<br>, <img>, <input>…) are never given closing tags or extra indentation.
  • Optional one-attribute-per-line layout makes long tags much easier to read.