Paste your XML or open an XML file
Choose the indent and whether numbers stay numbers
Copy the JSON or download it as a .json file
XML describes data with elements and attributes, and JSON with objects, arrays and values, so the converter maps one onto the other in a fixed way. Every element becomes a key with its name, and an attribute a key with @ before its name, such as @id. When an element appears several times, such as many book elements in a catalog, they become an array. An element that holds only text becomes that text, and text next to attributes or other elements is kept under #text. Paste XML or open an XML file, and the JSON appears as you type, indented with 2 or 4 spaces or a tab, or with “Minify” in one line.
With “Numbers and true/false as values, not text” ticked, 1937 and true become JSON numbers and booleans, while values such as 007 stay text, so no zero is lost; untick it to keep every value as text. Comments, the XML declaration and the doctype are skipped, CDATA sections are read as text, and entities and character codes are decoded. If the XML has an error, such as a closing tag that does not match, you see the line, the column and the reason, and “Show the error” selects the spot. With “From” and “To” you can also convert XML to CSV or JSON to XML, and nothing leaves your browser.
Hello. We tried very hard to create a convenient website that we use ourselves. If you liked any of our tools and editors, add it to your bookmarks, because it will be useful to you more than once. And don't forget to share on social media. We will be better for you.