---
title: "XML to JSON Converter Online: Free, No Upload"
description: "Free XML to JSON converter: paste XML or open a file up to 5 MB. Attributes become @name, repeated tags become arrays. Runs in your browser, nothing uploaded."
canonical: "https://browser-use.com/tools/xml-to-json"
last_updated: "2026-11-09"
---

# XML to JSON Converter Online: Free, No Upload

## XML to JSON Converter

Convert XML to JSON in your browser. Attributes, namespaces and mixed text are kept. Copy or download the JSON.

## How it works

### Paste XML

Paste XML, open a file up to 5 MB, or drop one on the box. It is read in this tab and never uploaded.

### Pick the options

List tags that should always be arrays. Turn on number conversion if you want 42 instead of "42".

### Copy or download

Copy the JSON or download it as a .json file.

### How is XML mapped to JSON?

Attributes become "@name" and text becomes "#text". XML names cannot start with @ or #, so these keys never clash with a child tag. Repeated tags become an array. An empty tag is null (<x/> and <x></x> are the same), a tag with only text is a string. Prefixes stay as written, like a:root, and xmlns attributes are kept.

Source: [XML 1.0 §2.3 Names](https://www.w3.org/TR/xml/#NT-NameStartChar) · [§3.1 Empty tags](https://www.w3.org/TR/xml/#sec-starttags)

### What does JSON lose?

The order between text and tags, and between different tags (<x/><y/><x/>). Comments, processing instructions, the DOCTYPE and whitespace-only text are dropped, unless xml:space="preserve" keeps the whitespace. Default attribute values from the DOCTYPE are filled in. CDATA becomes plain text, entities are decoded, CRLF line ends become LF, and line breaks and tabs in attribute values become spaces. With number conversion on, 42 and "42" look the same.

Source: [§2.5 Comments](https://www.w3.org/TR/xml/#sec-comments) · [§2.7 CDATA](https://www.w3.org/TR/xml/#sec-cdata-sect) · [§2.10 White space](https://www.w3.org/TR/xml/#sec-white-space) · [§2.11 Line ends](https://www.w3.org/TR/xml/#sec-line-ends) · [§3.3.2 Attribute defaults](https://www.w3.org/TR/xml/#sec-attr-defaults) · [§3.3.3 Attribute values](https://www.w3.org/TR/xml/#AVNormalize)

### Why is my XML rejected?

It must be well-formed: one root element, every tag closed. Besides &amp; &lt; &gt; &quot; &apos;, named entities like &nbsp; need a declaration, and documents that declare entities are refused, because expanding them can freeze the tab. Use numeric references like &#160; instead. External DTDs are not fetched.

Source: [§2.1 Well-formed](https://www.w3.org/TR/xml/#sec-well-formed) · [§4.1 References](https://www.w3.org/TR/xml/#sec-references) · [§4.6 Predefined entities](https://www.w3.org/TR/xml/#sec-predefined-ent)

### Which values become numbers?

Only with the option on, and only when the whole value is a JSON number that reads back as the same text: 42, -3.5, 1.5e-7. So 007, 1.0, 1e3, -0 and integers past 2^53 - 1 (positive or negative) stay strings. Only true and false become booleans.

Source: [RFC 8259 §6 Numbers](https://www.rfc-editor.org/rfc/rfc8259.html#section-6)

## Need data from a website, not a file?

Browser Use agents open pages in a real browser, including dynamic ones, and return structured data.

[See AI web scraping](https://browser-use.com/web-scraping)

Converted: 13 elements

XML

Load exampleOpen .xml file

Runs in your browser. Your XML is never uploaded.

Well-formed XML · 462 B

Always arrays for

Tag names, comma-separated, or \* for all. One tag then gives a one-item array, the same shape as two.

Convert numbers and true/false

Only values that are exactly a [JSON number](https://www.rfc-editor.org/rfc/rfc8259.html#section-6) and read back the same: 42 and -3.5, not 007, 1.0 or 1e3.

Attributes become "@name", text "#text", repeated tags arrays, empty tags null. Comments are dropped.

## JSON · 716 B

Copy JSONDownload .json

{
  "feed": {
    "@xmlns:media": "http://search.yahoo.com/mrss/",
    "item": \[
      {
        "@id": "1",
        "title": "Lisbon trip",
        "price": {
          "@currency": "EUR",
          "#text": "420.50"
        },
        "tag": \[
          "travel",
          "europe"
        \],
        "media:thumbnail": {
          "@url": "https://example.com/lisbon.jpg"
        }
      },
      {
        "@id": "2",
        "title": "Austin trip",
        "price": {
          "@currency": "USD",
          "#text": "380"
        },
        "tag": "travel",
        "note": {
          "b": "Friday",
          "#text": \[
            "Leaves ",
            " at 9:00"
          \]
        }
      }
    \]
  }
}

---

BROWSER USE

- Browser Use Agents: give Browser Use a task and receive completed work. API V4 is current for new integrations.
- Browser Infrastructure: connect your agent or automation to managed browsers through SDK, REST, or CDP. Starts at $0.02/browser-hour.
- Developer tools: Open Source, Browser Harness, SDK, and MCP support the two products above.

[Developer Index](https://browser-use.com/index.md)
[Product Map](https://browser-use.com/llms.txt)
[Full Product Context](https://browser-use.com/llms-full.txt)
[Pricing](https://browser-use.com/pricing.md)
[Cloud Docs](https://docs.browser-use.com/cloud/quickstart)
[Open Source Docs](https://docs.browser-use.com/open-source/introduction)
