Data Conversion Tools Runs in your browser Free · no account

XML to JSON Converter

The XML to JSON converter parses an XML document and produces an equivalent JSON structure, with attributes, text content and repeated elements represented consistently. Parsing happens in the browser with external entities disabled.

Options
XML document 0 characters
JSON to XML
JSON

Your result will appear here.

Not sure where to start? Use Load example.

Results update automatically and are calculated on your device. Nothing you type is sent to a server.

Runs in your browser. Processing happens entirely in your browser. Nothing you enter is sent to Delimiter.live.

How to use the XML to JSON Converter

  1. Paste the XML document you want to convert.
  2. Decide whether attributes should be included and whether text-only elements should collapse to plain strings.
  3. Copy or download the JSON.

Example

Input
<person id="1"><name>Ada</name></person>
Output
{
  "person": {
    "@id": "1",
    "name": "Ada"
  }
}

Common use cases

  • Reading a SOAP or legacy API response in a format your tooling understands.
  • Migrating XML configuration to a JSON-based system.
  • Inspecting an RSS or sitemap file as structured data.

Limitations and things to watch for

  • XML and JSON do not map one to one. An element that appears once becomes an object and the same element appearing twice becomes an array, so the shape of the output depends on the data rather than on a schema.
  • Comments, processing instructions and the DOCTYPE are discarded.
  • Mixed content — text and child elements in the same element — is represented with a #text key alongside the children.

Frequently asked questions

How are attributes represented?
Each attribute becomes a key prefixed with @, so <person id="1"> yields "@id": "1". This is the convention most XML-to-JSON mappings use and it keeps attributes distinguishable from child elements.
Why did a single element become an object but the same element elsewhere became an array?
JSON has no way to say "this may repeat". When an element appears once it becomes an object; when it appears more than once under the same parent it becomes an array. If your consumer needs a stable shape, normalise it after conversion.
Is this safe against XML external entity attacks?
Yes. The browser DOMParser is used, which does not resolve external entities or fetch DTDs, and no network request is made.

Share this tool