HTML Formatter

No upload · runs in your browser
Indent
HTML in
0 characters
Result

Runs entirely in your browser, nothing is uploaded.

How it works

HTML Formatter : Beautify or Minify Markup

Indent HTML into a readable tree or minify it. script, style, pre and textarea are copied through byte for byte, and omitted end tags come back explicit.

What this does
  • Beautify from a parsed tag tree, indenting with two spaces, four spaces or a tab
  • An element whose children are all inline stays on one line, so spacing never shifts
  • script, style, pre and textarea contents are copied through byte for byte
  • Minify drops comments except conditional <!--[if …]--> blocks and ones opening <!--!
  • Counts elements and nesting depth, and warns you when it closed a tag you had left open
FAQ

Almost never, because whitespace is only reflowed where HTML already collapses it. An element whose children are all inline is kept on a single line, and script, style, pre and textarea are copied out verbatim. The one thing to know is that if you apply white-space: pre or pre-wrap to an ordinary element with CSS, the formatter cannot see that rule and will collapse its runs of spaces.

Keep going