XML to JSON Converter

Paste XML and get JSON.

Free · Runs in your browser · Your text is never uploaded

JSON converted to XML tags

How XML maps to JSON

Attributes become keys starting with @, repeated sibling elements become arrays and text next to child elements goes in a #text key. Empty elements become null.

Values are strings

XML does not distinguish numbers or booleans, so every value comes through as a string. Convert types in your own code.

Your files stay on your device

Everything happens in your browser. The files are never uploaded, so confidential documents stay private and the tool also works on a slow connection once the page has loaded.

Mapping rules

XML attributes and text content have no direct JSON equivalent, so conventions are used: attributes are kept as properties and repeated elements become arrays. Depending on the converter, one element may become an object while two become an array, so check how your code handles both.

Need more options? Open the full JSON ⇄ XML Converter.

Related guides

Frequently asked questions

Why do I see an XML error?

The message names the problem, such as a closing tag that does not match, and the line and column.

Are XML comments kept?

No, they are ignored.