Free · Private · In-Browser

XML to JSON Converter — Turn XML Into JSON

Open the converter

This XML to JSON converter parses XML documents and emits pretty-printed JSON, fully in your browser. Useful when moving data out of legacy systems — SOAP responses, RSS feeds, sitemap files, configuration files — into a modern JSON-based workflow.

XML still shows up everywhere — RSS feeds, SOAP APIs, sitemap.xml files, old SAML responses, financial data formats, government data dumps, and most legacy enterprise APIs. JSON is what modern tools, JS code, and LLMs prefer. Converting between the two is something people have to do all the time, and writing the mapping by hand is error-prone.

The tool uses fast-xml-parser, a battle-tested XML parser. Attributes are prefixed with `@_` to distinguish them from child element text, repeated child elements collapse into JSON arrays, and CDATA sections are preserved as plain strings. Conversion is entirely local — useful when the XML contains internal API payloads or proprietary data.

Output is JSON with two-space indentation. Drop it into a code editor, post it to an API, paste into an LLM prompt, or feed it into a script.

Frequently asked questions

Is my XML uploaded?

No. Parsing runs in your browser via fast-xml-parser. The XML file stays on your device.

How are XML attributes represented in JSON?

Attributes are kept on the parent object with the prefix "@_". For example, <user id="42"> becomes {"@_id": 42}.

What happens with repeated XML elements?

Repeated child elements with the same tag name collapse into a JSON array under that key.

Are CDATA sections preserved?

Yes. CDATA contents are kept as plain strings in the JSON output.

What is the file size limit?

25MB per XML file. The JSON output is unconstrained.

Related tools

Files stay on your device. No login. Installs as a PWA on iPhone, Android, and desktop.
← Back to Free File Converter