JSON to XML

Turn any JSON document into indented XML. Runs entirely in your browser.

Runs in your browser Instant No signup, no tracking

About this tool

Convert a JSON document into an XML equivalent — useful for talking to SOAP endpoints, generating RSS feeds, or feeding legacy systems. Keys prefixed with `@_` become XML attributes. Arrays become repeated sibling elements. The output is indented with 2 spaces. Because JSON documents don't have a mandatory root, if your input has more than one top-level key it will be wrapped in a `<root>` element.

Example

Paste the input on the left and you will get output like this:

Sample JSON

{
  "catalog": {
    "book": [
      { "@_id": 1, "title": "The Pragmatic Programmer", "author": "Hunt" },
      { "@_id": 2, "title": "Refactoring", "author": "Fowler" }
    ]
  }
}

Resulting XML

<catalog>
  <book id="1">
    <title>The Pragmatic Programmer</title>
    <author>Hunt</author>
  </book>
  <book id="2">
    <title>Refactoring</title>
    <author>Fowler</author>
  </book>
</catalog>

How to use JSON to XML

  1. Paste or type your JSON into the left pane.
  2. The XML appears instantly in the right pane. Conversion runs in your browser — nothing is uploaded.
  3. Copy the result to your clipboard or download it as a file.

FAQ

How do I add XML attributes?
Prefix the JSON key with `@_`. `{ "user": { "@_id": 1 } }` becomes `<user id="1"/>`.
Is there an XML declaration in the output?
No. Add `<?xml version="1.0" encoding="UTF-8"?>` at the top of the output if the consuming system requires it.
How are arrays rendered?
Each array item becomes a sibling element with the same tag name as the parent key.