JSON to XML Converter

Free JSON to XML converter — and XML to JSON too. Convert between JSON and XML instantly in your browser, with attributes, arrays and nested data handled cleanly.

✓ Free ⚡ Instant 🔒 100% private
Input JSON 0 lines · 0 chars
Result XML

      

🔒 Conversion runs entirely in your browser — nothing is uploaded. Tip: press Ctrl+Enter to convert.

Advertisement

Free JSON to XML Converter (and XML to JSON)

This free online JSON to XML converter instantly turns JSON into clean, indented XML — and converts XML back to JSON too, with one click. Paste your data, choose a direction, and copy the result. It handles nested objects, arrays, attributes and text nodes, and runs 100% in your browser, so your data is never uploaded anywhere.

How to convert JSON to XML

  1. Choose a directionJSON → XML or XML → JSON.
  2. Paste your data on the left (or click Load sample to try it).
  3. Click Convert. The result appears on the right, syntax-highlighted.
  4. For JSON → XML, set the Root element name and toggle the XML declaration; for either direction, pick your indent.
  5. Use Swap to flip the result back into the input, then Copy or Download the file.

How JSON maps to XML

JSON and XML both describe structured data, but in different shapes. This converter uses a clear, predictable mapping: each JSON object key becomes an XML element, arrays repeat the element once per item, and primitive values become the element’s text. Keys that start with @ become XML attributes, and a special #text key becomes an element’s text content — the same structure produced when you convert XML back to JSON, so round-trips stay consistent.

JSON is compact and ideal for JavaScript and APIs, while XML is common in configuration files, RSS/Atom feeds, SOAP services, sitemaps and older enterprise systems. Converting between them lets you move data between modern apps and these XML-based tools without rewriting it by hand.

Frequently asked questions

Is this JSON to XML converter free and private?
Yes. It’s completely free with no sign-up, and both JSON → XML and XML → JSON conversions happen entirely in your browser. Your data is never uploaded to a server.
Can it convert XML back to JSON?
Yes. Switch the direction to XML → JSON and paste your XML. The tool reads elements, attributes (as @name keys), repeated tags (as arrays) and text content (as #text) and produces a matching JSON object.
How are XML attributes handled?
When converting XML to JSON, attributes are stored as keys prefixed with @ (for example @id). When converting JSON to XML, any key starting with @ is written back out as an attribute, and a #text key becomes the element’s text — so you can round-trip data cleanly.
What happens to JSON arrays?
An array repeats its parent element once for each item. For example {"skill":["JS","PHP"]} becomes <skill>JS</skill><skill>PHP</skill>. Converting that XML back to JSON restores the array.
Why do I get an “Invalid” error?
For JSON → XML the tool reports the exact line and column of any JSON syntax error. For XML → JSON it uses the browser’s XML parser, which rejects malformed XML such as unclosed or mismatched tags. Fix the reported issue and convert again.
Advertisement