XML to JSON Converter
Convert XML to JSON in your browser — paste or upload .xml, copy or download .json.
Last updated:
Tool
Valid JSON
Indent
Valid XML
No JSON yet
Your files never leave your device - processing happens in your browser.
Related tools: XML Formatter · JSON Formatter · YAML to JSON Converter
An XML to JSON converter is a tool that turns XML markup into JSON — the format most APIs and JavaScript code work with — keeping the same data in a structure a script can read directly. FreeToolsKit's converter runs entirely in your browser: paste XML or upload a .xml file and the JSON appears live, with 2-space or 4-space indentation. Your XML is parsed in your tab and never sent to a server.
How do you convert XML to JSON?
- Paste your XML into the XML box — or press Sample to load a bookstore catalogue example, or Upload .xml to load a file.
- Choose 2 spaces or 4 spaces for the JSON indent; the JSON updates live as you type.
- If the XML is invalid, read the error message — it names the line and column of the problem.
- Press Copy JSON to take the result, Download .json to save it as a file, or Reset to return to the sample.
What is the XML to JSON Converter used for?
- Turning an XML API response into JSON so it can be pasted into JavaScript or a JSON tool.
- Converting an RSS feed or sitemap into JSON for a script that only reads JSON.
- Moving config or catalogue data out of XML and into a JSON-based workflow.
- Checking how an XML document maps to JSON before writing a parser for it.
- Converting an exported spreadsheet saved as XML into JSON for a web app.
Frequently asked questions
Is the XML to JSON converter free?
Yes. The tool is completely free with no sign-up and no usage cap. Convert as much XML as you like, as often as you like.
Is my XML uploaded anywhere?
No. Conversion uses the browser's built-in XML parser inside your tab. Configs and feeds containing tokens or personal data stay on your device — nothing is uploaded or logged.
How are attributes and repeated elements converted?
Attributes become keys prefixed with @, so <book id="bk101"> gives "@id": "bk101". Repeated sibling elements with the same tag become a JSON array, while a tag that appears once stays a single value. An element with only text becomes a plain string, and text beside attributes or child elements lands under the "#text" key.
Are numbers in my XML converted to JSON numbers?
No. All values stay strings, so "44.95", "007" and "true" keep their exact text instead of being guessed as a number or boolean. If you need typed values, edit the JSON after converting.
What happens to comments, the XML declaration and CDATA?
Comments, processing instructions and the XML declaration are dropped — they carry no data. Text inside CDATA sections is kept as the element's text. An empty element such as <tag></tag> becomes an empty string.
What are the limits?
XML is limited to 100,000 characters — longer input shows an error and the output stays empty until it is shortened. With an empty box the tool shows “No XML yet”. The XML must have a single root element, as the XML rules require. You can also upload a .xml file instead of pasting.
Related tools
- XML FormatterFormat, validate and minify XML — 2, 4 or tab indent, with line-and-column errors.
- JSON FormatterValidate, pretty-print and minify JSON with precise error pinpointing.
- YAML to JSON ConverterConvert YAML to JSON in your browser — paste or upload .yaml, copy or download.
- JSON to YAML ConverterConvert JSON to YAML — paste or upload .json, pick an indent, copy or download .yaml.
- CSV to JSON ConverterConvert CSV to a JSON array — paste or upload a .csv, pick a delimiter, copy or download.
- JSON to XML ConverterConvert JSON to XML in your browser — paste or upload .json, copy or download .xml.
Last updated:
- Free forever
- Files stay on your device
- No sign-up