How to convert CSV to XML
- Drop your CSV file on the box above, or paste its content into the text box.
- Check the settings below the box; the defaults suit most files.
- Press Convert. You see a preview or a summary of the result.
- Download the .xml file, or copy the text.
What is kept when you convert CSV to XML
- Each row becomes a record element and each column a child element named after its header.
- Header names are made into valid XML names — spaces and symbols become underscores, and a leading digit gets an underscore in front.
- Values are escaped; characters XML forbids outright are removed and counted. You can also write columns as attributes.
Example
A short CSV input and the exact output this tool produces from it:
Input
name,city,score
"Smith, John",London,42
Anna,"New ""York""",7.5 Output
<?xml version="1.0" encoding="UTF-8"?>
<rows>
<row>
<name>Smith, John</name>
<city>London</city>
<score>42</score>
</row>
<row>
<name>Anna</name>
<city>New "York"</city>
<score>7.5</score>
</row>
</rows>
About CSV and XML files
CSV (comma-separated values) is a table as plain text: one row per line, fields separated by commas, and fields that contain commas, quotes or line breaks wrapped in double quotes. It opens in Excel, Google Sheets, LibreOffice, any database tool.
XML stores data as nested, named elements. Element names must follow XML’s rules, special characters are escaped, and a few control characters are not allowed at all. It opens in code editors, Excel (as an XML table), databases, integration tools.
Good to know
- If a spreadsheet showed all your data in one column, the file probably uses semicolons (common in Europe); choose the delimiter instead of relying on detection.
- If the target system has its own XML schema, rename the root and record elements to match it in the settings.
Privacy and limits
The file is read and converted by this page in your browser; there is no upload and no account. Files up to 25 MB are accepted; a file of the wrong type or a damaged file is rejected with the reason.