XML to JSON Converter

Bring legacy XML data into the JSON world

Free Online XML to JSON Converter

Plenty of feeds, SOAP services, and legacy systems still emit XML. This converter maps an XML document to JSON so modern code can work with it: elements become object keys, attributes are preserved rather than dropped, and text content becomes values.

  • Attributes preserved - kept under a dedicated @attributes key instead of being lost
  • Elements become keys - child elements map to object properties in document order
  • Text stays literal - values like 39.99 remain strings, exactly as written in the XML
  • Readable output - pretty-printed JSON you can inspect before wiring it into code
Open XML to JSON Converter

How to Convert XML to JSON

  1. Open the XML to JSON converter
  2. Paste the XML document - a single root element works best
  3. Click "Convert" and review the JSON structure
  4. Copy the output into your application or save it as a .json file

Example Conversion

Input (XML):

<book id="1">
  <title>Clean Code</title>
  <author>Robert C. Martin</author>
  <price>39.99</price>
</book>

Output (JSON):

{
  "@attributes": {
    "id": "1"
  },
  "title": "Clean Code",
  "author": "Robert C. Martin",
  "price": "39.99"
}

Note how the id attribute lands under @attributes and the price stays the string "39.99" - XML text is untyped, and the converter does not guess.

Common Use Cases

Modernizing Legacy APIs

Put a JSON face on data that arrives from SOAP or XML-only services.

Feed Processing

Convert RSS-style or product-feed XML into JSON your app can filter and render.

Config Migration

Move old XML configuration files into JSON-based systems.

Data Inspection

Read an unfamiliar XML payload as JSON to understand its shape quickly.

Related Tools