XML to JSON

Convert XML into JSON.

Loading tool…
Try next →JSON FormatterFormat and validate JSON.

About XML to JSON

XML to JSON converts an XML document into equivalent JSON. It is useful when you have data or a config file in XML and you want it in JSON to work with in code, an API, or a tool that expects JSON.

The conversion happens entirely in your browser using its own built-in XML parser, so the XML you paste is processed on your own device and never uploaded to a server. It is free, needs no account or sign-up, has no usage limits, and there is nothing to install.

Frequently asked questions

Is it free, and is there a sign-up?
Yes, it is completely free with no account or sign-up. You can convert as many times as you like, with no usage limits.
Does my XML get uploaded?
No. The tool uses the browser's own XML parser to read your data, so everything is processed locally on your device. Your XML is never sent to any server.
How do I use it, and what format do I get back?
Paste your XML into the input box and the tool returns the equivalent JSON, which you can copy out. The result is standard JSON text you can save or paste into your own code.
Will the JSON match my XML exactly?
It mirrors the structure of your XML, with elements becoming keys and nested elements becoming nested objects. Because XML and JSON are different formats, things like attributes and repeated elements are represented in a consistent way that can read a little differently from the original.
Are there cases where the conversion is tricky?
XML has features JSON does not, such as attributes, mixed text-and-element content, and the order of repeated tags. These are handled as sensibly as possible, but very complex XML may need a manual check afterwards.