XML Viewer & Formatter
Paste XML to indent it neatly, minify it, or check that it is well-formed. Attributes, namespaces, CDATA and comments are kept intact.
Format & check XML
Indent, minify or browse XML as a tree.
Formatted XML
Format some XML to see it as a tree.
How to use it
- Paste XML into the Input panel, open an .xml file, or click Sample XML.
- Click Format XML to indent it, or Minify to remove the whitespace between tags.
- Switch the output to Tree to expand elements and search tag names, attributes and text.
- If the XML is not well-formed, the error shows the line and column reported by your browser's XML parser.
Good to know
- Well-formed, not schema-valid
- The checker confirms the XML is well-formed: every tag is closed, nested correctly and attributes are quoted. It does not validate against an XSD or DTD schema.
- What is preserved
- Element and attribute names (including namespace prefixes), xmlns declarations, CDATA sections, comments, processing instructions and the XML declaration all stay as they are. Only whitespace between tags changes.
- Text inside elements
- When formatting, leading and trailing spaces around text are trimmed so each element sits on its own line. If whitespace inside your text matters, use Minify instead, which leaves text untouched.
Frequently asked questions
What does "well-formed XML" mean?
It means the document follows XML's basic rules: one root element, every opening tag has a matching closing tag in the right order, attribute values are quoted, and special characters like & and < are escaped.
Can this validate my XML against an XSD schema?
No. It checks syntax only. Schema validation needs the schema file and a validating parser, which this tool does not include.
Why does my HTML fail as XML?
HTML allows things XML does not, such as unclosed <br> tags and entities like . Use the HTML Viewer for HTML.
Are namespaces supported?
Yes. Prefixed names like soap:Envelope and their xmlns declarations are kept exactly as written.