Encode text to Base64, with correct Unicode handling.
Open toolXML to JSON
Convert XML into JSON, with attributes, nesting, and repeated tags handled automatically.
JSON output will appear hereWhat is a xml to json?
This tool converts XML into JSON using a common, predictable convention: element attributes become keys prefixed with @, text content alongside attributes becomes a #text key, and repeated sibling elements automatically become a JSON array. It's built as a standalone parser rather than relying on a browser's native XML parser, so behavior stays consistent.
How to use this tool
- 1Paste your XML, or upload an .xml file.
- 2Toggle Infer types to convert numeric and boolean-looking text into real JSON types, or leave everything as strings.
- 3Click Convert - nested elements, attributes, and repeated tags are all handled automatically.
- 4Copy the JSON or download it as a .json file.
Common use cases
Frequently asked questions
How are XML attributes represented in the JSON?
Each attribute becomes a key prefixed with @ - for example <price currency="USD">29.99</price> becomes { "@currency": "USD", "#text": 29.99 }.
What happens with repeated elements, like multiple <item> tags?
They're automatically collected into a JSON array under that tag name, rather than overwriting each other.
Does it support CDATA sections and XML entities?
Yes - CDATA content is extracted as-is, and standard entities (&, <, >, ", ', and numeric entities) are decoded correctly.
Is my XML uploaded anywhere?
No - parsing happens entirely in your browser using a built-in parser, whether you paste the XML or upload a file.
{
"runs_in_browser": true,
"data_sent_to_server": false,
"signup_required": false,
"price": "free",
"category": "Encoding"
}