JSON ↔ XML Converter

Convert between XML and JSON in either direction. Paste data or drag & drop a file.

📁 Drag & drop an .xml file here, or click to browse
Input XML
Converting...
📁 Drag & drop a .json file here, or click to browse
Input JSON
Converting...

Examples

XML → JSON Input:

<users> <user id="1"> <name>Alice</name> <age>30</age> </user> <user id="2"> <name>Bob</name> <age>25</age> </user> </users>

JSON → XML Input:

{ "users": { "user": [ { "@id": "1", "name": "Alice" }, { "@id": "2", "name": "Bob" } ] } }

Have questions? Check our FAQ page.

About JSON and XML Conversion

XML (eXtensible Markup Language) and JSON are both popular data interchange formats, but they serve different ecosystems. XML is prevalent in enterprise systems, SOAP APIs, configuration files (like Maven pom.xml or Android layouts), and document formats. JSON dominates modern REST APIs, NoSQL databases, and web applications.

How XML to JSON Conversion Works

Converting XML to JSON requires mapping XML's features (elements, attributes, text content, repeated elements) to JSON equivalents. This tool uses the following conventions: XML attributes become JSON keys prefixed with @, text content uses the #text key, and repeated child elements automatically become JSON arrays.

Common Use Cases

Related Tools