Skip to main content
HandyWeb

JSON to XML Converter

Convert JSON to XML or XML to JSON online. Attributes use @ and repeated elements become arrays, so the result is predictable both ways.

Direction
0 characters0 bytes
0 characters0 bytes

Attributes use @ (as in "@id"), and text next to child elements uses "#text". Repeated elements become arrays.

How to Use It

  1. Choose the direction.
  2. Paste the JSON or the XML.
  3. Copy the output.

Questions and Answers

Where do XML attributes go?

Each attribute becomes a key with the @ prefix: <book id="1"> becomes {"book": {"@id": "1"}}.

Is my XML uploaded?

No. The XML is read with the browser's own parser, which does not load external entities.

Good to Know

Comments, processing instructions, and namespaces do not survive in JSON. One element alone does not become an array, so the JSON shape depends on the number of elements. Invalid XML names get _ in place of the bad characters.

Source code of this tool (opens in a new tab)Report a problem on GitHub (opens in a new tab)