HTML Formatter
Prettify messy HTML with readable indentation or minify it to a single line, entirely in your browser.
Prettify or minify HTML with readable indentation, fully in your browser.
Paste HTML of any shape — it stays on your device.
Ready
How to use HTML Formatter
- Paste your HTML into the input box.
- Choose Pretty or Minify and pick an indent size.
- Copy the formatted result.
Frequently asked questions
Is my HTML uploaded anywhere?
No. Formatting runs locally on your device with a dependency-free tokenizer; nothing leaves your browser.
Are script, style and pre contents preserved?
Yes. Script and style bodies are passed through verbatim, and pre and textarea contents keep their exact whitespace.
Does minify remove comments?
Regular comments are removed when minifying, but conditional comments (such as <!--[if IE]>) and the doctype are kept.