XML to JSON Converter

Convert XML into clean, readable JSON in your browser — attributes, arrays and minified output included.

Paste XML above to convert it to JSON.

No uploads. Your files stay on your device.

Free forever, no sign-up, no cookies. Buy me a coffee

How it works

Paste XML on the left and the JSON appears on the right instantly — no Convert button needed. Each XML element becomes a JSON key, repeated sibling elements are collapsed into an array, attributes are kept with a configurable prefix (@id by default, or _, $ or no prefix at all), and mixed content is stored under #text. Turn on “Convert numbers & booleans” to get real JSON numbers and true/false instead of quoted strings, or leave it off for a lossless string-only conversion. Choose 2 spaces, 4 spaces, tabs or minified output, then copy it or download a .json file.

Parsing uses the browser's built-in DOMParser, so the whole conversion runs locally in your own tab: your XML is never uploaded to a server, which matters for API payloads, SOAP responses, invoices and config files that contain private data. Malformed XML is reported with the parser's own message so you can spot the unclosed tag.

Frequently asked questions

How do I convert XML to JSON online?

Paste your XML into the left box and the JSON appears in the right box instantly — there is no Convert button to press. Pick 2 spaces, 4 spaces, tabs or minified output, then use Copy JSON or Download .json to save the result.

Is my XML uploaded to a server?

No. The conversion uses your browser's built-in DOMParser and runs entirely inside the page, so nothing is sent anywhere. That makes it safe for API payloads, SOAP responses, invoices and config files that contain private data, and it keeps working offline once the page has loaded.

How are XML attributes and repeated elements handled in the JSON?

Attributes become keys with a prefix you choose — @id by default, or _, $ or no prefix — and can be dropped entirely with the Include attributes checkbox. Repeated sibling elements with the same name are collapsed into a JSON array, and text mixed with child elements is stored under a #text key. Enable Convert numbers & booleans to output real JSON numbers and true/false instead of quoted strings.

Report a bug