本文へスキップ

Convert XML to JSON, CSV or Excel

Convert XML to JSON, CSV or Excel and turn JSON, CSV or Excel back into XML, choosing how attributes, arrays and repeating elements are handled; everything is converted in your browser.

Convert to
Drop an XML fileXML up to 100 MB · JSON, CSV, XLSX, XLS, ODS up to 500 MB
ファイルを選択端末上で処理 — アップロードされません
ブラウザで動作・アップロード不要しくみ

XML converterの使い方

  1. 1

    Add the file or paste it

    Drop an XML, JSON, CSV or Excel file, or paste the text. The kind of input is recognized from its content.

  2. 2

    Choose the target format

    XML becomes JSON, CSV or Excel; JSON, CSV and Excel sheets become XML. Formats that don't apply to your input are greyed out.

  3. 3

    Adjust the mapping

    Decide how attributes, repeated elements and namespaces are handled, which element is one row, or what the root and row elements are called.

  4. 4

    Copy or download

    The result updates as you change options; copy the text or download the .json, .xml, .csv or .xlsx file.

制限と Pro

XML files up to 100 MB; JSON, CSV and Excel files up to 500 MB.

JSON, CSV and Excel files up to 4 GB; XML stays at 100 MB on every plan, since the whole document is held in memory. Pro を見る

XML converter について

The XML converter moves data between XML and the formats most other software expects. In one direction it reads an XML document — a supplier price list, a bank or tax export, an RSS feed, a GPX track, a SOAP response — and writes it as JSON, as a CSV file or as an Excel sheet. In the other it turns JSON, a CSV file or a spreadsheet into XML for a system that only imports XML.

XML has no single mapping to JSON, so the choices are yours: attributes as "@id" keys, as plain keys or left out; element text under "#text" when an element also has attributes or children; repeated elements as arrays, or every child as an array for a stable shape; numbers and true/false typed or kept as strings; namespace prefixes such as dc: kept or dropped.

For tables, pick the element that repeats — catalog › book, rss › channel › item — and each one becomes a row. Attributes and nested elements become columns with dot names like price.currency; repeated children are joined in one cell or spread over numbered columns.

Building XML, keys and column headers become element names (an invalid name such as "Unit price" is written as Unit_price), arrays repeat the element, and output is indented or on one line, with or without the XML declaration.

The parser is strict: a file that isn't well-formed is reported with the line and column of the first error. Comments and processing instructions are not carried into the output, DTDs and external entities are never loaded, and text mixed with inline tags is joined into one value.

プライバシー

XML, JSON and spreadsheets are parsed and converted by a Web Worker in this tab; nothing is uploaded, no external DTD or entity is ever fetched, and pasted text isn't stored.

主な機能

XML ↔ JSON

Attributes as @keys, arrays for repeats, types and namespaces your way.

XML ↔ CSV and Excel

Pick the repeating element; nested tags become columns.

Valid XML out

Names fixed, special characters escaped, indented or compact.

Clear error messages

Line and column of the first well-formedness error.

XML converter:よくある質問

How are XML attributes converted to JSON?
By default each attribute becomes a key with an @ in front, so <book id="7"> gives "@id": 7, and the element's own text goes under "#text". You can drop the @ to get plain keys, or leave attributes out entirely. Converting that JSON back to XML here turns @ keys into attributes again, so the two directions round-trip.
Why is a value an array in one record and an object in another?
An element that appears several times under the same parent becomes an array, one that appears once becomes a single value, which is how most converters behave. If your code needs the same shape every time, switch on “Always use arrays”: every child element is then written as an array, even when it occurs only once.
Which XML element becomes a row in CSV or Excel?
The first element that repeats, counted from the top of the document, is chosen automatically — book in a catalog, item in an RSS feed, order in an order export. The list shows every repeating element with how often it occurs, so you can pick a deeper one, such as the order lines inside each order, instead.
Can it convert a CSV or Excel sheet to XML?
Yes. Drop the CSV or workbook and choose XML. Each row becomes an element (row unless you rename it) inside a root element (rows by default), and each column becomes a child element named after its header, or an attribute if you prefer. Headers with spaces or leading digits are adjusted so the XML stays valid.
What happens when the XML has an error?
Conversion stops and the message names the problem and where it is, for example a closing tag on line 12 that doesn't match the opening tag from line 9, an unescaped & or a missing quote. The parser checks the XML 1.0 rules for tags, attributes, quotes and entities, so mistakes surface here rather than in the system you import into.

このツールでできるほかのこと