XML Formatter
Format XML, SVG, RSS and other XML documents with consistent indentation, or minify them. The well-formedness check reports mismatched tags, unclosed elements and bad attributes with their position.
Formatted XML
How to format XML
- Paste your XML into the input editor.
- Pick Format or Minify and choose the indentation.
- Check the status bar for well-formedness errors and their line and column.
- Copy or download the result.
Frequently asked questions
Does it validate against a DTD or XSD?
No. It checks that the document is well-formed (tags nest and close correctly, attributes are quoted, one root element). Validation against a DTD or XML Schema is not performed.
Is whitespace inside text preserved?
Text content is trimmed for layout when formatting. Elements with xml:space="preserve", CDATA sections and comments are kept as written.
Related tools
- HTML FormatterBeautify or minify HTML markup.
- JSON FormatterPretty-print or minify JSON with clear error locations.
- YAML FormatterValidate YAML and convert between YAML and JSON.
More in Code & Data.