TinyCSV LogoTinyCSV

XML to CSV Converter

Convert XML records to CSV. Choose the record element, map fields and attributes, review repeated values, and inspect the table before downloading.

输入 XML

将 XML 文件拖到此处,或从设备中选择。

原文件不会被覆盖。

核心功能

Choose the record

Pick the element that represents one output row, with path, namespace, and sample.

Map the fields

Select element text, attributes, and parent fields; rename and order columns.

Review repeated values

Join repeated values, split them into indexed columns, or use a repeated branch as row anchor.

Inspect before download

Review the sample table and mapping report, then run the full conversion.

使用方法

  1. 1

    Choose a file or paste XML

    Provide the XML source or start with the example. Review parsing errors before continuing; a file that can be parsed still needs a suitable table mapping.

  2. 2

    Choose the records

    Select the element that represents one output record. For a catalog that may be a product; for an order export, an order or an individual item. Check the path and sample rather than choosing only by count.

  3. 3

    Map the columns

    Select element values, attributes, and parent fields needed to preserve relationships. Review column names and namespaces so similarly named fields do not become indistinguishable.

  4. 4

    Review repeated values

    Decide whether repeated values belong in one cell, indexed columns, or separate records. Each choice changes the shape of the output; separate lists are never paired automatically.

  5. 5

    Generate and inspect the result

    Run the full conversion, then review record counts, columns, warnings, and the mapping report. Download the CSV or continue with a compatible table tool only after confirming the result.

输入 / 输出

Products with attributes and repeated tags

This original example contains two products. The mapping uses one product per row, extracts product and price attributes, and joins tag values with ; .

<catalog xmlns="urn:tinycsv:example">
  <product id="0007"><name>Maple &amp; Pine</name><price currency="USD">12.50</price><tags><tag>desk</tag><tag>gift</tag></tags></product>
  <product id="0012"><name>River Mug</name><price currency="USD">9.00</price></product>
</catalog>
id,name,price,currency,tags
0007,Maple & Pine,12.50,USD,desk; gift
0012,River Mug,9.00,USD,

The ID and price text remain text. The XML entity is represented by its decoded character in the CSV, so this is not a byte-for-byte copy. Joining tags also introduces a separator convention: if original tag values contain the separator, another reader needs a documented way to distinguish them. This example does not claim lossless reconstruction.

Convert XML records into CSV rows

XML organizes data through elements, attributes, and nested records. A CSV output needs a defined set of rows and columns, so an xml to csv converter must start by choosing what one row represents. Automatic suggestions are a starting point, not proof that the converter has understood your data model.

How to convert XML to CSV

To convert xml file to csv, choose a file or paste XML, select the records, map the columns, set repeated-value handling, then generate and inspect the result.

  1. Choose a file or paste XML. Review parsing errors before continuing. A file that can be parsed still needs a suitable table mapping.
  2. Choose the records. Select the element that represents one output record and check its path and sample.
  3. Map the columns. Select element values, attributes, and any parent fields needed to preserve relationships.
  4. Review repeated values. Decide whether repeated values belong in one cell, indexed columns, or separate records.
  5. Generate and inspect. Review record counts, columns, warnings, and the mapping report before downloading.

Example: products with attributes and repeated tags

The example above uses two products, extracts product and price attributes, and joins tags with a separator. Identifiers keep their leading zeros; decoded entities are text, not a byte-for-byte copy of the source.

Choose the right level for nested XML

When you convert nested xml to csv, an order with several items can become one row with repeated values, several item rows with the order key, or multiple related outputs. These are different mappings, not interchangeable formatting preferences. TinyCSV asks you to review repeated branches rather than silently generating combinations.

Keep attributes and namespaces distinguishable

Attributes can carry identifiers, units, or other values required by the destination. Namespace prefixes are display choices, not reliable field identities by themselves. Review namespace-aware paths and resolve naming conflicts before creating the output; shorter column names should not merge distinct fields.

Review empty values and omitted content

A missing element, an empty element, and an explicitly marked null may have different meanings. A plain empty CSV cell may not preserve those distinctions without an agreed convention. Comments, processing instructions, mixed content, and document-level information are not automatically preserved by a flat export; review the mapping report for excluded structures.

Understand large-file and preview limits

A sample helps check the mapping, but it is not the complete result. Full processing must account for records and fields outside the preview. File size alone does not determine the workload: depth, repeated branches, field lengths, selected columns, and output expansion all affect processing. No unlimited-size or instant-conversion promise is made here.

Check the CSV before using another application

Inspect identifiers, dates, empty values, record counts, and relationships before importing into a spreadsheet. Choose export settings deliberately: encoding, delimiters, quoting, and any formula-safety option should match the destination and remain visible choices rather than silent changes.

常见问题

How do I convert XML to CSV?

Choose an XML source, select the record element, and map its fields to columns. Review repeated values and warnings, generate the result, and check the full table before downloading.

Can I convert nested XML?

Use the supported record and field mappings to extract nested values. Repeated branches require an explicit strategy. Not every XML hierarchy can be represented in one table without changing or omitting information.

Are XML attributes included?

Select the attributes you need in the mapping. Review their paths and output names alongside element values, especially when attributes hold record IDs or units.

Why did my record count change?

The selected record level and repeated-value strategy determine the output rows. Choosing items instead of orders, or expanding a repeated branch, can produce a different count. Check the mapping summary rather than assuming every change is an error.

Can XML to CSV conversion be lossless?

Only when the selected mapping preserves everything required for the use case. A CSV table does not automatically retain arbitrary XML hierarchy, namespaces, mixed content, or document metadata.

Does a successful preview mean the entire file was converted?

No. The preview is labeled separately from full processing. Wait for a completed result and review the final counts and warnings before downloading or passing the table onward.