Free Online JSON to XML and XML to JSON Converter
Turn JSON into XML with a root element you name and a name for array items, or read XML back into JSON with attributes kept under a prefix and text under its own key. Repeated elements become arrays, illegal element names are reported, and it all runs in your browser.
Enjoying WizTools123? Help keep our server infrastructure 100% free and open for everyone.
How to Use JSON and XML Converter
Step by step, start to finish.
Whichever you have. Press Sample to load an example of the direction you are in. Nothing is uploaded.
JSON to XML, or XML to JSON. The options change, because each direction needs different questions answered.
Going to XML, set the root and the array item name. Coming back, set the attribute prefix and the text key.
Any key that had to be renamed to be legal XML is reported above. Then copy, download, or send the result back as input.
Key Features
What this tool does, and what it does not do.
JSON to XML and XML to JSON, each with its own options.
The root and the array item name are yours, not a hardcoded guess.
Written from simple values on the way out, kept under @ on the way in.
Keys that cannot be XML names are corrected and every change is listed.
A line and a column from the parser, for either format.
SOAP payloads hold real data. Parsing happens in your tab.
About JSON and XML Converter
XML and JSON are both here to stay, which means converting between them keeps coming up. Banking, government, healthcare, shipping and telecoms interfaces are largely XML, while anything written for the web in the last fifteen years speaks JSON. Sooner or later something you own has to talk to something on the other side.
This page converts either way in your browser. Going to XML you choose the root element name, the name given to array items and whether simple values are written as attributes or as child elements; escaping and name sanitising are handled, and any name that had to change is reported. Coming back, attributes are collected under a prefix you choose, text content goes under its own key, repeated siblings become an array, and you decide whether a single child should be an array too.
The interesting part of writing this was refusing to pretend the mapping is clean. XML carries attributes, namespaces, comments and meaningful ordering; JSON carries types, arrays and nulls. Neither can hold the other in full, so rather than quietly picking conventions the page puts the naming decisions in front of you and states plainly what is lost each way. A converter that hides that is the reason people find surprises in production.
Frequently Asked Questions
Common questions about this tool.
<line> element and a list containing one line look exactly the same in XML, and only the schema knows which was meant. By default a single child becomes a plain value; turn on the single child switch and every repeatable element becomes an array, which is usually what you want when the consumer expects a fixed shape.More Developer Tools
Other tools from the same hub, free and in your browser.
Feedback
No feedback on this tool yet. Yours would be the first.