XML to JSON
Convert XML files to JSON format.
XML, XML, PLAIN · Max 5MB
Drop a file here, or browse
XML, XML, PLAIN
How do I use XML to JSON?
Upload your XML file or paste XML content
The tool parses and converts to JSON with attributes preserved
Download or copy the JSON output
What is XML to JSON?
Convert XML documents, SOAP API responses, RSS feeds, SVG data, or configuration files into clean JSON. Preserves attributes (prefixed with @_), nested elements, repeated elements (arrays), and text content. Useful when you're integrating with a legacy SOAP service from a modern JavaScript codebase, when you need to pipe RSS feed data into a JSON-based system, or when you're cleaning up XML configs for tools that prefer JSON. The parser uses fast-xml-parser and runs entirely in your browser — no upload required, even for multi-megabyte XML. Powered by JustUse.me — free, ad-free, and private. This tool runs entirely in your browser. Your files are never uploaded to any server.
Frequently asked questions about XML to JSON
How are XML attributes handled in the JSON output?
XML attributes are prefixed with @_ in the JSON to keep them distinct from child elements. For example, <div class="main" id="hero"><span>text</span></div> becomes {"div": {"@_class": "main", "@_id": "hero", "span": "text"}}. This convention is the de-facto standard set by fast-xml-parser, xml2js, and most other XML-to-JSON libraries — it lets you reliably round-trip back to XML if needed, and it avoids name collisions when an element has both an attribute and a child element with the same name. Text content inside an element with attributes is stored in a #text key. Once you know the convention, the JSON is straightforward to consume from any language.
Does it handle nested XML and repeated elements?
Yes. All nested elements are preserved at arbitrary depth — there's no recursion limit. Repeated sibling elements (like multiple <item> tags inside <items>) are automatically converted into a JSON array, which is what you almost always want for downstream JavaScript processing. Mixed content (text and elements interleaved) is preserved using the #text key. The only edge case where you'll need to think carefully is when an element appears once in some XML documents and multiple times in others — your downstream code should be defensive and handle both single-object and array shapes, since the parser doesn't force consistency across documents.
Can it convert SOAP responses or RSS feeds?
Yes, both work cleanly. SOAP responses with their nested <soap:Envelope>, <soap:Body>, and namespaced elements convert directly — namespace prefixes are preserved as part of the JSON keys (e.g., "soap:Body"), so you can navigate the structure exactly like you would in a SOAP client. RSS feeds with their <channel>, <item>, <pubDate>, and <description> elements also map cleanly, and repeated <item> entries become a JSON array automatically. For SVG, you'll get a JSON tree of the SVG element structure, which is useful if you're building a visual editor or analyzing SVG content programmatically.
Can it convert large XML files?
Yes, up to 5MB, processed entirely in your browser. The fast-xml-parser library is genuinely fast — it streams through the document once rather than building a DOM, so even 5MB of XML converts in well under a second on modern hardware. For files in the 50-100MB range you would want a Node.js script with sax-style streaming, but for everything API-related or config-related (which is almost always under a megabyte), this in-browser tool is more than fast enough and avoids any privacy concern about uploading proprietary API responses to a third party.
Related tools
Last updated: April 2026