Online Tool Store Online Tool Store

XML to JSON Converter

Convert XML into JSON live as you type, using the browser's native XML parser — attributes, repeated elements, and nested structure all handled. Runs entirely in your browser.

🔒 This tool runs entirely in your browser. Your files are never uploaded to a server.

Nothing is uploaded — parsing runs entirely in your browser using the native DOMParser.

How it works

  1. Paste your XML on the left.
  2. See the equivalent JSON structure on the right, updated as you type.
  3. Copy the result, or fix any reported parse error using its exact message.

FAQ

How are XML attributes represented in the JSON?

Each attribute becomes a key prefixed with "@" (e.g. id="42" becomes "@id": "42"), a common convention that keeps attributes visually distinct from child elements in the output.

What happens when an element repeats, like multiple <tag> elements?

Repeated sibling elements with the same tag name are collected into a JSON array, in the order they appear — so three <tag> elements become an array of three values under "tag".

Does it handle XML namespaces?

Tag names are kept as-is (including any namespace prefix, e.g. "ns:item"), but namespace URIs themselves aren't resolved separately — for most conversion needs, keeping the prefixed tag name intact is sufficient.

Is my XML uploaded anywhere?

No — parsing uses the browser's built-in DOMParser, entirely locally. No external library is even loaded, and nothing is sent anywhere.

How we compare

Feature Online Tool Store Online XML/JSON converters Writing a script
No file upload — runs in your browser Many send the XML to a server
No setup or dependencies Requires a runtime + library
No ads Ad-supported

For a one-off conversion, this beats writing a script or trusting a random converter with an XML file that might contain sensitive data.

Explore related tools

Embed this tool

Paste this on your own site — it stays free, and every file still stays in your visitor's browser, not yours or ours.