XML to CSV
To convert XML to CSV online, paste or drop a .xml file with repeating sibling elements — or press Load example. The tab flattens each sibling into a CSV row: attributes become @columns, leaf children become columns. Pick comma, tab, or semicolon and an optional header, then Copy or Download. Nothing is uploaded.
Updated
Paste or drop a .xml file with repeating siblings (for example several <city> elements), pick comma, tab, or semicolon, and convert in this tab. Closing the tab drops the buffer. Invalid XML and non-tabular trees get an honest in-page error instead of a guessed table.
One canonical URL with a trailing slash — there is no /csv-to-xml/ reverse on this page and no /in/ prefix. India-first SAMPLE examples use city names; the same page works globally.
Paste XML with repeating sibling elements (for example <city>…</city>). Drop a .xml file — it stays in this tab.
Optional .xml drop. Read with FileReader in this tab — never uploaded.
How does the XML to CSV work?
1. Paste or drop XML
Use a document whose rows are repeating sibling elements. Dropped .xml files are read with FileReader in this tab — never uploaded.
2. Choose delimiter
Comma is the default. Tab and semicolon are for TSV and EU-style CSV. Optional header row names columns from attributes and child tags.
3. Flatten locally
DOMParser builds the tree in this tab. Attributes become @columns; leaf children become columns; duplicate leaf siblings join with a semicolon. Malformed XML or non-tabular shapes show an error — nothing is sent to a server.
4. Copy or download
Copy the CSV or download .csv. Closing the tab drops the buffer.
Questions about XML to CSV
- Does XML to CSV upload my file?
- No. Parsing and conversion run in your browser with DOMParser. There is no account and no server-side converter. Dropped files are read with FileReader in this tab; we do not upload them to Page Utils or write them to localStorage. Closing the tab drops the buffer.
- What XML shapes work?
- Tabular XML with repeating sibling elements — for example several <row> or <city> children under one parent. Each sibling becomes a CSV row. Attributes become @columns and leaf child elements become columns. Deep one-off trees without repeating siblings are rejected with an honest error rather than a guessed table. Namespace prefixes stay in column names, so an RSS <title> and <media:title> become separate title and media:title columns instead of being merged.
- What happens if my XML is invalid?
- You get a short parse error next to the input and the CSV stays empty. The page does not auto-close tags or invent a partial table. Fix the XML in an editor and paste again — conversion stays in this tab and nothing is uploaded.
- Is there a CSV to XML reverse on this URL?
- No. This page is XML → CSV only. We do not publish /file-conversion/csv-to-xml/ as a second path here. For JSON ↔ CSV use /file-conversion/json-to-csv/ on its own toggle. Keep one canonical trailing-slash URL per tool so bookmarks and search results stay aligned.
- Which delimiters are supported?
- Comma is the default for CSV. Tab makes TSV, and semicolon covers EU-style exports that use comma as a decimal separator. The delimiter applies to the CSV output only — your XML input is unchanged. Conversion stays in the browser; nothing is uploaded.
- How are nested elements and duplicate tags handled?
- Leaf children flatten to column names from their tags. Attributes use an @ prefix so they do not collide with child names. Duplicate leaf siblings with the same tag are joined with a semicolon separator. Nested duplicates that are not leaves get indexed dotted columns (tag.1, tag.2). This is a convenience flatten, not a full XML Infoset dump.
- Is there an /in/ version for India?
- No. The same /file-conversion/xml-to-csv/ URL works globally, including from India. We do not duplicate tools under a country prefix or geo doorway. SAMPLE examples may use Indian city names; the converter itself is format-agnostic and runs entirely in this tab.
- Will this replace a database import or XSD validator?
- No. It is a convenience converter for tabular XML you can see in this tab. It does not validate against an XSD or DTD, does not talk to a database, and will not merge PDFs. Multi-megabyte documents can still need a local CLI.
What else can I open?
- JSON to CSVConvert JSON to CSV (and back) entirely in the browser.
- CSV ViewerOpen a CSV as a sortable, searchable table with column stats, in the browser.
- JSON to ExcelConvert JSON to a real Excel .xlsx file in the browser — nested keys flattened, nothing uploaded.
- CSV to ExcelTurn a CSV or TSV table into a real .xlsx workbook locally in the browser.
- JSON to XMLConvert JSON back to indented XML locally in the browser.
- JWT Token GeneratorCreate and sign a compact HS256 JWT locally in the browser.
These tools run in your browser. Page Utils does not store, upload, or write to localStorage the keys, tokens, or text you paste. Results are a convenience aid, not legal, tax, or security advice.