HTML Formatter
Clean up HTML from templates, emails or dev tools with readable indentation, or shrink it for production. A quick structure check warns about tags that are not closed or are closed in the wrong order.
The HTML is treated as text only: nothing is rendered or executed.
Formatted HTML
How to format HTML
- Paste your HTML into the input.
- Choose Format (with indentation and wrap width) or Minify.
- Review any structure warnings shown under the input.
- Copy or download the formatted HTML.
Frequently asked questions
Is the HTML executed or rendered?
No. The markup is treated as text only. Scripts never run and no resources referenced by the HTML are loaded.
What does the minifier remove?
Comments (except conditional comments) and whitespace between tags. Content inside <pre>, <textarea>, <script> and <style> is left untouched so it keeps working.
Related tools
- CSS FormatterBeautify or minify CSS stylesheets.
- XML FormatterValidate, pretty-print and minify XML documents.
- HTML Entities Encoder / DecoderEscape and unescape HTML special characters.
More in Code & Data.