XML to JSON Converter
Convert XML to JSON with attributes and repeated elements, directly in your browser.
Your XML is processed in your browser without uploading it to a server.
Frequently asked questions
How are attributes and repeated tags converted?
Attributes get an @ prefix. Repeated sibling tags become arrays. The root name is retained. For example, <item id="001">A</item> becomes {"item":{"@id":"001","#text":"A"}}.
Are numbers and whitespace preserved?
Values stay strings to preserve leading zeros. Surrounding text whitespace is trimmed; comments and processing instructions are ignored. Do not use this output to reconstruct identical XML.
Does this converter support namespaces, CDATA and DTDs?
Namespace prefixes and xmlns attributes are kept as names and attributes. CDATA becomes text. Mixed text uses #text without preserving exact text and element order. DTDs and declared entities are rejected.