Developer / Data conversion
XML in. JSON out.
A predictable XML to JSON converter. Paste your XML, convert it locally, and copy or download the result.
Local conversion · Maximum 2 MiB · No input is uploaded
How to convert XML to JSON
- Paste well-formed XML, or try the example.
- Select Convert to JSON.
- Copy the JSON or download a .json file.
How the mapping works
The root is preserved. Attributes use an @ prefix. Repeated elements become arrays. Text with attributes is stored as #text. Numbers and booleans remain strings; empty elements become empty strings. CDATA becomes text and namespace prefixes are preserved. Formatting whitespace is trimmed. Mixed text and child elements are rejected so content order is not silently lost.
Limits and privacy
Up to 2 MiB of UTF-8 text, 100 levels deep. DTDs, custom entities and reserved JavaScript element names such as __proto__ are rejected. This is a data converter, not XML schema validation or a lossless XML round trip. Input is never sent to our servers.
Example
<item id="1">hello</item> → {"item":{"@id":"1","#text":"hello"}}