XML to JSON Converter
Paste XML, RSS, or a SOAP response and turn it into clean JSON instantly — free and entirely in your browser.
Parsing happens locally with your browser's own XML engine. Nothing you paste leaves this page.
How to Use the XML to JSON Converter
- Paste your XML into the input box, or press "Load example" to try a short RSS feed first.
- Pick the output format: 2 spaces for readable JSON, 4 spaces for wide indentation, or minified for a single compact line.
- Leave "Keep attributes" on to preserve XML attributes inside an @attributes object, and "Collapse text-only elements" on so simple tags become plain strings instead of wrapper objects.
- Click "Convert to JSON". Repeated sibling tags — such as every <item> in an RSS feed — are grouped into a JSON array automatically.
- Use "Copy result" to take the JSON with you, or "Clear" to wipe the page and start again.
What Is an XML to JSON Converter?
XML is still everywhere: RSS and Atom feeds, SOAP web services, sitemaps, Android layouts, Maven and Spring configuration, bank statements, and decades of enterprise APIs. Modern front-end and Node.js code, meanwhile, speaks JSON. An XML to JSON converter bridges the two by walking the XML tree and rewriting each element as a JSON key, so you can read a legacy payload with the same tools you already use for every other API response.
The hard part is not the tags — it is everything around them. Attributes have no natural JSON equivalent, repeated sibling tags need to become arrays, and whitespace between elements is meaningless indentation rather than data. This converter handles all three: attributes land in an @attributes object you can switch off, repeated tag names collapse into arrays automatically, whitespace-only text nodes are discarded, and an element containing nothing but text becomes a plain string rather than a noisy wrapper object.
Everything runs on the XML parser already built into your browser, so nothing is uploaded and even confidential payloads stay on your machine. When you need the opposite direction, use the JSON to XML converter. To tidy the output afterwards, run it through the JSON formatter or check it against the JSON validator.
Frequently Asked Questions (FAQ)
How do I convert XML to JSON online?
Paste your XML into the input box and click "Convert to JSON". The converter parses the document in your browser and prints formatted JSON you can copy immediately. No account, upload, or install is required.
What happens to XML attributes when converting to JSON?
With "Keep attributes" enabled, each element's attributes are grouped into an "@attributes" object alongside its child keys, which is the convention most XML-to-JSON libraries follow. Turn the checkbox off if you only care about element content and want a flatter result.
Why do some XML tags become a JSON array?
When an element has two or more children that share the same tag name, those children have to become an array — otherwise later keys would overwrite earlier ones. A single occurrence stays an object, which is why one-item feeds and multi-item feeds can produce slightly different shapes.
Can I convert an RSS or Atom feed to JSON?
Yes. Paste the raw feed XML and every <item> or <entry> element becomes an array of JSON objects with the title, link, and description fields ready to map over. The built-in example is a small RSS feed you can convert straight away.
Does this work for SOAP responses and sitemaps?
It does. Any well-formed XML document parses, including SOAP envelopes, sitemap.xml files, Maven POMs, and Android resource files. Namespace prefixes such as soap:Body are preserved verbatim as JSON keys.
Why do I get a not well-formed error?
XML is far stricter than HTML: every tag must be closed, attribute values must be quoted, and raw &, <, and > characters must be escaped as &, <, and >. The error message includes the parser's own explanation, which usually names the offending line.
Is there a size limit on the XML I can convert?
There is no fixed limit because conversion happens locally, but very large documents (several megabytes) can briefly freeze the tab while the browser parses them. For huge exports, convert a representative sample to confirm the shape, then script the full run.
Is my XML data private?
Yes. The document never leaves your device — there is no upload, no logging, and no server round trip. You can safely convert internal API responses, invoices, and other sensitive payloads.
Tips for Converting XML to JSON
- Tip 1: Convert a sample containing two or more repeated elements before you write the mapping code — that is the only way to see which keys really become arrays.
- Tip 2: Turn attributes off when the XML uses them purely for metadata such as version or xmlns; the JSON gets noticeably easier to read.
- Tip 3: Pick minified output when you are pasting the result into a fixture file, a request body, or an environment variable, and 2-space output when a human has to review it.
- Tip 4: Round-trip your data to sanity-check a mapping: convert here, then push the JSON back through the JSON to XML converter and compare the two documents with the text diff checker.