HTML Formatter
Beautify messy or minified HTML with proper indentation.
What is the HTML Formatter?
This tool takes HTML markup — whether it's been minified, generated by a template engine, or just typed without any consistent structure — and reformats it with clean, nested indentation so the document structure is easy to follow at a glance.
How to use it
- Paste your HTML into the input box.
- Choose an indent size and click Format HTML.
- Copy the neatly indented result.
Well-indented HTML makes it far easier to spot an unclosed tag, understand how deeply an element is nested, or review a diff in version control. This is especially useful when you've copied a code snippet from a minified production page, extracted a fragment from browser DevTools, or received HTML from a source that doesn't format it consistently. This tool uses the widely used js-beautify library under the hood, the same formatter that also powers HTML formatting in several popular code editors.
Want the "why" behind this tool? Read HTML Doesn't Actually Require Closing Tags (But You Should Use Them Anyway).