XML Formatter
About this tool
Format XML with consistent indentation or compress it into a single line. Syntax errors are shown so that missing closing tags and other invalid markup can be corrected.
How to use
- Format XML with adjustable indentation
- Compress XML into a single line
- Report syntax errors
- Preserve the order of attributes where possible
- Copy or download the result
- Paste XML: Input raw XML from logs, APIs, or legacy systems.
- Format or minify: Choose beautify or compact output.
- Validate: Run validate to catch syntax issues early.
Examples
- Make an XML configuration file easier to read
- Inspect a SOAP message
- Format an RSS document
- Compare two XML exports
Limitations
- Schema/DTD validation beyond well-formedness is not performed
- Huge XML files may be slow to pretty-print
- The entered data is processed directly in your browser and is not sent to a server.
FAQ
- Does it validate against XSD?
- No. Only well-formed XML parsing is checked, not external schemas.
- Will formatting change CDATA sections?
- CDATA content is preserved; surrounding whitespace may normalize on minify.
- Can I minify SVG?
- Yes. Minify removes extra whitespace; test SVG rendering after compression.