XML to JSON
Converts XML to JSON: attributes become fields with "@", repeated tags become arrays, element text goes into "#text".
JSON
The result is longer than a million characters, so it is not shown in the field. Copy it or download it as a file.
Paste XML or open a file. Attributes become fields prefixed with "@", an element's text becomes a "#text" field, and repeated tags become an array. An empty element produces null.
All values are stored as strings. A phone number like 0079161234567 keeps its leading zeros, and a 20-digit account number keeps every digit: a number can only hold 15 significant digits, and everything after that would turn into zeros.
An element that mixes text with tags is converted into a list: first the text before the tag, then the tag itself, then the remaining text. The order is preserved, so converting back returns the same element.
Comments, processing instructions, and the declaration on the first line are markup, not data. The content of a CDATA section becomes plain text. The file is read as UTF-8, and if it is not in that encoding, as windows-1251.
Rate this tool
Help us get better
Tell us what was missing.
Other tools
JSON Formatter
Format and repair JSON in the browser, flagging duplicate keys and long numbers
Regex Tester
Regex testing with a plain-language breakdown and hang protection
JWT Decoder
JWT parsing with fields explained and signature verification
CSV to JSON
A table to JSON with honest types and a reverse check
JSON to CSV
JSON to a table for Excel, with verification and formula protection
SQL Formatter
A readable query layout, verified against the source, with risky spots flagged
XML Formatter
Readable XML, errors explained with a hint, verified against the source
XML Validator
Markup, XSD schema, sitemap, YML and RSS rules, with the path to each error