Sign up free

XML to JSON Converter

Paste XML or open a file and get structured JSON, with attributes and repeated elements handled properly.

or drop files here

Accepts XML

Runs in your browser. Your files never leave your device.

About XML to JSON

XML to JSON is handy when an older system, a SOAP service, an RSS feed or a sitemap hands you XML and your code would rather work with JSON. Paste the XML or open a file and the JSON appears alongside, wrapped in an object named after the root element. When the records should end up in a spreadsheet instead, XML to Excel turns them into rows.

Nothing in the structure gets lost. Attributes become keys starting with @, so <book id="b1"> gives "@id": "b1". Elements that repeat, like several <book> entries, become an array, and the text of an element that also has attributes goes under #text. Values are kept as strings, exactly as written. If the XML is broken, you see the parser's message instead of a half-finished result.

How to use XML to JSON

  1. 1
    Paste or open XML

    Paste into Input or open an .xml file; Example shows a small catalog to try.

  2. 2
    Check the result

    The XML to JSON output updates as you type, and syntax errors are shown under Result.

  3. 3
    Copy or save

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

Why use Cubfile for this

  • Attributes as @keys

    Attribute values sit next to child elements, clearly marked with @ so nothing clashes.

  • Repeated elements as arrays

    Several siblings with the same name become a JSON array, keeping their order.

  • Runs in your browser

    The XML isn't uploaded, and the tool doesn't count toward daily tasks.

  • Clear error messages

    A missing closing tag or stray character is reported instead of silently producing bad JSON.

FAQ

XML to JSON: questions and answers

How does XML to JSON handle attributes?
Each attribute becomes a key with an @ prefix inside the element's object, for example "@id": "b1". If the element also has text, that text is stored under #text.
Are numbers converted to JSON numbers?
No. XML has no data types, so every value stays a string exactly as written. Convert types in your code, where you know what each field should be. When the data starts in a spreadsheet, Excel to JSON keeps numbers as numbers.
Is my XML uploaded anywhere?
No. Your browser parses and converts it locally, so feeds, invoices or configuration files never reach our servers.
How do I convert XML to JSON when the file is large?
Click Open file instead of pasting; the file is read straight into the page. Size is limited only by your device's memory, and it's free with no task counted.
What happens to namespaces and comments?
Namespace prefixes stay part of the element names, such as dc:title, and xmlns declarations show up as @xmlns keys. Comments and processing instructions are left out.
Share XML to JSON with a friendIt runs in any browser, and they can try it without signing up.

Related tools

XLSSQL Excel to SQLGenerate CREATE TABLE and INSERT statements from Excel or CSV.
XMLXLS XML to ExcelTurn repeating XML records into spreadsheet rows.
CSVXLS CSV to ExcelOpen CSV and TSV data in Excel with the right columns and encoding.
CSVJSON CSV to JSONConvert CSV to JSON in your browser. Nothing is uploaded.
CSVXML CSV to XMLConvert CSV or Excel rows into XML records.
XLSCSV Excel to CSVSave each sheet as CSV, line breaks in cells handled.
XLSHTML Excel to HTMLTurn a sheet into an HTML table you can paste into a page.
XLSJPG Excel to ImageSnapshot sheets and charts as images.