XML formatter and validator
Make XML readable again. Paste or open an XML, SVG, RSS or configuration file to indent it neatly, or minify it to remove the whitespace between tags. Every document is first checked for well-formedness, with the exact line and column of problems such as a missing closing tag or an unquoted attribute. Comments, CDATA sections, processing instructions and the DOCTYPE are kept exactly as written, and attribute values are never changed.
Mode
Indentation
How to use the XML Formatter & Validator
- 1
Paste or open XML
Paste the XML or open a file such as .xml, .svg or .rss.
- 2
Choose format or minify
Pick an indentation for formatting, or minify and optionally remove comments.
- 3
Check the result
Well-formed XML is formatted at once; otherwise the error position is shown.
- 4
Copy or download
Copy the output or save it as a file.
What well-formed means
Well-formed XML has exactly one root element, every tag is closed in the right order, attribute values are quoted and special characters are escaped. A parser must reject a document that breaks these rules.
Formatting puts each element on its own line, indented by depth. Elements containing only text stay on one line so text content is not changed.
- <a><b>text</b></a> → <a>\n <b>text</b>\n</a>
When to use it
- Read API responses, SOAP messages or RSS feeds.
- Tidy SVG or Android layout files before editing.
- Find the tag that breaks an XML import.
Limits
- Checks well-formedness, not validity against a DTD or XML Schema.
- Files up to 10 MB.
Privacy
XML is processed only in your browser and never uploaded.
Frequently asked questions
What is the difference between well-formed and valid XML?
Well-formed means the syntax is correct. Valid means it also follows a schema or DTD. This tool checks well-formedness.
Will formatting change my data?
No. Only whitespace between tags changes. Text inside elements, attributes, comments and CDATA are kept.
Why is an element with text kept on one line?
Adding line breaks inside text would change the data, so elements that contain only text stay on a single line.
Can I format SVG files?
Yes. SVG is XML, so it can be formatted or minified the same way.
What does minify do?
It removes whitespace between tags to make the file smaller. You can also remove comments.
Is my file uploaded?
No. Everything happens in your browser.
Related tools
People also use
- JWT Generator & SignerCreate and sign JSON Web Tokens with HMAC, RSA or ECDSA keys, entirely in your browser.
- Base64 Encoder & DecoderEncode and decode Base64 and Base64url, text or files.
- URL Encoder & DecoderPercent-encode or decode URLs and see their query parameters.
- CSV to JSON ConverterConvert CSV ⇄ JSON with correct quoting, types and nested data.
Last updated November 20, 2026 · How we build and test our tools