XML to JSON
Convert XML document trees to logical, nested JSON objects recursively. Paste XML, preview the JSON tree, and copy it out.
Loading tool controlsβ¦
Verify it yourself: press F12, open the Network tab, and use this tool β your files are never uploaded.
XML to JSON at a glance
- Price
- Free
- Account
- Not required
- File uploads
- None β your files are never uploaded
- Category
- File Conversion Tools
Who uses File Conversion Tools?
Anyone converting files between formats β images, data, encodings and colour values.
How to Use XML to JSON
Follow these simple steps to get instant results in your browser.
Paste XML Data
Input your XML document or RSS/Atom feed into the editor.
Convert with Fixed Mapping
The mapping is fixed: attributes become @name keys, repeated tags become arrays, and mixed text lands under #text. Click 'Convert to JSON' to run it.
Copy JSON Code
Review the converted JSON and copy or download it instantly.
What is XML to JSON & How Does It Work?
The XML to JSON Converter transforms Extensible Markup Language (XML) documents, feeds, and SOAP payloads into clean, parseable JSON objects.
The parser handles XML attributes, nested node hierarchies, CDATA blocks, and repeated sibling elements (automatically converting repeated tags into JSON arrays). Namespace prefixes stay part of the key β <soap:Envelope> becomes "soap:Envelope" β and every value comes out as text, so <age>36</age> becomes "age": "36", not the number 36.
Conversions execute in local browser memory using fast DOMParser interfaces, keeping proprietary XML data and SOAP requests private.
Key Features & Capabilities
Automatic Array Detection
Converts repeated XML tags into clean JSON arrays seamlessly.
Attribute Handling
Cleanly parses XML element attributes without losing structural context.
CDATA Preservation
Safely preserves unescaped text content enclosed in CDATA blocks.
In-Browser Processing
Processes documents locally with zero cloud API latency.
Pro Tips
- β’Bookmark this tool for instant one-click access anytime.
- β’Drag and drop files directly onto the input surface for fastest handling.
- β’All processing happens in your browser session for maximum speed and data safety.
π― Common Use Cases
XML to JSON Conversion
Element names become JSON keys and element text becomes the value. Repeated sibling elements become JSON arrays, attributes are kept as properties, and CDATA content is preserved as text.
Worked Example
- 1Input XML: <user><name>Ada</name><age>36</age></user>
- 2Element names become keys; text becomes values β and every value stays a string.
- 3Output JSON: {"user": {"name": "Ada", "age": "36"}
Sources & Further Reading
- XML β Wikipedia
- Extensible Markup Language (XML) β W3C
Frequently Asked Questions about XML to JSON
Frequently asked questions
More File Conversion Tools
Complementary utilities for your workflow
XML to JSON
Convert XML data structures to JSON formats.