JSON Parser

JSON to XML and XML to JSON Converter

Convert JSON to XML or XML to JSON in your browser. Pick a direction, paste your data and get the result instantly, with a swap button to round-trip the output. Nothing is uploaded.

How to convert JSON to XML (and back)

  1. Choose JSON → XML or XML → JSON with the toggle.
  2. Paste your data. Invalid input shows an error instead of output.
  3. Copy the result, or use Swap to feed the output back in as the input.

JSON to XML example

JSON

{
  "user": {
    "id": 1,
    "name": "Alice",
    "tags": ["a", "b"],
    "address": { "city": "NYC" }
  },
  "active": true
}

XML

<?xml version="1.0" encoding="UTF-8"?>
<root>
  <user>
    <id>1</id>
    <name>Alice</name>
    <tags>a</tags>
    <tags>b</tags>
    <address>
      <city>NYC</city>
    </address>
  </user>
  <active>true</active>
</root>

JSON has one top-level value, but XML needs a single root element, so the result is wrapped in <root>. Object keys become elements, and each item of an array becomes a repeated element with the same name.

XML to JSON example

XML

<user id="1">
  <name>Alice</name>
  <tags>a</tags>
  <tags>b</tags>
</user>

JSON

{
  "user": {
    "name": "Alice",
    "tags": [
      "a",
      "b"
    ],
    "@_id": "1"
  }
}
  • Attributes are kept and prefixed with @_, so id="1" becomes "@_id".
  • Repeated elements with the same name become an array.
  • Attribute values are kept as text ("1", not 1), so convert types yourself if you need strict numbers.

JSON vs XML

JSON is shorter and maps directly to objects and arrays in most languages, which is why web APIs prefer it. XML adds attributes, namespaces and mixed content, and is still common in enterprise systems, SOAP services, RSS feeds and configuration. See JSON vs YAML vs XML: which format should you use for guidance.

Related tools

Convert to YAML or CSV, validate with the JSON Schema generator, or fix invalid JSON first with JSON Repair.

Handles JSON files up to 20MB smoothly