jsontoolskit.org
JSON and JSON Schema utilities, in the browser
Say hi →

XML to JSON

XML → JSON · attribute prefix · mixed content

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

  1. Paste in either panel.
  2. 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 handlingRepeated element (default) or Single child.
    • Pretty-print XML — on / off.
  3. 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.