XML to JSON Converter Online Free
Upload an XML file or paste XML and download it as a formatted JSON object. Attributes are prefixed with @, repeated elements become arrays.
@attributeName keys. Repeated sibling elements are collapsed into a JSON array. Text-only elements become string values.
How to convert XML to JSON
Turn an XML document into JSON — for working with an older SOAP or enterprise feed in code that expects JSON, or simply to read a dense XML payload in a shape that is easier to scan.
- Paste your XML, or upload the file.
- Check it is well formed; an error reports where it breaks.
- Convert to JSON.
- Copy or download the result.
Accepts any well-formed XML document. Nothing is retained after the conversion, and uploads are deleted automatically within 24 hours.
Frequently asked questions
What happens to XML attributes?
Attributes are kept as properties, distinguished from child elements by a prefix, since JSON has no separate notion of an attribute. This is the convention most XML-to-JSON libraries follow.
Why did a repeated element become an array in one place but not another?
XML gives no way to declare that an element repeats, so a single occurrence looks like an object and two look like an array. If your consumer needs an array always, normalise it after converting.
Are namespaces preserved?
Namespace prefixes are retained in the property names, so you can tell elements from different schemas apart.
What about comments and processing instructions?
They are dropped. JSON has nowhere to put them.