How to use XML Formatter
- Paste one XML document or choose a UTF-8 XML file. A selected file replaces the pasted text.
- Choose Format, Minify or Validate only. Set indentation for Format.
- Review the updated result or parsing error, then copy or download the output. Mixed text content may remain together to preserve meaningful whitespace.
Example: XML Formatter
Format two catalog items with nested names and prices using two-space indentation.
Options
- Choose XML file
- XML Formatter: Optional UTF-8 text up to 1,000,000 bytes. A chosen file replaces pasted text.
- XML
- Well-formed XML only. HTML with unclosed tags is rejected.
- Action
- Format adds supported indentation. Minify removes eligible layout whitespace. Validate only checks well-formedness without applying a display format; none of the actions validates an XSD schema.
- Indentation
- Used by Format only.
Supported inputs and limits
- Checks well-formedness with the browser XML parser; it does not validate against a DTD or XSD schema.
- DTD declarations and custom entities are refused.
- Formatting preserves text-bearing mixed content rather than changing its whitespace.
- Input is capped at 2 million characters and 200,000 nodes.
- A selected UTF-8 file replaces pasted XML and is capped at 1,000,000 bytes.
More details
A collapsing XML tree or built-in XML-to-JSON conversion is not provided.
Where your input is processed
This tool does not upload your inputs. See the limits for anything saved on your device.
Questions about XML Formatter
Can this validate an XML schema?
No. It checks whether the XML is well-formed, but does not load or validate an XSD.
Why did a paragraph remain on one line?
Spaces around mixed text and child tags can be meaningful, so the formatter leaves that content together.
Can I paste HTML here?
Only if it is also well-formed XML. Ordinary HTML may have unclosed tags or other syntax this parser rejects.
Can I use external entities?
No. This page refuses DTD declarations and custom entity definitions.