Skip to content

JSON ↔ XML Converter

Convert JSON to XML or XML back to JSON, in either direction.

Runs in your browserNo account neededFree
Loading tool…

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

  1. Choose the direction.
  2. Paste your JSON or XML.
  3. 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