XML to JSON Converter
Open or paste XML and it opens as JSON you can browse, search and download; nothing is uploaded.
Processed on your device. Nothing is uploadedHow to check
You can also paste JSON with Ctrl+V (⌘+V on a Mac).
Your file is opened in this browser tab only: it is never uploaded or stored anywhere, and it is gone when you close the tab.
- JSONView and edit.xml
Paste text instead
Pasted text stays in this tab and is never sent anywhere.
Turn an XML file, such as a sitemap, an RSS feed, a SOAP response or an export from an older system, into JSON you can work with. Open, drop or paste it and your browser's own XML parser reads it; the result opens in the JSON viewer as a tree and as text. Attributes become keys starting with @, element text goes under #text, repeated child elements become arrays, and an element that holds only text becomes a plain string. If the XML is malformed, the parser's message tells you the line to fix.
Why use XML to JSON
Private
Your XML is read by your own browser and never sent to a server, so nobody else sees it.
Clear mapping
@ for attributes, #text for text and arrays for repeated elements, the same rule everywhere in the file.
Works offline
After you have used it once, it keeps working without an internet connection.
How it works: convert XML to JSON
Open or paste your XML
Choose an .xml file, drop it on the page, paste the text into the box, or try a sample.
It opens as JSON
The XML is parsed by the browser and shown in the JSON viewer. Malformed XML shows the parser's error with its line.
Browse and download
Expand the tree, search it, then download a .json file with the XML file's name.
How XML becomes JSON
- Attributes: <book id="7"> gives {"book": {"@id": "7"}}.
- Text next to attributes or child elements is stored under "#text".
- Repeated child elements with the same name become an array; a single child stays an object.
- An element with only text, such as <title>Hello</title>, becomes the string "Hello".
- Namespace prefixes stay in the names, such as "soap:Body" or "@xmlns:xsi".
- Input from an .xml file, a drop, the paste box or a sample.
XML to JSON: what it can't do
- No DTD or XSD validation: the file is checked for being well-formed, not against a schema.
- Comments and processing instructions are dropped.
- Files up to 10 MB; larger ones are refused before they are read.
- All values come out as strings; "42" in XML stays "42", because XML text has no types.
XML to JSON: questions and answers
- Is my file uploaded?
- No. Your XML is parsed by your browser's own XML parser, on your device. Pasted text stays in this tab and is never sent anywhere.
- Why do some keys start with @?
- Those were attributes in the XML. The @ keeps them apart from child elements with the same name, so <item id="1"><id>9</id></item> gives both "@id" and "id".
- Why is one element an array and another an object?
- A child element that appears more than once under its parent becomes an array; one that appears once stays a single value. If a list sometimes has one item, its JSON shape changes with it.
- My XML will not open. What is wrong?
- It is not well-formed: a tag is not closed, an & is not escaped, or there are two top elements. The page shows the parser's message with the line number, so you can fix it in the file and open it again.
- Is the XML checked against my XSD schema?
- No. Only well-formedness is checked; DTD and XSD validation are not done. Use a schema validator if the structure has to match a contract.
- Can I convert JSON back to XML?
- Yes, on the JSON to XML page. The two pages follow different rules, so a round trip may not give the same file.
- How do I convert XML to JSON?
- Convert XML to JSON by turning elements into keys, attributes into keys that start with @ and repeated elements into arrays. In OpenAnyDoc, open, drop or paste the XML and the JSON opens in the JSON viewer as a tree and as text, ready to download; the XML is read in your browser and never uploaded.
Why it's private: your files never leave your browser
Most online viewers upload your file to a server, so a copy of it leaves your device. OpenAnyDoc works the other way round: your browser reads the file and draws it on your screen. Nothing is uploaded, there is no account, and the file is gone from memory when you close the tab, so there is nothing for us to store, see or lose.
How we tell you about new features
Announcements are based on the release date shown to everyone, and nothing is stored on your device or sent anywhere.