HTML Formatter

Beautify and indent messy HTML markup.

Support
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>

Keyboard shortcuts

  • Copy the main outputCtrl / ⌘ + Shift + C
  • Download the resultCtrl / ⌘ + S
  • Share this toolCtrl / ⌘ + Shift + S
  • Reset the inputsAlt + R
  • Open the tool search paletteCtrl / ⌘ + K

Related tools

Frequently asked questions

Read more

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