XML to JSON Converter
Paste XML on the left, get JSON on the right. Attributes become keys prefixed with @_, repeated elements become arrays, and the result is valid JSON ready for any modern API.
How to use this tool
Paste your XML into the input box on the left. Both single-rooted documents and fragments are accepted.
JSON appears on the right as you type. Malformed XML surfaces a parser error message.
Copy the resulting JSON for use in APIs, data pipelines, or storage.
XML attributes are emitted with an @_ prefix by convention (so <a id="1"/> becomes {"a": {"@_id": "1"}}). Text content sits under "#text". Repeated sibling elements are merged into arrays.
Useful when modernizing SOAP services, parsing RSS/Atom feeds, processing SVG, or extracting data from Office documents — all client-side, with no upload.
Frequently asked questions
How are XML attributes handled?
Attributes are converted to object keys with an @_ prefix. This keeps them distinct from child elements while staying valid JSON.
Does it support XML namespaces?
Yes. Namespace prefixes are preserved in the resulting JSON keys, e.g. <ns:foo/> becomes {"ns:foo": ""}. You can post-process to strip or rename prefixes as needed.
Are CDATA and comments supported?
CDATA sections are read as text content. Comments are ignored by default, which is the most predictable behavior for round-tripping.
Is my XML uploaded anywhere?
No. Parsing is 100% in-browser using fast-xml-parser. Nothing leaves your device.