XML to JSON Converter

Paste XML and get JSON instantly — attributes, nested elements and repeated tags are all handled. Flip the toggle to convert JSON back to XML. Runs in your browser, nothing uploaded.

XML input
JSON output

What does this tool do?

This free XML to JSON converter turns an XML document into clean JSON as you type, and converts JSON back to XML with the reverse toggle. It runs entirely in your browser — nothing you paste is uploaded — so it is safe for config files and API payloads, and it works offline once loaded.

How XML maps to JSON

XML and JSON do not have a one-to-one structure, so this tool uses the widely-adopted convention:

The reverse direction (JSON to XML) reads the same convention back: @ keys become attributes, #text becomes element text, and arrays become repeated tags.

How to use it

XML vs JSON

XML is verbose and document-oriented, with attributes, namespaces and a rich schema ecosystem — still common in enterprise systems, SOAP APIs, RSS/Atom feeds, and office file formats. JSON is lighter and maps directly onto the data structures of modern programming languages, which is why most web APIs moved to it. Converting XML to JSON is a frequent step when modernizing an integration or pulling a legacy feed into a JavaScript app.

Common uses

FAQ

How are XML attributes represented in JSON?

Each attribute becomes a key prefixed with @. For example <user id="7"> becomes { "user": { "@id": "7" } }.

What happens to repeated tags?

Repeated sibling elements with the same name are collected into a JSON array automatically.

Is my data uploaded?

No. Conversion runs entirely in your browser; nothing you paste leaves your device.

Why do I get a parse error?

XML must be well-formed: every tag closed, one root element, and attribute values quoted. The error message points to the problem.

More format converters