XML to JSON Converter

Paste XML and get JSON. Repeated elements become arrays automatically.

Runs on your device. Nothing you paste is uploaded.

Mapping rules

  • An element with only text becomes a string: <id>42</id> → "id": "42".
  • Attributes become keys prefixed with @; text next to attributes or child elements goes in #text.
  • Repeated sibling elements become an array. An element that appears once is not wrapped in an array, so check for both shapes in code — or use a format-specific converter such as UBL → JSON for a stable schema.
  • Namespace prefixes are dropped by default (cbc:ID → ID); xmlns declarations are omitted.

Is my data uploaded?

No. Conversion runs in your browser, so nothing you add is sent to gratistools.be. See the privacy page for details.