Skip to content
POST /api/v1/xml-to-json

XML to JSON Converter

Paste XML content to convert it into a JSON object. Handles attributes (prefixed with @), nested elements, sibling arrays, CDATA sections, and empty elements. Works with RSS feeds, SOAP responses, and any XML data.

string required
advanced options
boolean
boolean

Include XML attributes prefixed with @

X-Sandbox-Remaining: - get an api key

returns

data.json
The converted JSON as a string, attributes prefixed with @.
data.root_element
Name of the XML root element.
data.element_count
Number of XML elements parsed.
response awaiting request sending
Fill in the fields and send a request. The response lands here.

Run it from your code

A temporary key takes one request and lasts seven days at 20 calls a day. Register and it becomes 75 a day, still free.

$ curl -sX POST "https://apixies.io/api/v1/xml-to-json" \
    -H "X-API-Key: $APIXIES_KEY" \
    -H "Content-Type: application/json" \
    -d '{"xml":"..."}' | jq '.data.json'

questions

How are XML attributes handled?

By default, XML attributes are included in the JSON output with an @ prefix. For example, <book id="1"> becomes {"@id": "1"}. You can disable this with the preserve_attributes option.

What happens with repeated sibling elements?

When multiple sibling elements share the same tag name, they're automatically grouped into a JSON array. For example, two <book> elements inside <catalog> become "book": [{...}, {...}].

Is this safe to use with untrusted XML?

Yes. External entity loading is disabled to prevent XXE (XML External Entity) attacks. The parser won't fetch remote resources or read local files referenced in the XML.

cookies

We use analytics cookies to see how the site gets used. Nothing loads until you accept. Privacy policy