XML to JSON
Convert XML to JSON, preserving attributes and repeated elements as arrays.
About the XML to JSON
The XML to JSON converter turns XML documents, feeds and SOAP responses into JSON you can use in JavaScript. Attributes are preserved and repeated elements become arrays.
Conversion happens in your browser, so your files and records stay private.
How to use the XML to JSON
- Paste XML or open a file.
- Choose the indentation.
- Copy or download the JSON.
Frequently asked questions
How are attributes represented?
Attributes become keys starting with @_ (for example @_id), next to the child elements, so no information is lost.
Why is a single child not an array?
Elements that appear once become objects; elements that repeat become arrays. Check the sample to see both.
Related tools
JSON to CSV
Convert JSON arrays to CSV with automatic column detection, nested object flattening and custom delimiters.
CSV to JSON
Convert CSV to a JSON array with header detection, type inference and delimiter auto-detection.
JSON to XML
Convert JSON to well-formed XML with a configurable root element and attribute support.
JSON to YAML
Convert JSON to clean, human-readable YAML.
YAML to JSON
Convert YAML documents to formatted JSON with syntax validation.
JSON to PHP Array
Convert JSON to a PHP array literal using short or long array syntax.