Convert XML to JSON and vice versa
Bidirectional XML and JSON conversion using fast-xml-parser
Processed Locally • Your Data Stays Private
Attribute prefix:
Text node:
414 characters
{
"?xml": {
"@_version": 1,
"@_encoding": "UTF-8"
},
"bookstore": {
"book": [
{
"title": {
"#text": "The Great Gatsby",
"@_lang": "en"
},
"author": "F. Scott Fitzgerald",
"year": 1925,
"price": 10.99,
"@_category": "fiction"
},
{
"title": {
"#text": "A Brief History of Time",
"@_lang": "en"
},
"author": "Stephen Hawking",
"year": 1988,
"price": 15.5,
"@_category": "non-fiction"
}
]
}
}Conversion Notes
- Attributes are prefixed with
@_by default - Mixed content text nodes use
#textas key - Repeated elements with same name are converted to arrays
- Empty elements become
nullin JSON