XML to JSON Converter
Convert XML to JSON instantly in your browser. Paste any XML document and get clean, formatted JSON output. Free, private, no uploads.
XML Input
JSON Output
Also need JSON → XML? json-to-xml — convert in the other direction.
Need to convert audio or video? mp3-converters.com — free MP4/WAV/M4A to MP3, 100% in your browser.
How to Convert XML to JSON
- Paste your XML document into the left editor.
- The JSON output appears instantly in the right panel.
- Click Copy to copy to clipboard, or Download to save as
.json.
How XML Maps to JSON
- Elements become JSON keys. Child elements become nested objects.
- Repeated tags (e.g. multiple
<item>siblings) are merged into a JSON array automatically. - Text content is used as the value directly when an element has no children.
- Attributes are included as key-value pairs alongside child elements.
- Self-closing tags (e.g.
<br/>) become empty string values. - XML declaration (
<?xml ...?>) is stripped before parsing.
Common Use Cases
- API migration — convert legacy XML SOAP responses to JSON for use with modern REST APIs.
- Config conversion — transform XML config files (Maven, Ant, Spring) to JSON for newer tooling.
- Data import — prepare XML data exports (from databases, CMS, or ERP systems) for import into JSON-based systems.
- RSS / Atom feeds — parse feed XML into JSON for processing in JavaScript.
Frequently Asked Questions
Is this tool free?
Yes — completely free, no account required, no usage limits.
Is my XML data private?
All conversion happens locally in your browser. Nothing is ever sent to a server.
What happens with XML namespaces?
Namespace prefixes are preserved as part of the tag name (e.g. ns:element becomes the key "ns:element").
How are numbers and booleans handled?
Text content that looks like a number or boolean (true, false, null) is automatically coerced to the correct JSON type.