JSON to XML Converter

Convert JSON to pretty XML and XML back to JSON in your browser. Arrays become repeated elements and the whole document stays on your device.

The JSON to XML Converter runs entirely in your browser. The JSON and XML you paste are converted on your device and never leave it or get uploaded to ArrayKit.

Open the XML Formatter

About JSON to XML Converter

The JSON to XML Converter turns a JSON document into clean, indented XML and parses XML straight back into JSON. Pick any root element name, and arrays collapse into repeated child elements sharing the parent key as their tag. Object keys prefixed with @ become element attributes, and a #text key supplies inline text, so you can model attribute-rich XML without leaving JSON. Switch direction to paste XML and get pretty-printed JSON, with repeated sibling tags folded into arrays and attributes surfaced as @-prefixed keys. It is handy when you wire a JSON API into a SOAP or legacy XML endpoint, build an RSS or sitemap payload, or inspect a config file. Everything runs on your device — the data you paste never leaves your browser.

Features

How to use the JSON to XML Converter

  1. Keep the JSON → XML tab selected and paste or load JSON
  2. Set a root element name, or leave it as root
  3. Copy the generated XML or download it as a .xml file
  4. Switch to XML → JSON and paste XML to get pretty JSON back

Example

Input

{ "user": { "@id": 1, "name": "Ada" } }

Output

<root>
  <user id="1">
    <name>Ada</name>
  </user>
</root>

The @id key becomes an attribute; name becomes a child element.

Common errors & troubleshooting

Frequently asked questions

How does this converter turn a JSON array into XML?
Each array item is emitted as its own element that reuses the array's key as the tag name. So { "item": [1, 2] } becomes <item>1</item><item>2</item> rather than a single element containing a list.
Can I add XML attributes from JSON?
Yes. Any object key prefixed with @ is written as an attribute on the enclosing element, and a #text key sets that element's inline text. So { "a": { "@href": "/x", "#text": "link" } } becomes <a href="/x">link</a>.
How do I change the wrapping root element name?
In the JSON → XML direction there is a Root element field. Type the name you want, such as response or catalog, and the whole document is wrapped in that tag instead of the default root.
What happens to attributes when I convert XML back to JSON?
Attributes are read into @-prefixed keys and repeated sibling elements are folded into an array under their shared tag name, so the structure round-trips cleanly between XML and JSON.
Are numbers and booleans preserved when parsing XML?
Text that looks like a number, true, false, or null is coerced to the matching JSON type. Values with leading zeros, like a 01234 zip code, are kept as strings so identifiers are not mangled.
Is my JSON or XML sent to a server?
No. The JSON to XML Converter runs entirely in your browser. The JSON and XML you paste stay on your device and are never uploaded to ArrayKit.

Related tools

All ArrayKit tools