Home / Tools / XML to JSON

XML to JSON Converter: Attributes, Arrays and Numbers

Convert XML to JSON in your browser, with attributes, repeated elements as arrays, and optional number and true/false conversion.

Paste XML and get JSON. Attributes become keys with a prefix, elements that repeat become arrays, and text next to attributes goes into a #text key. It works for RSS feeds, sitemaps, SOAP answers and config files.

    What it does

    Example

    Before

    <book id="1"><title>Dune</title></book>

    After

    {
      "book": {
        "@id": "1",
        "title": "Dune"
      }
    }

    Frequently asked questions

    Why is one item an object but two items an array?
    A converter can only know an element repeats when it sees it twice. If you need an array every time, wrap single values in an array in your code.
    What happens to CDATA and comments?
    CDATA is read as normal text. Comments and processing instructions are dropped.
    Are namespaces handled?
    Element names keep their prefix, such as dc:title, so they stay unique. The xmlns attributes are kept as attributes.
    Is my XML uploaded?
    No. The browser reads it with its built-in XML parser.

    Runs in your browser. Nothing you type is sent to this site. Updated 2026-10-12.

    More tools

    Code formatters

    CSS beautifier CSS minifier HTML beautifier HTML minifier JavaScript beautifier JavaScript minifier JSON formatter YAML formatter XML formatter SQL formatter Markdown preview

    Converters

    Base64 encoder and decoder URL encoder and decoder Unix timestamp converter CSV to JSON JSON to CSV HTML entity encoder and decoder Number base converter Time zone converter JSON to TypeScript HTML to Markdown Date difference calculator

    Text tools

    Regex tester Remove duplicate lines Lorem ipsum generator Word counter Case converter Text diff checker

    Color and images

    Color converter Contrast checker Image to Base64 Image resizer

    Network

    Subnet calculator Download time calculator Common ports list CIDR to IP range IPv6 address expander and compressor MAC address formatter curl command builder

    Server and files

    Cron expression explainer chmod calculator HTTP status codes

    Encoding and security

    Password generator UUID generator Hash generator JWT decoder QR code generator Password strength checker Wi-Fi QR code generator