en

XML to JSON

Convert an XML file to JSON locally - with elements and attributes, no upload, right in your browser.

Running locally on your device ...

Running locally on your device ...

0%

Is my file uploaded?

No. Everything runs in your browser - your file never leaves your device. How this is verifiable

No upload100% local
Your content stays with youno third-party access
Hosted in GermanyGlobal Content Delivery
Independently auditedTLS A+ · HTTP headers A+

XML is a widespread, hierarchical data format - typical for RSS feeds, SOAP APIs, Office documents, configs and data exchange between systems. For processing in modern programs and APIs, JSON is handier though. This tool translates the tree structure of XML into an equivalent JSON object.

This tool parses your XML entirely locally in your browser (fast-xml-parser, pure JavaScript). Nested elements become nested objects and attributes are kept with the "@_" prefix, so no information is lost. Invalid XML is rejected with a clear error. Nothing is uploaded.

You will meet this when evaluating a news feed, a sitemap, a bank-statement interface or an old data-export spec that still thinks in angle brackets. When reading the result, note one quirk: if a child element occurs only once, a single object arises, whereas on repetition a list does. Accounting for that in the consuming code avoids surprising edge cases when the count varies.

Specifications

Specifications
Input formatsXML
Output formatJSON
Batch processingNo
ProcessingLocally in your browser (JavaScript)
File uploadNone

In 3 steps

  1. Drop or pick your XML file.
  2. The tool converts locally and indents the JSON automatically.
  3. Download the JSON file.

Limitations: The XML must be well-formed (otherwise a clear error). Attributes get the "@_" prefix. Number- and boolean-looking text is automatically recognised as real JSON numbers/booleans; a date stays text, since XML has no date format of its own. Comments and processing instructions are skipped. Mixed content (text alongside child elements) cannot always map unambiguously. Namespaces stay as a prefix in the key.

FAQ

Is my file uploaded?

No. The conversion runs entirely locally in the browser - nothing is sent.

Are attributes kept?

Yes. Attributes appear in the JSON with the "@_" prefix before the name.

What happens with invalid XML?

You get a clear error message with the cause - no crash.

Can I get the JSON compact instead of indented?

The output here is always neatly indented. For a compact (minified) version, pass the result through our Format JSON tool afterwards with the Compact option.

Related tools

JSON to YAML · YAML to JSON · JSON to XML · XML to YAML · TOML to JSON · GeoJSON to KML