HTML / XML Formatter & Validator

Paste HTML or XML and get it cleanly indented, with well-formedness errors (XML) or unclosed-tag warnings (HTML) flagged.

906 views

Readable Markup, With Problems Flagged

Pick HTML or XML, paste your markup, and get it back cleanly indented — nested elements step in, attributes preserved, void elements (like <br> or <img>) left unclosed as HTML expects. In XML mode the parser is strict: any well-formedness error (unclosed tag, mismatched nesting, invalid characters) is reported with a message. In HTML mode, browsers deliberately parse leniently — HTML doesn't have a formal "invalid" the way XML does — so this checks tag balance instead and flags tags that don't close.

Frequently Asked Questions

Why does XML mode catch errors that HTML mode misses?

XML has a strict well-formedness spec — the browser's XML parser rejects anything that breaks it. HTML parsing is deliberately forgiving (a core design goal, so the web doesn't break on small mistakes), so there's no equivalent hard error — this tool instead does a best-effort tag-balance check for HTML.

Does formatting change my content?

No — only whitespace and indentation change. Tags, attributes, text and comments are preserved exactly (attribute values are re-escaped for safety, which can only change quote characters, never the value itself).

Similar Tools