How to use the xml to json converter
- Paste your XML.
- Choose how attributes are written.
- Copy the JSON.
How XML maps to JSON
- Elements become keys; elements that repeat become arrays.
- Attributes become keys with a prefix, such as
@id. - Text in an element with attributes goes in
#text. - Numbers and true/false are converted to JSON numbers and booleans.
Examples
{"a": {"b": [1, 2]}}
{"user": {"@id": 7, "#text": "Ana"}}