Convert XML to clean, structured JSON instantly.
Paste raw XML and get formatted, minified, or tree-viewable JSON in real time. Private, zero-upload, and runs entirely in your browser.
{
"?xml": {
"@_version": 1,
"@_encoding": "UTF-8"
},
"project": {
"metadata": {
"version": "2.4.0",
"author": "JSONGlow Engineering",
"license": "MIT",
"released": true
},
"features": {
"feature": [
{
"name": "XML to JSON Converter",
"category": "data-transformation",
"latencyMs": 1.2,
"description": "Fast, browser-based XML parsing with zero server upload.",
"@_id": "f-01",
"@_enabled": true
},
{
"name": "JSON Tree Viewer",
"category": "visualization",
"latencyMs": 0.8,
"description": "Collapsible hierarchical navigation for large objects.",
"@_id": "f-02",
"@_enabled": true
},
{
"name": "Cloud Sync",
"category": "storage",
"latencyMs": 0,
"description": "Privacy-first mode ensures no remote storage is used.",
"@_id": "f-03",
"@_enabled": false
}
]
},
"@_name": "JSONGlow",
"@_status": "active"
}
}# 44 lines · 1,113 chars
JSONGlow's XML to JSON converter is a free, client-side utility that transforms XML documents into structured, formatted JSON with full support for attributes, CDATA, and typed primitives.
Data Modernization
Transforming legacy XML into modern JSON structures.
XML and JSON are the two predominant data interchange formats across software engineering, but migrating between legacy SOAP/XML systems and modern REST/GraphQL APIs requires careful translation of attributes, namespaces, and node hierarchies.
Unlike JSON, XML documents contain both child elements and tag attributes (e.g., <book id="12">). JSONGlow gives you granular control over how attributes are represented in the resulting JSON, allowing you to choose between @_ prefixes, @ prefixes, unprefixed property merging, or complete attribute stripping. Once converted, you can beautify the output using our JSON Formatter or check syntax with the JSON Validator.
Repeated sibling tags are automatically grouped into clean JSON arrays, while numeric and boolean strings can be automatically cast into native JSON primitives. CDATA sections are preserved without corruption, making the tool ideal for feeds, SVG manipulation, and configuration migrations.
Because all parsing executes locally inside your web browser using optimized client-side parsers and Web APIs, confidential enterprise XML files and proprietary database exports remain completely secure. If you need the reverse transform, check out our JSON to XML Converter or convert configurations to YAML with YAML to JSON.
Workflow Guide
How to convert XML to JSON in 3 steps
Input XML document
Paste your SOAP payload, RSS feed, SVG XML, or configuration file into the left editor pane.
Configure prefix & types
Select how attributes should be prefixed (`@_`, `@`, none, or ignored) and toggle automatic numeric/boolean type casting.
Copy or download
Click 'Copy' to grab the formatted JSON, or click 'Download .json' to save the file locally.
Practical Demonstration
XML to JSON Parsing Example
See how XML attributes, repeated child tags, and typed text values map to clean JSON objects and arrays.
<?xml version="1.0" encoding="UTF-8"?>
<catalog id="lib-99">
<book id="bk101" available="true">
<title>Design Patterns</title>
<price>49.99</price>
</book>
<book id="bk102" available="false">
<title>Refactoring</title>
<price>54.95</price>
</book>
</catalog>{
"catalog": {
"@_id": "lib-99",
"book": [
{
"@_id": "bk101",
"@_available": true,
"title": "Design Patterns",
"price": 49.99
},
{
"@_id": "bk102",
"@_available": false,
"title": "Refactoring",
"price": 54.95
}
]
}
}XML Pitfalls & Edge Cases
Common XML syntax & conversion challenges
Unclosed or mismatched XML tags
Why it happens: XML is strictly hierarchical; forgetting a closing tag like `</book>` or mismatched case `<Title></title>` crashes standard XML parsers.
Unescaped XML entities (&, <, >)
Why it happens: Raw ampersands (`&`) or unescaped angle brackets inside XML text nodes violate XML specs (e.g. `AT&T` must be written as `AT&T`).
Attribute naming collisions with child elements
Why it happens: If an element has both an attribute `id="1"` and a child `<id>1</id>`, naive converters can overwrite one of the values.
Core Capabilities
Comprehensive XML to JSON processing
Configurable Attribute Prefixes
Choose between `@_`, `@`, none, or ignore mode to match your API naming conventions.
Automatic Array Grouping
Repeated sibling XML elements collapse seamlessly into typed JSON arrays.
Primitive Type Inference
Automatically casts numeric and boolean strings into native JSON numbers and booleans.
CDATA & Entity Preservation
Safely parses CDATA blocks and standard XML entities without corrupted characters.
Tree View & Full-Screen
Inspect large converted JSON structures with collapsible tree nodes in distraction-free mode.
100% Client-Side Privacy
No server uploads. Safe for confidential SOAP responses, RSS feeds, and enterprise XML.
Frequently Asked Questions
Common questions answered.
Need more help? Our tools execute entirely in your browser without transmitting any payload to remote servers.
How are XML attributes converted to JSON?+
Attributes are preserved as object properties prefixed with `@_` by default (e.g. `<book id="12">` becomes `{ "@_id": 12 }`). You can customize this to use `@`, no prefix, or ignore attributes completely via the toolbar selector.
How does the converter handle repeated XML child tags?+
When multiple sibling tags share the same name (e.g. `<item>1</item><item>2</item>`), the converter automatically bundles them into a clean JSON array `"item": [1, 2]`.
Are numbers and booleans converted from text to native JSON types?+
Yes. With 'Types: Auto' enabled, numeric and boolean strings are automatically parsed to native numbers and booleans. Switch to 'Types: String' if you prefer raw string preservation.
How are CDATA blocks handled during conversion?+
CDATA blocks (e.g., `<![CDATA[<html>...</html>]]>`) are cleanly extracted as plain string content without unescaping or corrupting the text.
Is my XML data uploaded to any server during conversion?+
No. The entire conversion process runs purely inside your browser using fast, client-side Web APIs. Nothing is transmitted over the network or stored on any remote server.
Explore More Tools & Guides
The JSONGlow developer kit.
YAML ↔ JSON
Bi-directional YAML 1.2 converter for K8s manifests, Docker Compose, and GitHub Actions.
JSON to CSV
Flatten complex nested structures, handle null primitives, and export cleanly to spreadsheet CSV.
JSON Formatter
Format, beautify, indent, sort keys alphabetically, and inspect nested JSON structures.