XML ↔ JSON
DataConvert XML to JSON and JSON back to XML with attribute handling
Paste an XML API response and get back equivalent JSON, with attributes distinguishable from element content via a configurable prefix like `@_` and text content captured under a `#text` key, or run it in reverse to turn a JSON object back into XML for a legacy SOAP integration. XML namespace prefixes are preserved as-is in the output, but the tool doesn't resolve them to their actual namespace URIs, so anything relying on true namespace-aware processing needs a dedicated XML library instead. Because XML and JSON aren't a perfect structural match (repeated elements, mixed content, attribute ordering), round-tripping XML to JSON and back isn't guaranteed to reproduce byte-identical output, even though the data itself is preserved. Conversion happens entirely in your browser.
How to use XML ↔ JSON
- 1.Paste an XML API response to convert it to JSON so you can more easily consume it in JavaScript or inspect nested structures.
- 2.Convert a JSON object back to XML when integrating with a legacy SOAP service or system that only accepts XML payloads.
- 3.Toggle attribute handling to control whether XML attributes become `@_` prefixed keys or get merged into the element's JSON object.
Frequently asked questions
Use via API, SDK, or MCP
Installnpm install @utilix-tech/sdkUsageimport { data } from '@utilix-tech/sdk'
const result = data.xmlToJson('<user><name>Alice</name><age>30</age></user>')
console.log(result) // { user: { name: 'Alice', age: '30' } }Runs locally · no API key · no rate limits · Node.js SDK docs →