Skip to main content
SiteIndex

Developer

XML Formatter Documentation

Use the free XML Formatter →

Pretty-print and validate XML with readable indentation, cleanup, and error feedback.

What does it do?

Pretty-print and validate XML with readable indentation, cleanup, and error feedback.

How does it work?

The browser XML parser validates the document before two-space indentation is added to element-only content. Mixed text and CDATA are not re-indented, and xml:space preserve is respected. Declarations, comments, and processing instructions are retained. DOCTYPE is rejected; limits are 500,000 characters and 100 formatted element levels.

When to use it
  • Inspect a nested XML API fixture with readable element-only indentation.
  • Validate matching XML tags while preserving CDATA and mixed content.
Inputs and outputs
Input
Text, files, or values entered in the browser, depending on the tool.
Output
A result shown in the browser that can be reviewed or copied where supported.
Limitations
  • DOCTYPE and external entities are unsupported; this is not DTD or XSD validation.
  • Mixed-content descendants are kept unchanged. Browser serialization can normalize quoting and empty-element syntax.
Privacy and data handling

Inputs for this browser-side tool are processed locally and are not sent to SiteIndex. Normal page analytics may still be collected as described in the Privacy Policy. Read the Privacy Policy.

How to use it

  1. Paste one well-formed XML document with a single root element.
  2. Select Format XML; fix any parser error before copying.
  3. Review two-space indentation; inline mixed-text content remains unchanged.

Related tools