Private XML conversion in your browser

XML to JSON Converter

Convert XML files into JSON format instantly. Pasted text and uploaded files stay in your browser.

XML TO JSONPaste XML, upload a .xml file, or try an XML URL
Local file conversion
XML Input
JSON Result
Your JSON output will appear here.
Output
Files stay in your browser No sign-up Free to use
01

How to Convert XML to JSON

Paste XML text or upload an XML file, then click Convert XML to JSON. The converter preserves nested elements, repeated tags, attributes, and text locally in your browser. If your XML mixes plain text with tags, turn on Keep text and tags in original order.

02

Convert XML in three steps

01

Paste or upload XML

Paste XML directly or upload a .xml file into the input editor.

02

Click Convert

The tool checks tags and transforms the XML document into structured JSON.

03

Copy or download JSON

Copy the result or download output.json for your project or API request.

03

XML to JSON Example

XML attributes appear as @ fields, repeated tags become JSON arrays, and text content is kept as #text when needed.

XML INPUT
<book id="42">
  <title>XML Fundamentals</title>
  <tag>XML</tag>
  <tag>JSON</tag>
</book>
JSON OUTPUT{ "book": { "title": "XML Fundamentals", "tag": ["XML", "JSON"], "@id": "42" } }
04

XML vs JSON

XMLJSON
Uses tags and attributesEasy to read as objects and fields
Supports mixed textOften smaller and easier to use in web apps
Common in documents and feedsCommon in websites, apps, and data tools
05

Frequently asked questions

What is an XML to JSON converter?

It transforms XML elements, attributes, text, and repeated tags into a JSON object that is easier to copy, read, and use in other tools. Need the opposite direction? Use JSON to XML.

How do I convert XML to JSON?

Paste XML into the input, or upload a .xml file, then click Convert XML to JSON. Afterward you can review differences with JSON Compare or tidy output in JSON Formatter.

Can XML be converted to JSON?

Yes. Both formats represent structured data, although XML tags and attributes need to be mapped to JSON keys.

How do I convert an XML file to JSON?

Upload a .xml document or paste its contents. The conversion runs locally and produces a downloadable JSON file.

Does this XML converter upload my files?

No. Pasted XML and uploaded files are parsed in your browser. Some XML URLs may not load if the website blocks browser access.

What do @id and #text mean in the output?

XML attributes use the @ prefix and text inside an element with attributes or children uses the #text key.

How do I keep mixed XML text in order?

Turn on Keep text and tags in original order when plain text and child tags are mixed together, such as Hello <b>world</b>.