XML to JSON Converter

Convert XML into JSON with explicit rules for attributes, repeated elements and mixed content.

Data & Formats
Preparing your workspace…
Input
Output
Your result will appear here.

How to use

  1. Paste the source, open a UTF-8 file or try the Sample.
  2. Choose the options and run the conversion or enable Auto run.
  3. Review the result, then copy a selection or download the complete text.

XML to JSON Converter

Paste a well-formed XML document. Compact mapping keeps the root name, groups attributes under @, uses #text for element text and collects repeated children in arrays. All text values remain strings.

Processing stays in your browser. DevToolsy does not receive the pasted data or selected file.

Input and processing

Choose Ordered content when text and elements are interleaved. It represents each element with name, attributes and an ordered children list; text children use a text property.

Worked example
Input
<team region="EU"><member>Ada</member><member>Lin</member></team>
Output
{
  "team": {
    "@": {
      "region": "EU"
    },
    "member": [
      "Ada",
      "Lin"
    ]
  }
}

This example uses the default settings.

Result and limitations

XML declarations, comments, processing instructions and CDATA boundaries are not retained. DTD and external entities are rejected. XML text and arbitrary JSON do not have a universal lossless mapping.

Using the output

Review the result, then copy a selection or download the complete text.

Processing limits

UTF-8 input up to 1 MiB; output up to 8 MiB. Processing stops after 30 seconds.

?

Frequently asked questions

How are XML attributes and repeated children mapped?

Paste a well-formed XML document. Compact mapping keeps the root name, groups attributes under @, uses #text for element text and collects repeated children in arrays. All text values remain strings.

How do I preserve mixed text and elements?

Choose Ordered content when text and elements are interleaved. It represents each element with name, attributes and an ordered children list; text children use a text property.

What XML information is omitted?

XML declarations, comments, processing instructions and CDATA boundaries are not retained. DTD and external entities are rejected. XML text and arbitrary JSON do not have a universal lossless mapping.

Is the input uploaded?

Processing stays in your browser. DevToolsy does not receive the pasted data or selected file.

Can I keep the result?

Review the result, then copy a selection or download the complete text.

Find your next tool

Language

Switch language? Your current work will be cleared. Copy or download it first.