All free tools Runs in your browser

XML to JSON Converter

Turn an XML feed, SOAP reply or config file into clean JSON that scripts and APIs can read.

Convert XML to JSON

.xml
One XML document with a single root element. The XML declaration and namespaces are fine. Press Ctrl + Enter to convert again.
Read locally with FileReader and never uploaded. Maximum 15 MB.
Conversion options
Common choices: @, _ or -. Leave blank for none.

Your XML never leaves this device. It is parsed with your browser's built-in XML parser and converted locally. Nothing is uploaded to VPSLake or stored.

Convert XML in four steps

Use it for RSS feeds, sitemap files, SOAP replies, Windows and .NET config files, or exports from older software.

  1. 1

    Paste or open the XML

    Paste the document or open a file from your computer. It must have one root element that wraps everything else.

  2. 2

    Choose how attributes and values map

    Keep attributes with a prefix, switch on type detection for numbers and booleans, and force arrays if your code expects lists.

  3. 3

    Convert

    Press Convert to JSON. Broken XML is reported with the line and column the browser's parser stopped at.

  4. 4

    Use the JSON

    Copy it or download converted.json, then load it in your script, API client or jq.

How elements become JSON

The root element becomes the single top-level key. A child that appears once becomes an object property; children with the same name that repeat are collected into an array. An element that holds only text becomes a plain value.

  • Attributes become prefixed keys such as @id
  • Text next to child elements or attributes goes in #text
  • CDATA sections are kept as ordinary text
  • Comments and processing instructions are dropped

Limits worth knowing

XML and JSON do not map one to one. Element order between different names is not kept, and an element that appears once in one file but twice in another will flip between object and array. Tick Always use arrays when code depends on a fixed shape.

Type detection only converts plain integers and decimals of up to 15 digits, so long IDs, phone numbers and values with leading zeros stay as strings and are not rounded.

XML to JSON Converter FAQ

No. The browser's own DOMParser reads the XML and the conversion is plain JavaScript on this page. The text is never sent to VPSLake or any other service.
XML is strict: every tag must close, attribute values need quotes, there can be only one root element, and a bare & must be written as &. The message shows the line and column where the parser stopped and a copy of that line.
With Keep attributes on, each attribute becomes a key starting with the prefix you choose, so <ram unit="GB">8</ram> becomes {"@unit": "GB", "#text": 8}. Turn it off to ignore attributes completely.
The converter only creates an array when an element name repeats under the same parent. If your code always expects a list, tick Always use arrays.
Yes. Prefixed names such as soap:Body are kept as written, and xmlns declarations come through as attributes when attributes are kept.
Yes, use the JSON to XML converter with the same attribute prefix. Keys that start with the prefix become attributes and #text becomes the element text again.