Skip to content
M2TOOLKIT

Developer · free tool

XML to JSON Converter

Convert XML documents into readable JSON.

Use it as often as you like — it's free, with no sign-up and no limits.

  • Developer
  • Free
  • No sign-up
  • Runs in your browser
  • Updated
Attributes become @name keys; repeated elements become arrays.

Everything you type is processed in your browser. Nothing you enter is sent to our servers or stored by us.

How to use the XML to JSON Converter

  1. Paste your XML into the left box, or open a file.
  2. Adjust the options if you need to.
  3. Copy the JSON or download it as a file.

What does this tool do?

The XML is parsed by your browser's built-in XML parser, which also validates that it's well-formed. Attributes are kept as @name keys, text alongside child elements as #text, and repeated child elements become arrays.

Why use it?

  • Work with XML APIs and feeds in JavaScript.
  • Inspect RSS, sitemaps and SVG metadata.
  • Clear error messages for broken XML.

Example

<book id="1"><title>Dune</title></book> becomes {"book": {"@id": "1", "title": "Dune"}}

Privacy

Everything you type is processed in your browser. Nothing you enter is sent to our servers or stored by us. There's no account to create and nothing to install.

Frequently asked questions

How are XML attributes shown in the JSON?

Attributes become keys starting with @, so <item id="5"> turns into an “@id” key. Text that sits alongside child elements is kept under “#text”.

Why is an element sometimes an array and sometimes an object?

Repeated child elements become an array, but a single child stays an object. If your code expects an array, handle the single-item case — this is a common surprise with any XML-to-JSON conversion.

Last reviewed by the M2Toolkit team.

Other tools people use alongside the xml to json converter.