How to Use the HTML Prettifier Online
- 1Paste the HTML you want to inspect. For a large document, start with the relevant section so the hierarchy is easy to follow in the result.
- 2Choose two or four spaces under Indentation Spacing. The output updates when you change the setting, so you can compare both styles without editing the original.
- 3Follow the aligned opening and closing tags. If a section looks unexpectedly indented, compare it with the source to check which element begins or ends there.
- 4Copy the formatted snippet for review or documentation. If you plan to use the formatted source in a page, preview any content whose original spacing matters.
Input & Output Examples
The list items line up at the same indent, which makes it easier to see that both belong to the list.
<ul><li>Alpha</li><li>Beta</li></ul><ul>
<li>
Alpha
</li>
<li>
Beta
</li>
</ul>The image and paragraph share an indent because the image is a void element and creates no additional nesting.
<section><img src="cover.png" alt="Cover"><p>Read more</p></section><section>
<img src="cover.png" alt="Cover">
<p>
Read more
</p>
</section>Practical Developer Workflows
- Turn one line of templated output into a readable example you can attach to a code review.
- Inspect a generated list, card, or navigation fragment to see where a nested element sits in the surrounding markup.
- Format a short fixture so future edits to its tags can be reviewed separately from the surrounding document.
Zero Server Uploads & Complete Privacy
Runs 100% in your browser; no data is uploaded to any server.
Let us know directly so our engineering team can fix it.