HTML Formatter
Paste HTML, minified or just messy, to get a properly indented, readable version back.
Frequently asked questions
Does this fix broken or invalid HTML?+
It uses the browser's own lenient HTML parser, which tolerates unclosed tags and other real-world messiness the way a browser rendering the page would, so the output is always valid, well-formed HTML. It doesn't preserve intentionally invalid markup as-is.
Will it change my content or attributes?+
No, only whitespace and indentation change. Tag structure, attributes, and text content stay the same.
What happens to inline elements like <span> and <a>?+
Short inline elements stay on one line with their text rather than each getting their own line, which keeps paragraphs of text with inline formatting readable instead of fragmenting every word onto its own line.