Convert XML to JSON or JSON to XML instantly in your browser, using your browser's own XML parser.
Updated
/ 5 - Be the first to rate this tool Thanks for rating!
Verification failed - please try again.
Quick check
Please verify you're not a robot to submit your rating.
Give feedback
Tell us what you think about Convert between XML and JSON online.
- Runs entirely in your browser — your data is never sent to a server
- Uses your browser's own XML parser for accurate conversion
- Free, no account required
How it works
-
1
Choose XML to JSON or JSON to XML.
-
2
Paste your XML or JSON.
-
3
Press the direction button.
-
4
Copy the converted result.
About the XML ↔ JSON
Older APIs, RSS feeds and enterprise systems still speak XML, while modern code expects JSON. This converter parses XML with the browser's built-in parser and maps it to JSON using a common convention: attributes become keys starting with @, text next to attributes becomes #text, and repeated elements become arrays. JSON in the same shape can be converted back to XML.
What you can do
- Convert XML to indented JSON and JSON back to XML.
- Keep attributes as @name keys and mixed text as #text.
- Group repeated child elements, such as several item tags, into arrays.
- Report invalid XML instead of producing partial output.
- Escape &, <, >, quotes and apostrophes when writing XML.
When it works best
- Reading an RSS or Atom feed in a script that expects JSON.
- Inspecting a SOAP or legacy API response in a friendlier format.
- Producing a small XML payload from JSON for a system that only accepts XML.
Things to know
- Parsing happens locally in your browser.
- All values become strings, so numbers and booleans are not typed. A single child stays an object while two or more become an array, which can change shape between documents.
- JSON to XML needs exactly one root key and outputs one line; run it through the XML Formatter to indent it.
- Comments and processing instructions are dropped, and namespace declarations are treated like ordinary @ attributes.
Frequently asked questions
As keys starting with @, with text beside them stored as #text.
Two or more repeated children become an array; a single child stays an object.
The JSON needs exactly one root key.
No, comments and processing instructions are dropped.