JSON ↔ XML Converter
Convert JSON to XML or XML back to JSON, in either direction.
Processing: This tool runs entirely in your browser. Your input and any file you open stay on your device — nothing is uploaded to a server.
How to use the json ↔ xml converter
- Choose the direction.
- Paste your JSON or XML.
- Copy or download the converted result.
About this tool
The two formats describe similar data with different machinery, so conversion involves choices rather than a straight translation. XML has attributes; JSON has none, so attributes become keys prefixed with <code>@</code>, and mixed text content becomes <code>#text</code>. JSON has arrays; XML has none, so a list becomes a repeated element.
Those conventions are the ones most tools use, which means a round trip returns equivalent data rather than the identical document. Key names that are not valid XML element names are rewritten, since XML will not accept a name starting with a digit.
Parsing uses the browser's own XML parser, so malformed XML gives a real error message rather than silently producing wrong output.
Common uses
- Turning an XML API response into JSON for a script.
- Producing XML for a system that will not take JSON.
- Inspecting an unfamiliar XML document as JSON.
Frequently asked questions
- Why do some keys start with @?
- They were XML attributes. JSON has no equivalent, so the @ prefix keeps them distinguishable from child elements.
- Will a round trip give me my original file back?
- Equivalent data, not an identical document. Formatting, attribute ordering and some structural choices cannot survive both conversions.
Related tools
JSON Formatter
Format, validate and minify JSON with clear error messages that point at the exact position.
XML Formatter & Minifier
Indent XML to reveal its structure, or minify it back to a single line.
JSON ↔ YAML Converter
Convert JSON to YAML or YAML back to JSON, in either direction, with indent control.
CSV to JSON
Convert CSV into an array of JSON objects, with delimiter detection and optional typing.