How to use it
- Paste your XML into the input box, upload a .xml file, or drop a file onto the box.
- The JSON appears as you type. Change the indentation if you need to.
- Copy the result or download it as a .json file.
Good to know
- Attributes become keys that start with @, and text next to child tags becomes #text. A tag that appears once becomes a single value; a tag that repeats becomes a list.
About the formats
XML
XML wraps data in named tags, with optional attributes. It is still common in SOAP web services, RSS feeds, Office files and enterprise systems.
JSON
JSON (JavaScript Object Notation) stores data as nested objects and arrays. It is the standard format for web APIs and the config files of most JavaScript projects.
Questions
- Is my data uploaded anywhere?
- No. The conversion runs in your browser with JavaScript. Your data never leaves your device, and the tool keeps working if you lose your connection after the page has loaded.
- Why is a single element not a list?
- XML has no separate list type, so the converter can only tell an element is a list when it repeats. If you always need a list, wrap single values in a list after converting.
- Can I convert JSON back to XML?
- Yes. Use the JSON to XML converter, or press the swap button above the editor.