← All tools
JSON Tools

JSON ↔ XML Converter

Convert JSON to XML or XML back to JSON, either direction, entirely in your browser.

Use the tool ↓
JSON input 0 chars
XML output 0 chars
Paste JSON or XML to convert.

About this tool

JSON and XML both describe structured, nested data, but they come from different eras of the same problem and it shows in how each one is shaped. XML grew out of document markup — it has real attributes on elements, mixed text and child content, namespaces, and a schema language (XSD/DTD) strict enough to validate an invoice format across two companies that have never spoken to each other. JSON came later, built specifically for passing data between a browser and a server with as little ceremony as possible: no closing tags, no attribute syntax, just objects, arrays, and a handful of primitive types. That difference in origin is why the conversion between them is never perfectly mechanical — XML can express things, like an attribute alongside text content on the same element, that JSON has no native concept for.

In practice, the conversion still comes up constantly. Plenty of enterprise systems, SOAP APIs, RSS/Atom feeds, and legacy config formats are XML at the core, while most modern frontends and REST APIs expect JSON. Converting XML to JSON is usually the first step in getting an old feed or a third-party XML API into a JavaScript app or a modern data pipeline. Converting JSON to XML shows up going the other way — generating a payload for a SOAP endpoint, or producing a config file for a system that only accepts XML.

This tool follows the common convention used by most JSON↔XML converters: object keys become element tags, array items repeat the same tag, and a key prefixed with @ becomes an XML attribute instead of a child element. Plain text content on an element with attributes is represented with a #text key. Going from XML to JSON, the same rules apply in reverse — attributes become @-prefixed keys, repeated sibling tags become an array, and element text becomes either the value directly or a #text key when the element also carries attributes or children. Everything runs locally in your browser; nothing you paste is transmitted anywhere.

How to use it

  1. 01

    Pick a direction

    JSON → XML or XML → JSON, depending on which format you're starting from.

  2. 02

    Paste your data

    The conversion updates live as you type or paste.

  3. 03

    Check the result

    If the input can't be parsed, the status bar explains what went wrong.

  4. 04

    Copy the output

    Copy the converted result directly into your codebase or config file.

Example

JSON
{
  "product": {
    "@id": "1042",
    "name": "Nesake",
    "tools": 15,
    "categories": {
      "category": ["JSON", "Security", "Text"]
    }
  }
}
XML
<product id="1042">
  <name>Nesake</name>
  <tools>15</tools>
  <categories>
    <category>JSON</category>
    <category>Security</category>
    <category>Text</category>
  </categories>
</product>

Common use cases

SOAP API payloads

Turn a JSON object into the XML body a SOAP or legacy web service expects.

RSS & Atom feeds

Convert a feed's XML into JSON to work with it in a modern JavaScript app.

Legacy config migration

Move an old XML config into JSON for a newer tool or framework.

Enterprise system integration

Bridge a JSON-based service and an XML-based system without writing a parser by hand.

Debugging XML structure

Convert to JSON to see nesting and attributes more clearly at a glance.

Learning XML syntax

See how a familiar JSON object maps onto elements, attributes, and text nodes.

Frequently asked questions

Does this tool support XML attributes?

Yes. Keys prefixed with @ in JSON become XML attributes, and existing XML attributes are read back into @-prefixed keys when converting from XML to JSON.

What happens to repeated XML tags?

Sibling elements that share the same tag name are converted into a JSON array, in the order they appear.

Does my data get uploaded anywhere?

No. The conversion runs entirely in your browser using JavaScript. Nothing you paste is sent to a server.

Can it handle mixed text and child elements?

An element that has both attributes or children and its own text content will represent that text under a #text key, since JSON has no native equivalent to XML's mixed content model.