Skip to tools

Converters

XML to JSON

JSON is easier to work with in JavaScript, Python and most modern tooling. The XML to JSON converter parses your XML and turns elements into keys, repeated elements into arrays and attributes into prefixed keys, then pretty-prints the result.

It is the quickest way to explore an XML feed or SOAP response using JSON-friendly tools.

How to use the XML to JSON

  1. 1Use the XML to JSON right on this page, or open the full workspace for history, sharing and every other tool.
  2. 2Paste your input, upload a file, or drag and drop a file onto the input box (up to 25 MB).
  3. 3The result appears in the output panel automatically and updates when you change the input or an option.
  4. 4Use Copy Output or Download to save the result. Nothing is uploaded to a server.

Example

A small <user> document becomes a nested JSON object.

Input
<user><name>Ada</name><age>36</age></user>
Output
{
  "user": {
    "name": "Ada",
    "age": "36"
  }
}

When to use it

  • Exploring an RSS feed or sitemap as JSON
  • Converting a SOAP response so a JavaScript front end can use it
  • Migrating XML configuration into a JSON-based system

Tips and common mistakes

  • Attributes appear with an @_ prefix so they do not clash with child elements.
  • "Keep values as text" is on by default, so IDs like 007 or 12345678901234567890 and words like true stay exactly as written; switch it off to get real JSON numbers and booleans.
  • Open the result in the JSON Tree Viewer to browse large documents.

Frequently asked questions

What happens to repeated elements?

Elements that appear more than once under the same parent become a JSON array.

Is there a size limit?

Files up to 25 MB can be uploaded or dropped onto the input box.

TutorialXML explained: still relevant, still everywhere

Related tools

Ready to try it?

Free, no sign-up, and your data never leaves your browser.