Skip to content
iyziTool

XML Formatter

Paste XML to indent it neatly or squash it to a single line. Malformed documents show the error and the line where parsing stopped.

Result
Paste XML to format or validate it.

About this tool

XML from APIs, SOAP responses, RSS feeds, Android layouts or configuration files often arrives on one line. Formatting restores the hierarchy so nested elements, attributes and CDATA sections are easy to follow. The validator checks well-formedness: matching tags, quoted attributes, a single root element and legal characters.

The formatter preserves element order, attributes, comments, processing instructions and CDATA. Choose two or four spaces or tabs. Minify mode removes all insignificant whitespace, which is what you want before embedding XML in a request body.

Frequently asked questions

What does well-formed mean?
The document follows XML syntax rules. It says nothing about matching a schema (XSD/DTD), which this tool does not check.
Are entity references kept?
Yes. Entities like & and numeric references are left untouched.
Can I convert the XML to JSON?
Use the XML to JSON converter for that.

Related tools