CSV to XML Converter
Turn a CSV file into XML, one element per row, with your own names for the root and row elements.
or drop a file here · .csv, .txt · up to 20 MB
About the CSV to XML Converter
Most lists live in spreadsheets. When a website, ERP or portal wants the same list as XML, this converter writes it. Each spreadsheet row becomes one element, and each column becomes a child element named after its header.
When to use it
- A supplier portal wants product updates as XML, but your team keeps them in Excel.
- A legacy import screen accepts only XML files.
Worked example
The sample loaded by Try an example has four columns, id, name, city and amount, and two rows. One city is “Delhi, NCR”, which contains a comma and is therefore wrapped in double quotes in the CSV. Choose Convert to XML.
The result starts with an XML declaration and a rows element. Inside it there are two row elements, each with id, name, city and amount children. The quoted city appears as Delhi, NCR, with the comma kept and the quotes gone, exactly as a spreadsheet would show it.
Change Root name to products and Row name to product to get names that suit your data. Names must be valid XML: start with a letter or underscore and use only letters, digits, hyphens, underscores and dots.
What happens to awkward headers
Column headers often contain spaces or start with a number, such as “unit price” or “2025 sales”. XML does not allow that in element names, so the converter swaps each forbidden character for an underscore and adds an underscore before a leading digit. A warning lists every renamed header. An empty header gets a placeholder name and a repeated header gets a number added.
Good to know
- Values are copied as text. Leading zeros in PIN codes or phone numbers are kept.
- The delimiter is detected automatically; you can also pick comma, semicolon, tab or pipe yourself.
- Empty cells become empty elements.
- For JSON output, use CSV to JSON; to reverse this, use XML to CSV.
How to use CSV to XML Converter
- Paste CSV or open a .csv file. The first row must hold the column names.
- Choose the delimiter (or leave it on automatic), the root and row names and the indentation.
- Select Convert to XML, check the result, then copy or download it.
Privacy: how it works
Everything happens in your browser. Your text is not sent to any server.
Frequently asked questions
What if a column name has spaces?
XML element names cannot contain spaces or start with a digit, so such names are changed, for example "unit price" becomes unit_price. The page lists every name it changed.
Are numbers converted?
No. Every value is copied as text, exactly as it appears in the CSV, so leading zeros and long numbers are kept.
Which CSV files work?
Comma, semicolon, tab and pipe separated files that follow the usual CSV rules, including quoted values with commas or line breaks inside.