XML to JSON
Convert XML to JSON instantly in your browser. Handles attributes, namespaces, and CDATA sections. Fast, private, and works offline.
What is XML to JSON conversion?
XML to JSON conversion is one of the most common data transformation tasks when integrating with legacy enterprise APIs, SOAP services, RSS feeds, or any system that predates the JSON era. Converting XML to JSON makes the data usable in modern JavaScript applications, NoSQL databases, and REST-based microservices.
How to convert XML to JSON
- Paste your XML into the input pane, or drop an
.xmlfile. - Toggle Parse attribute values to convert numeric/boolean attributes to proper JSON types.
- The JSON output appears instantly. Attributes are prefixed with
@_to distinguish them from child elements. - Need the reverse? Use our JSON to XML converter.
How are XML attributes handled?
XML attributes have no direct equivalent in JSON. This converter preserves them as keys prefixed with@_. For example, <user id="42">becomes {"user": {"@_id": 42}} when "parse attribute values" is enabled.
Privacy when processing XML data
XML from SOAP APIs, enterprise systems, and healthcare integrations often carries sensitive information including patient data, financial records, and authentication tokens. This converter usesfast-xml-parser running entirely in your browser — nothing is transmitted to any server.
Frequently Asked Questions
How are XML attributes handled?
Attributes are converted to JSON keys prefixed with "@" by default (e.g. @id, @class). You can toggle this behavior.
Does it handle XML namespaces?
Yes. Namespace prefixes are preserved in the JSON keys (e.g. ns:element becomes ns:element).