Skip to content
DevKOM

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.

Mode
Indentation
Formatted XML

How to format XML

  1. Paste your XML into the input editor.
  2. Pick Format or Minify and choose the indentation.
  3. Check the status bar for well-formedness errors and their line and column.
  4. 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.

More in Code & Data.