{ } 2DevKit
Tools / Data & JSON

XML ↔ JSON Converter

Convert XML to a practical JSON representation and convert JSON root objects back to XML, with explicit attribute and text mapping.

Maps XML attributes to @name, text to #text and repeated elements to arrays. This is a practical mapping, not a lossless XML round trip.

Processing occurs locally in your browser. DTD and ENTITY declarations are rejected for safety. Everything runs locally in your browser.

What is XML ↔ JSON Converter?

XML and JSON differ in how they represent attributes, text nodes, namespaces, ordering and repeated elements. This tool maps XML attributes to @name, text to #text and repeated child tags to arrays. It provides a convenient interchange format, not a lossless round trip: comments, namespaces, mixed-content ordering and specialized XML structures may not survive conversion.

How to use this tool

  1. Choose XML → JSON or JSON → XML and paste the source document.
  2. Convert and inspect attributes, repeated elements, and text values.
  3. Copy or download the result, checking structural fidelity for your target application.

Example

<person id="1"><name>Ada</name></person> → {"person":{"@id":"1","name":"Ada"}}

Related developer tools