Skip to content

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.

Required
Advanced options
Optional
Optional

Include XML attributes prefixed with @

Get an API key to automate this

Result


                    

Code snippets


                                                

                                                

                                                

                                            

What this tool checks

  • XML attributes preserved with @ prefix
  • Sibling elements auto-grouped as arrays
  • CDATA section text extraction
  • Empty elements converted to null
  • Namespace handling
  • XXE attack prevention

Automate this with the API

Run this tool programmatically from your code. Get a free temporary API key with 20 requests/day — or register for 75 requests/day.

curl https://apixies.io/api/v1/xml-to-json?xml=... \ -H "X-API-Key: YOUR_API_KEY"

Frequently asked 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.

We use cookies for analytics to understand how our site is used. Privacy Policy