
XML ↔ JSON
Convert between XML and JSON. Attributes round-trip as "@_name" keys; values are kept as text, never reparsed as numbers or booleans. Runs on your device.
XML <-> JSON turns an XML document into JSON, carrying attributes as @_name keys and mixed element text as #text. Values stay plain text, never reparsed as a number or boolean. A single top-level key becomes the XML root when converting back; more than one gets bundled under rootName, default root. Malformed XML is refused, naming the line and column.
Questions
How are XML attributes represented in JSON?
As @_name keys alongside the element's own children.
How is element text represented?
As a #text key when an element mixes text with attributes or child elements.
Are values reparsed as numbers or booleans?
No, every value is kept as plain text, so a numeric-looking or 007-style value round-trips unchanged.
What controls the XML root when converting back?
A JSON object with exactly one top-level key uses that key as the root as-is; anything else is wrapped under rootName, default root.
What if my XML is invalid?
The tool refuses with the exact line and column XMLValidator reports.