Skip to content

JSON to XML Converter

Paste a JSON object to convert it into well-formed XML. Supports custom root elements, attribute conversion (keys starting with @), array wrapping, and special character escaping. Works with any valid JSON object.

Required
Advanced options
Optional

Name of the XML root element

Optional
Optional

Include <?xml version="1.0"?> header

Get an API key to automate this

Result


                    

Code snippets


                                                

                                                

                                                

                                            

What this tool checks

  • Custom root element name
  • Keys with @ prefix become XML attributes
  • Arrays wrapped in singularized parent elements
  • Special characters properly escaped
  • Optional XML declaration header
  • Pretty-printed or compact output

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/json-to-xml?json=... \ -H "X-API-Key: YOUR_API_KEY"

Frequently asked questions

How are JSON arrays converted to XML?
Each array item is wrapped in an element named after the parent key (singularized). For example, "books": [{...}, {...}] becomes <book>...</book><book>...</book>.
Can I control the root element name?
Yes. If your JSON has a single top-level key, that key is used as the root element automatically. Otherwise, use the root_element parameter to specify a custom name.
How do I add XML attributes?
Prefix JSON keys with @ to convert them to XML attributes. For example, {"@id": "1", "name": "test"} becomes <root id="1"><name>test</name></root>.

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