XML to JSON
Convert XML documents to JSON format
XML Input
JSON Output
Turn XML responses into modern JSON objects
When you have to integrate with a SOAP service, RSS feed, or legacy XML API, you don't want XML living in your codebase. Converting XML to JSON gives you a familiar object shape — attributes prefixed with @, elements as keys, and text content as values — that fits cleanly into JavaScript, TypeScript, Python, or any modern stack.
Use the converter when you need to
Process a SOAP response in modern code
Convert the XML envelope to JSON and work with attributes and elements as plain object properties.
Parse RSS, Atom, or sitemap feeds
Aggregators and crawlers often need feed data as JSON for downstream processing — convert once and pipe forward.
Inspect XML structure quickly
Converting to JSON makes it easy to drop the document into a JSON viewer or query with JSONPath.
How to convert XML to JSON quickly
- 1
Paste the XML document into the editor.
- 2
Click Convert to produce JSON where attributes use the @ prefix and elements become keys.
- 3
Copy the JSON output or download it for use in your code.
Keep going
Convert JSON back to XML
Round-trip the data when responding to a SOAP or B2B partner.
Format the JSON output
Beautify the converted JSON for easier inspection.
Validate the converted JSON
Make sure the output parses cleanly before passing it to your code.
Explore the converted data
Use tree view to verify how attributes and nested elements were mapped.
Common XML-to-JSON workflows
Wrap an XML API in a JSON adapter and gradually replace the legacy code without breaking consumers.
Convert each feed to JSON and merge them into a single uniform array.
Convert the document to JSON and walk it in a viewer instead of trying to read raw XML.
Related Tools
JSON to XML
Convert JSON to XML for legacy system integrations
JSON Formatter
Beautify JSON from APIs, AI tools, and logs with configurable indentation
JSON Validator
Validate API and AI-generated JSON with detailed error messages and line numbers
JSON Viewer
Explore JSON with interactive tree, table, and raw views
Frequently Asked Questions
Paste your XML document and click Convert. The tool parses all elements, attributes, and text content into a structured JSON object. Attributes are prefixed with @ to distinguish them from child elements.
XML attributes are converted to JSON properties with an @ prefix. For example, <book id="1"> becomes {"book":{"@id":"1"}}. This convention keeps attributes clearly separated from child elements.
The tool runs in your browser, so it handles files up to several megabytes comfortably. For very large XML files (100MB+), consider using a server-side tool or streaming parser.
Yes. CDATA content is extracted as plain text values in the JSON output, preserving the original content without the CDATA wrapper syntax.