XML to JSON
POST
/v1/convert/xml-to-json
curl -X POST "https://convert.toolkitapi.io/v1/convert/xml-to-json" \
-H "X-API-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"xml": "<user><name>Alice</name><age>30</age></user>"}'
# See curl example
// See curl example
Response
200 OK
{
"json": {
"user": {
"name": "Alice",
"age": "30"
}
},
"size": 47
}
How to Use
1
Send a POST request to /v1/convert/xml-to-json with an xml string.
About This Tool
Parse XML into a JSON object. Elements become object keys, text content becomes string values, and attributes are prefixed with '@'.
XXE (XML External Entity) processing is disabled for security. Namespaces are stripped by default for cleaner output.
Why Use This Tool
- API Migration — Convert SOAP/XML API responses to JSON for modern REST-based applications.
- Data Transformation — Parse XML feeds (RSS, Atom, config files) into JSON for easier processing.
Frequently Asked Questions
Are XML attributes preserved?
Yes — attributes are included as keys prefixed with '@' in the JSON output.
Is XXE processing enabled?
No — XXE is explicitly disabled. External entities and DTD processing are blocked for security.
Start using XML to JSON now
Get your free API key and make your first request in under a minute.