Developer

XML Formatter & Validator

Paste XML to pretty-print it with clean indentation, minify it for production, or convert it to JSON. Syntax errors are caught and reported. Everything runs locally in your browser — sitemaps, RSS feeds, SOAP payloads and API responses never leave your device.

Examples

Input
<user id="1"><name>Ada</name></user>
Output
<user id="1">
  <name>Ada</name>
</user>

How it works

The XML is read by the browser’s own parser, so anything that is not well-formed is reported with the parser’s message instead of being formatted wrongly. Beautify indents two spaces per level, keeps an element that only holds text on one line, and writes empty elements in the self-closing form. Minify removes the whitespace between tags.

How XML to JSON maps a document
In the XMLIn the JSON
An attribute, id="1"A key with an @ prefix: "@id": "1"
The same child element repeatedAn array under that element’s name
Text next to attributes or child elementsA "#text" key
An element that holds only textA plain string

Every JSON value is a string, because XML carries no types. Comments and CDATA sections are kept when beautifying or minifying; in JSON output comments are dropped and CDATA is treated as text. The XML declaration is kept, but a DOCTYPE is not carried into the output.

How to use XML Formatter & Validator

Paste your XML
Drop in any XML — config files, sitemaps, RSS/Atom feeds, SOAP responses.
Pick an action
Beautify for readable output, Minify to compress, or convert to JSON.
Fix any errors
Invalid XML is flagged with the parser’s error message.
Copy the result
Copy or download the formatted output.

Why use this tool

Beautify with consistent 2-space indentation
Minify to a single line for production payloads
Convert XML to JSON (attributes preserved with an @ prefix)
Validates as it parses — everything stays on your device

Frequently asked questions

No. Parsing, formatting and conversion all happen in your browser using its native XML parser. Nothing is sent to a server.

Attributes become keys prefixed with @ (e.g. "@id"), and text content is stored under "#text" when an element also has attributes or children.

Yes — namespaced elements are preserved as-is, and CDATA sections are kept as text content.

Found a bug or have an idea?

ToolOrbit is actively developed — feedback directly shapes what gets built next.

Send feedback