Convert XML to JSON

Turn XML — feeds, exports, config files — into JSON.

  • Free, no sign-up
  • Runs in your browser

Drop your file here, or

TXT, CSV, JSON, Markdown, HTML, XML, DOCX, PDF, RTF and more

Type, paste with Ctrl V, or drop a file

Options

Attribute keys
Indent

or press Ctrl EnterRuns in your browser

Result

Your result will appear here.

Add your text, then press XML to JSON.

How to use XML to JSON

  1. Paste your text into the input box, or drop a file onto it.
  2. Choose your options.
  3. Press XML to JSON.
  4. Copy the result or download it in the format you need.

Example

Before
<note><to>Ada</to><body>Hi</body></note>
After
{
  "note": {
    "to": "Ada",
    "body": "Hi"
  }
}

Elements become keys; the root element stays as the top-level key.

Safe with XML from anywhere

The XML is read as text by a small parser — never by a full XML engine — and files with a DOCTYPE are refused. That rules out the external-entity (XXE) and “billion laughs” tricks that make some XML converters fetch files or freeze. Very deep or very large documents are stopped with a clear message.

What happens to your text

Your text is processed in your browser and kept only in this tab’s memory. It is not uploaded, saved or used for analytics.

Related guides

  • Explainer

    JSON vs XML vs YAML

    How JSON, XML and YAML represent the same data, what each is good at, common gotchas such as YAML’s “no” problem, and how conversion works.

Questions about XML to JSON

More answers in the TextVix FAQ.

How are attributes shown?

As keys with a prefix — @id by default. You can switch to _id or a plain name.

When do I get an array?

When an element appears more than once under the same parent. Turn on “Always use arrays” for a consistent shape.

Are numbers converted?

Only if you turn on “Detect numbers and true/false”. XML has no types, so by default every value stays text.

Is my text uploaded anywhere?

No. This tool runs entirely in your browser. Your text and files are never sent to a server or stored.