XML Formatter
- Files never leave your device
- Runs in your browser
- Free, no sign-up, no watermark
How to use XML Formatter
Pretty-print, minify, or check XML and convert it to JSON in your browser. Text, CDATA, comments, entities, and attribute order are kept exactly as written; only the whitespace between elements changes. Errors point to the line and column.
- 1
Paste XML into the input box, drop a file such as .xml, .svg, .rss, or .plist, or click Open file.
- 2
Pick an Output: Format, Minify, or JSON.
- 3
For Format, choose the Indent and how Attributes wrap: One line, Wrap long tags, or One per line.
- 4
Optional: turn on Self-close empty elements or Remove comments, then copy the result or click Download.
Frequently asked questions
Are my XML files uploaded?
No. The browser's own XML parser checks the document and the formatting runs locally, so nothing is sent to a server.
Does it validate against an XSD or DTD schema?
No. It checks that the XML is well-formed, meaning tags, quotes, and entities are correct. Schema validation is not part of this tool.
Will formatting change my content?
Only whitespace between elements changes. Text, CDATA sections, comments, entities, and attribute order stay as written, unless you turn on Remove comments.
How is XML turned into JSON?
Each element becomes an object, attributes become keys starting with @, text goes under #text, and repeated child tags become arrays.
Can I format SVG or RSS files?
Yes. Any well-formed XML works, including SVG, RSS, Atom, plist, KML, GPX, XLIFF, and .csproj files.