XML to JSON Converter — Free, No Upload
Convert an XML document to JSON. Attributes become @-prefixed properties; repeated elements become arrays. Runs entirely in your browser.
When you convert XML to JSON
XML and JSON solve the same problem — structured data exchange — with different syntax. Modern web APIs and frontend frameworks overwhelmingly prefer JSON; legacy systems, SOAP services and Office documents still use XML. Converting XML to JSON is the bridge that lets data flow between them.
Common scenarios: ingesting a SOAP API response into a Node.js script; loading an RSS feed into a React app; turning a sitemap.xml into JSON for analytics; converting Maven dependency listings for a build dashboard; consuming Spring Boot config XML in a JavaScript tool.
Conversion rules
XML and JSON aren't structurally identical, so there's no single "correct" conversion — this tool uses these conventions (similar to most XML-to-JSON tools):
- Element name becomes the JSON property name.
- Text content becomes the property value (a string).
- Repeated elements with the same name become a JSON array.
- Attributes become properties prefixed with
@— e.g.<a href="x">becomes{"@href": "x"}. - Mixed content (an element with both text and child elements) stores text as a
#textproperty. - Comments are dropped.
- CDATA is treated as ordinary text.
Tips
- Round-tripping XML through JSON and back rarely produces byte-identical output — XML has features (namespaces, processing instructions, mixed content) that don't fit JSON cleanly.
- For SOAP API conversion, you usually want the Body content only — strip the envelope first.
- Numbers and booleans stay as strings. JSON consumers typically apply type coercion in their parsing layer.
FAQs
Is anything uploaded?
No. Conversion runs in your browser using DOMParser.
Will namespaces be preserved?
Element names include the prefix as written; namespace declarations become @xmlns:… attributes.
What's the maximum input size?
Practical limit ~10 MB.