HTML Formatter

Beautify and indent messy HTML markup.

Works Offline
Privacy First
No Login
No API

Input

Output

About the HTML Formatter

Format and indent HTML with a custom tokenizer that understands void elements, comments, and preformatted tags like pre, textarea, script, and style. Choose your indent size or minify to a single compact line.

Examples

Messy HTML

<div><p>hi</p></div>

Output

<div>
  <p>hi</p>
</div>

Related tools

Frequently asked questions

Version 1.0.0 · Updated 2026-08-06 · Runs entirely in your browser