Developer tool

XML Formatter

Validate and indent XML while preserving element order and attributes.

Runs in your browser
XML Formatterworks locally
Result

How to use this XML formatter

  1. Paste the source text or code, then choose the conversion or formatting mode.
  2. Review the formatted output and any syntax message. Check syntax, escaping, and edge cases against the source before using the result in a live project.
  3. Check the output against the source, then copy or download the finished result.

About this XML formatter

XML Formatter helps you validate and indent XML while preserving element order and attributes. The input and result appear together for easy comparison.

You can also use it to check source text for structural or syntax problems.

Example

Paste a compact XML document to check that tags close correctly and view the same document with readable indentation.

Common uses

  • validate and indent XML while preserving element order and attributes
  • check source text for structural or syntax problems
  • prepare a clean version for testing or reuse