Skip to content
M2TOOLKIT

XML to JSON Converter

Convert XML documents into readable JSON.

  • Free
  • No sign-up
  • Runs in your browser
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.

Last reviewed by the M2Toolkit team.

Other tools people use alongside the xml to json converter.