Convert XML to JSON and JSON to XML
Map XML into JSON using local representation rules, or draft XML from JSON. The conversion helps compare simple structures without promising a lossless mapping of every feature in both formats.
- Runs in your browser
- Nothing is uploaded
- No signup; device limits apply
Loading the tool. If it does not appear, reload this page.
How to use this tool
Choose a direction and enter valid XML or JSON. Inspect how attributes, text and repeated elements are represented, and review namespace-heavy documents separately.
Results and examples
Repeated child elements can become an array in JSON. The reverse direction needs a suitable root name and may add a root element when the supplied JSON does not provide one.
Limitations
- Mixed-content ordering, namespaces and comments are not comprehensively preserved in a round trip.
- Validate generated element names and special characters with the final XML parser before use.
Fields
| Field | Guidance and constraints |
|---|---|
| Direction | Check the unit and format displayed beside this field. |
| Input | Check the unit and format displayed beside this field. |
| Result | Check the unit and format displayed beside this field. |
Data handling
Processing stays in the current browser tab; the site does not upload tool input for the calculation itself.
Sources
Frequently asked questions
What happens to repeated elements?
Repeated child elements can become an array in JSON. The reverse direction needs a suitable root name and may add a root element when the supplied JSON does not provide one.
Will a round trip reproduce the source?
Mixed-content ordering, namespaces and comments are not comprehensively preserved in a round trip. Validate generated element names and special characters with the final XML parser before use.