How to format HTML online
Paste minified or messy HTML, choose Beautify, and pick 2 or 4 spaces of indentation. The formatted markup appears with syntax highlighting, ready to copy or download as an HTML file. Choose Minify to go the other way.
<ul><li>One</li><li>Two</li></ul> → <ul> <li>One</li> <li>Two</li> </ul>
Beautify or minify
- Beautify adds line breaks and indentation so you can read the structure: page source from view-source, HTML email templates, CMS or framework output, and markup copied from a bug report.
- Minify removes comments and the whitespace between tags to make the file smaller.
- The minifier is a simple whitespace remover. It also collapses runs of spaces inside
<pre>,<textarea>and inline scripts, so don't minify markup where that spacing matters. - Beautifying adds line breaks between tags. Between inline elements, such as two links side by side, a line break can show as a space, so check spacing-sensitive layouts after formatting.
Related tools
To show HTML as text, escape it with HTML Entities. To write content in Markdown and see it rendered, use Markdown Preview.