1xA2ZOne Data. Any Format.
Live syncLocal-first · no data upload

Convert XML to JSON

The tool handles table-shaped data only: your XML needs a root holding row elements, attributes are ignored, and nested child elements are read as plain text. For XML in that shape, paste it into the Quick paste box and the JSON appears on the right, as long as the text starts with <?xml or a <rows> root. For other XML, use Import file.

Runs entirely in your browser. Your data is never uploaded. Tiếng Việt

01

Spreadsheet

SheetsExcelCSVTSV
✦ Quick pasteSheets / Excel, CSV, TSV, Markdown, JSON, HTML, LaTeX, wiki…
0 rows · 0 columnsSelected cell: A1
02

Live Output

Markdowntwo-way
SyncedEdit directly; the table on the left updates itself
0 characters
Every change is processed right in your browserReady · LocalUTF-8 · by xuanhieu.org

When you need to convert XML to JSON

You meet XML in exports from older software, feeds and accounting systems, while the destination wants JSON. Real XML can be rich and a table is flat, so data can be lost when a file has attributes or several tag levels. The sample below is the kind of XML the tool reads best: each <row> is a row and each child tag is a column.

How to do it

  1. Paste XML into the Quick paste box and press Load into table ↵, or choose an .xml file with Import file.
  2. Check the grid. Each child tag of a row is a column; if the grid is empty or skewed, your root does not hold the row elements the tool expects.
  3. Open ⚙ Options on the JSON tab, set Output shape and decide on Output numbers as numbers.
  4. Press Copy result or Download file to get a .json file.

A real example

The tag <Order_ID> is kept as the key Order_ID: XML tag names cannot contain spaces, and the tool does not rewrite underscores. &quot; is read as a real double quote. 00123 stays a string, and amounts such as 450.00 stay strings too, because number export only converts values whose number form reads back the same.

Input · XML

<?xml version="1.0" encoding="UTF-8"?>
<rows>
  <row><Order_ID>00123</Order_ID><Customer>Anna Reed</Customer><Amount>450.00</Amount><Note>Rush delivery, call first</Note></row>
  <row><Order_ID>00124</Order_ID><Customer>Ben Cole</Customer><Amount>1250.00</Amount><Note>Includes &quot;gift wrap&quot;</Note></row>
  <row><Order_ID>00125</Order_ID><Customer>Cara Lin</Customer><Amount>299.50</Amount><Note></Note></row>
</rows>

Result · JSON

[
  {
    "Order_ID": "00123",
    "Customer": "Anna Reed",
    "Amount": "450.00",
    "Note": "Rush delivery, call first"
  },
  {
    "Order_ID": "00124",
    "Customer": "Ben Cole",
    "Amount": "1250.00",
    "Note": "Includes \"gift wrap\""
  },
  {
    "Order_ID": "00125",
    "Customer": "Cara Lin",
    "Amount": "299.50",
    "Note": ""
  }
]

Options worth changing

Output shape
Array of objects uses child tag names as keys, the natural shape for table-like XML. Array of arrays suits rows that need no key names, array per column suits charting.
Output numbers as numbers
Turn it on so values like 21 become JSON numbers. 00123 stays a string. A value such as 450.00 is not a canonical number, so it also stays a string.
Root object name
Wraps the array in an object such as {"orders": [...]} when the receiver rejects a bare array.
Minify (single line)
Handy for URLs or a small file. Leave it off when you read or diff the output.

Common problems

Limits

Frequently asked questions

What if my XML uses attributes?

Attributes are ignored and only the text of each tag is read. Move the values you need into child tags before pasting.

Why does deeper XML become plain text?

The tool works with tables, so nested child elements are read as text. To keep a tree you need a converter that understands XML structure.

Can I choose the JSON key names?

Keys come from the child tag names. You can edit the column headers in the grid before copying and the JSON follows.

Does XML with accented characters work?

Yes. Tag names and content with diacritics are read, as the Vietnamese sample shows.

Does the data leave my browser?

No. Reading the XML and building the JSON happen on your machine.

Related conversions

1xA2Z · Guide

Table statistics