XML to JSON
Paste XML, get JSON. Attributes are surfaced with a configurable prefix (default @); mixed-content text uses #text. Reverse direction at JSON → XML.
Paste XML.
How to convert XML to JSON
- Paste in either panel.
- Configure under Options:
- Attribute prefix (default
@) — JSON keys starting with this become XML attributes. - Text content key (default
#text) — JSON key holding mixed-content text. - Array handling — Repeated element (default) or Single child.
- Pretty-print XML — on / off.
- Attribute prefix (default
- Output appears in the opposite panel. Copy or Download.
FAQ
Why are my single-element arrays decoded as objects?
XML doesn't distinguish "one element" from "an array containing one element". Pass a hint via your schema, or post-process with json-flatten.
What about CDATA blocks?
Treated as the text content of the surrounding element — same as plain text.
Will it work offline?
Yes.