How to use XML to JSON
- Paste your XML or upload a .xml file.
- Decide whether to convert numbers and booleans.
- Copy the JSON or switch to Tree view to explore it.
About XML to JSON
XML and JSON do not map one to one, so it helps to know the rules. Attributes become keys that start with @_, for example id="7" turns into "@_id": 7. When an element has both attributes and text, the text goes into a #text key. Elements that repeat become an array, and a tag that appears once stays a plain value.
By default numbers and booleans are detected, so <qty>2</qty> becomes the number 2. Values with leading zeros, such as postal codes or phone numbers, stay strings. Turn the option off if you want every value as text.