FreeXML → JSON

XML to JSON Converter

Turn XML into JSON with attributes, repeated elements and text all kept.

Runs in your browser. Files never leave your device.

CSV, TSV, Excel (.xlsx), JSON or XML · several at once · or drop them here

Converted on your device — files are never uploaded.

Quick answer

To convert XML to JSON, add the .xml file, choose indented or compact output and press Convert. Elements become keys, attributes become @name keys, repeated elements become arrays and numbers and true/false are typed unless you turn detection off. You can also convert XML records to CSV or Excel. It runs in your browser.

Step-by-Step Guide

How to convert XML to JSON

1

Add your XML

Choose one or more .xml files.

2

Check the preview

The repeated records in the file are shown as a table.

3

Choose the output

JSON keeps the full structure; CSV or Excel turn the records into rows.

4

Convert and download

Save the result, or a ZIP of several.

XML structure, in JSON

The converter maps XML to JSON the widely used way. Each element becomes a key holding its content, attributes become keys starting with @, and an element's text sits under #text when it also has attributes or children. Elements that repeat, like the book entries in a catalog, become an array; empty elements become null. The root element stays the top-level key.

With detection on, text and attribute values like 42, 3.5, true and false become JSON numbers and booleans; values with leading zeros stay strings. Turn it off to keep every value as a string. Comments and processing instructions are left out.

Need a table instead? Choose CSV or Excel and the repeated records become rows, with attributes and child elements as columns. The file is parsed by your browser and never uploaded.

Last updated

Why Use Ripify XML to JSON

Attributes kept

As @name keys next to the element's children.

Arrays for repeats

Repeated elements become JSON arrays.

Typed values

Numbers and booleans detected, or everything as strings.

Or a table

XML records to CSV or Excel rows.

Clear errors

Malformed XML is reported with the parser's message.

Private

Nothing is uploaded.

Frequently Asked Questions

XML to JSON FAQ

How are XML attributes converted?▼
Each attribute becomes a key starting with @, so <book id="7"> becomes {"book": {"@id": 7, …}}. Element text goes in #text when the element also has attributes or children.
Why is a single element an object but repeated ones an array?▼
XML doesn't say whether an element may repeat, so an element that appears once becomes an object and one that appears several times becomes an array.
Can I convert XML to CSV or Excel?▼
Yes. Choose CSV or Excel as the output: the largest set of repeated elements becomes the rows, and their attributes and child elements become columns, with nested ones flattened like author.name.
Can I turn the JSON back into XML?▼
Yes, with JSON to XML. It reads @ keys as attributes and #text as element text, so the structure comes back.

More Free Tools from Ripify