XML to JSON Converter
{
"library": {
"book": [
{
"@id": "bk101",
"@lang": "en",
"title": "XML Developer's Guide",
"author": "Gambardella, Matthew"
},
{
"@id": "bk102",
"@lang": "en",
"title": "Midnight Rain",
"author": "Ralls, Kim"
}
]
}
}Turn XML into JSON
Paste any well-formed XML — a SOAP response, an RSS or Atom feed, or an old config file — and get pretty-printed JSON with 2-space indentation, ready for the JSON Formatter, JSON to TypeScript, or JSON to CSV tools. The document is wrapped in an object keyed by the root element. An element with only text becomes a string; an element with children becomes an object keyed by child tag name; repeated sibling tags collapse into an array; attributes appear as @-prefixed keys (e.g. @id); and any text sitting next to attributes or children is kept under a #text key. Entities like &, <, >, ", and ' are unescaped, and insignificant whitespace between elements is trimmed. Every value is emitted as a string, so the round-trip is intentionally lossy but predictable.