XML Tools
XML to CSV
Export repeated XML record elements as a CSV table. Each direct child of the root becomes one row, nested fields become dotted columns, and you can choose the delimiter.
✓ Every tool runs in your browser. We do not upload your input or output.
Keyboard shortcuts
Ctrl/⌘ + Enter: process
Ctrl/⌘ + Shift + F: full screen
Esc: exit full screen
Ctrl/⌘ + F in editor: search
How to use
- Provide XML with one root container and record elements that all have the same name.
- Choose comma, semicolon, or tab as the delimiter for the target spreadsheet or importer.
- Process the document and check the header row, including @-prefixed attributes and dotted nested fields.
- Copy the full CSV output or download it as a .csv file.
Examples
Export two orders
The order attribute becomes a column, and each order element becomes a row.
<orders><order id="A-101"><customer>Avery</customer></order><order id="A-102"><customer>Morgan</customer></order></orders>
@id,customer A-101,Avery A-102,Morgan
Flatten a nested field
A nested element path becomes a dotted CSV header.
<people><person><contact><city>Oslo</city></contact></person></people>
contact.city Oslo
Turn a record collection into a table
CSV is useful when XML contains a list of similar records and you want to inspect or import them as rows. The converter treats the XML root as a container. Every direct child element must have the same name; each becomes one CSV row. For example, an <orders> root can contain multiple <order> children. The tool reads all fields across the rows to build the header, leaving a blank cell when a record lacks a field.
Attributes become columns with an @ prefix, such as @id. Nested elements become dotted paths, such as shipping.city. A repeated nested element is kept as JSON text in one cell rather than generating extra rows. This keeps a one-to-one relationship between XML records and CSV rows, but it is not a lossless conversion.
Prepare the export
Choose the delimiter expected by your spreadsheet or receiving system. Commas are common, semicolons are useful in some locales, and tabs work for tab-separated imports. The converter quotes cells containing the delimiter, quotes, or line breaks. Review the output before using it in a database import, especially if some records have optional fields or nested arrays.
The XML must be well-formed and cannot use a DOCTYPE declaration. Everything runs in your browser’s Web Worker; files are never uploaded. The shared workspace scrolls internally, and Copy and Download use the complete CSV even when the visible preview is shortened.
Frequently asked questions
Which XML shape works best?
Use one container element with direct child records of the same name, such as orders containing order elements.
What if direct children have different names?
The tool reports an error because it cannot infer one consistent row type from mixed direct children.
How are nested elements represented?
Nested object paths become dotted headers, such as contact.city. Repeated nested elements are encoded as JSON text in a cell.
Can I choose a tab separator?
Yes. Comma, semicolon, and tab are available. Fields containing the selected delimiter or line breaks are quoted.
Will CSV preserve XML types and structure?
No. CSV is a flat text table. Keep the XML source if you need its full hierarchy, namespaces, or document markup.