How it works
- Paste XML or choose a .xml file.
- Press Convert after the document validates.
- Review the formatted JSON output.
- Copy or download the JSON file.
Practical example
<book id="7"><tag>web</tag><tag>tools</tag></book> keeps id under @attributes and represents the two tag nodes as an array.
Formula and explanation
XML and JSON have different data models. XML supports attributes, mixed text and repeated elements, so there is no single universal conversion. Cifrivo uses explicit @attributes and #text keys and groups repeated siblings into arrays.
An element containing only text becomes that text directly. This keeps ordinary documents concise while retaining structure when attributes or child elements appear.
Namespace prefixes remain in element names. The result is intended to be predictable and reversible with Cifrivo's JSON to XML conventions, though mixed-content order may need domain-specific handling. Conversion is local.