To format HTML, paste it in the box and press Beautify. The tool puts each block element on its own line and indents nested elements, using 2 spaces, 4 spaces or tabs. Minify does the opposite: it strips comments and indentation to make the file smaller. Neither changes how the page works.
Before and after
Minified HTML, the way it often comes out of a page builder or email tool:
<div class="card"><h2>Free delivery</h2><p>On orders over <b>$50</b>.</p><a href="/shop">Shop now</a></div>
The same code, formatted:
<div class="card"> <h2>Free delivery</h2> <p>On orders over <b>$50</b>.</p> <a href="/shop">Shop now</a> </div>
When to format and when to minify
| Beautify when you | Minify when you |
|---|---|
| Need to read or fix code copied from a live site | Paste HTML into an email builder with a size limit |
| Find a missing closing tag | Embed a widget where space is tight |
| Review a theme or plugin template | Send static HTML with no build step |
| Share code with a developer | Want a smaller file before compression |
Common HTML mistakes formatting reveals
- Unclosed tags. When indentation keeps moving right and never comes back, a closing tag is missing.
- Block elements inside <p>. A <div> inside a paragraph is invalid, and browsers close the paragraph early.
- Deep nesting. Page builders often wrap content in 10 or more <div>s. That's harder to style and slower to render.
- More than one <h1>. Usually a sign the heading structure needs a look. The Website SEO Audit checks it for you.