XML to CSV

Flatten a repeated XML record element to rows and columns in CSV.

Input

Processed on your device

How to convert XML to CSV

Extract records with a recurring element name and convert their fields into a flat CSV table. Useful for inspecting exports from structured XML feeds or an existing application.

  1. Paste XML or open a local file.
  2. Enter Repeating element name if the auto-detected element is too high or low in the document.
  3. Export and check the expected row count.
Example input
<?xml version="1.0"?>
<inventory><item id="104">Notebook</item><item id="105">Pencil</item></inventory>

Example use

Select item elements in a price list so that the CSV has one row per item rather than one row per top-level document.

Output and compatibility

XML elements, attributes and nested values can require flattening into field names or serialized cell content. XML hierarchy and mixed formatting do not fit exactly into CSV.

Troubleshooting

If the wrong elements are selected, use the actual qualified name shown in the original markup. Try a smaller sample to confirm the intended record boundaries.

Use XML to JSON when preserving a nested representation is useful.

Frequently asked questions

Can it convert every XML structure faithfully?

Conversion is intended for repeating records. Hierarchy and schema rules need a different representation.

Can I choose which element is a row?

Yes. Set Repeating element name before converting.

Find a tool