
Loading…
Developer tool
Free, no sign-up. Runs in your browser; nothing is uploaded. Buy the source code: $29 Regular / $69 Extended
Keys starting with this become attributes
XML to JSON only
Used when the JSON has no single root
The result appears here.
Need XML to JSON Converter built into your own product? We build it as a full app, API and admin included. Built in about a week, from $99. Send your requirements or SOW; you get a fixed quote and a delivery date.
The xml to json converter stays free to use online. If you want the code to run, edit and ship in your own project, get the full source from the DEV3 Marketplace. Instant download, 6 months of support.
Skip the build: ready-made apps with the code included. Buy once, own the source, and try each one live first.


Enterprise SaaS Starters
from $99
Live demo
Enterprise SaaS Starters
from $99
Live demo
Enterprise SaaS Starters
from $99
Live demo
Enterprise SaaS Starters
from $99
Live demo
Enterprise SaaS Starters
from $99
Live demo
Enterprise SaaS Starters
from $99
Live demo
Enterprise SaaS Starters
from $99
Live demo< is treated as XML and anything else as JSON. You can also force a direction.@ by default.#text.null.#comment and ?xml.By default every value is a string, which is lossless. Turn on Convert numbers and booleans if you want 24.90 to become a number; note that this drops the trailing zero.
A JSON object with exactly one key becomes the document root. Otherwise the content is wrapped in an element whose name you choose. Arrays repeat the element once per item, keys with the attribute prefix become attributes, and null becomes a self-closing element. Names must be valid XML names, so a key such as first name is rejected with a clear message.
Round trips are not always identical: element order between different names is not preserved when they are grouped into keys, and whitespace between tags is ignored. For exact formatting of XML itself, use the XML formatter first.
Documents with DOCTYPE entity declarations are rejected on purpose, to rule out entity expansion attacks.
As keys that start with a prefix, @ by default, so id="p1" becomes "@id": "p1". You can change the prefix or switch attributes off. When converting back, keys with that prefix become attributes again.
Two or more sibling elements with the same name become a JSON array. A single element stays a plain value, which is the usual limitation of XML to JSON mappings: a one-item list is indistinguishable from a single item.
When an element has attributes or child elements and also text, the text is stored under the key #text. An element with only text becomes a simple string.
Yes. Only the five predefined entities and numeric references are expanded, documents that declare entities are rejected, and nothing is fetched, so entity expansion and external entity attacks are not possible.
No. Parsing and conversion run locally, and each input is limited to 2 MB.