DataToolMage

Format

XML to JSON

Paste XML and get JSON. Attributes are prefixed with @. Mixed text uses #text. External entities are not processed.

Input is processed in your browser. DataToolMage does not upload it, store it, or send it to analytics.

Paste structured data. Work stays in this browser.

How it works

A local XML parser maps elements, attributes, and text. Values stay strings so XML numbers are not coerced.

Input and output

Input is XML text. Output is JSON. HTML and binary XML are out of scope.

Common uses

Attribute

<item id="1">tea</item> becomes {"item":{"@id":"1","#text":"tea"}}.

Repeating tags

Sibling <item> elements become a JSON array.

How to use this tool

  1. Paste well-formed XML.
  2. Read the mapping notes if attributes or mixed content appear.
  3. Copy the JSON.

Limitations

  • Namespaces are kept as prefix:local strings, not expanded.
  • Comments and processing instructions are dropped.
  • Pathological nesting is rejected.

Questions

How are attributes represented?
An attribute named id becomes @id. This is explicit so attributes are not merged into child elements.
Are DTDs supported?
No. DOCTYPE and ENTITY declarations are rejected so entity expansion cannot run.

Related tools

XML to JSON Converter — Browser Local