XML to JSON
Convert an XML file into JSON. Since XML has no native number/boolean types, values come back as text.
Free, with no account needed. It runs in your browser, so your file never leaves your device.
Select XML file
or drop it here · up to 25 MB
About XML to JSON
XML to JSON converts an XML file into JSON. Elements become keys, and an element's attributes become keys that start with @.
Last reviewed
How to use it
- Select an .xml file.
- Press Convert to JSON.
- Download the .json file.
When to use it
- Using data from an XML feed or export in a JavaScript or Python project.
- Reading an XML file more easily by viewing it as JSON.
- Moving data from older software into a modern app.
Good to know
- Attributes are kept as keys with a leading @, for example "@id".
- XML that declares a DOCTYPE or entities is refused. This blocks a known attack in which a crafted file tries to read files or use up memory.
- If the XML is not well-formed, the message says what is wrong.
Tips for a better result
- Attributes appear as keys starting with @, so plan for them in code that reads the result.
- A single child element and repeated child elements can come out in different shapes. Check how your code handles both.
- Remove DOCTYPE declarations from files you trust if the conversion is refused.
Questions about XML to JSON
- Why was my XML refused?
- It uses a DOCTYPE or entity definitions. Those are not supported because they can be abused to read files or exhaust memory. Remove them from the file and try again.
- Where do the XML attributes go?
- Into the JSON as keys that start with @, next to the element's other content.
- How much does XML to JSON cost?
- XML to JSON is free, and you don't need an account. It runs inside your browser, so it costs us nothing to run and there are no credits to spend.
- Is my file kept after I use XML to JSON?
- Your file never leaves your device. XML to JSON works inside your browser, so nothing is uploaded and there is nothing for us to keep.
- Do I need an account to use XML to JSON?
- No. XML to JSON works without an account or sign-up. Open the page, choose your file and download the result.
- Does XML to JSON work on a phone?
- Yes. XML to JSON runs in the browser on phones, tablets and computers, with nothing to install. A very large file can be slow on an older phone, because your own device does the work.
- Is there a file size limit for XML to JSON?
- We set no upload limit, because nothing is uploaded: the limit is your device's memory. If your browser can't process a file, the page offers to process it on our servers instead. That uses credits and accepts files up to 25 MB.