Free Online CSV to XML Converter

Convert CSV to XML

Turn CSV rows into XML records. Upload a file or paste delimited text, choose the source separator and XML tag names, then review and download the result.

Drop a CSV file here to convert or CSV or TSV · Up to 50 MB
PASTE INPUT

Have CSV text?

Paste comma, tab, semicolon, or pipe-separated rows.

CSV TO XML GUIDE

Turn CSV rows into XML records

XML is often used by older systems, data feeds, and applications that expect named elements instead of delimited rows. This converter maps a CSV or TSV table into a simple XML structure: column headings become child element names, and each data row becomes a record. Set the root and record tags to suit your destination, inspect the generated XML, and copy or download it.

Example: CSV converted to XML

Starting with this CSV:

name,city
Ada Lovelace,London
Grace Hopper,New York

The default root element is records, and each data row is wrapped in a record element:

<?xml version="1.0" encoding="UTF-8"?>
<records>
  <record>
    <name>Ada Lovelace</name>
    <city>London</city>
  </record>
  <record>
    <name>Grace Hopper</name>
    <city>New York</city>
  </record>
</records>

Choose the separator and header option

Auto-detect is the starting separator setting. If the preview places values in the wrong columns, select comma, semicolon, tab, or pipe to match the source file. Keep First row contains column names selected when the first line has headings. Turn it off when the file starts with a data row; the converter then creates names such as Column_1 and treats every parsed row as a record.

How column headings become XML element names

XML tag names cannot contain arbitrary punctuation or spaces. The converter changes unsupported heading characters to underscores, creates a name for blank or number-starting headings, and adds a numeric suffix when two cleaned headings would otherwise match. This keeps every CSV column separate in the output. Check the table heading row and XML preview if your source uses duplicate or unusual column names.

You can also change the default root element records and record element record. Names must start with a letter or underscore and may contain letters, numbers, periods, hyphens, and underscores. Names beginning with xml are reserved, and invalid custom names are reported before the XML can be copied or downloaded.

XML values, escaping, and the output structure

Cell contents are written as text; the converter does not infer numeric, date, or Boolean types. XML-sensitive characters are escaped so they remain part of the value. For instance, A & B is represented as A &amp; B in the XML source, and an XML reader displays the original A & B.

The result is a flat record structure, not an application-specific schema. It does not create nested elements, apply an XSD, or map headings to a particular service's field requirements. If an importer expects a particular namespace, hierarchy, or tag spelling, compare the output with that importer's specification before using it.

Convert and save a CSV or TSV file

  1. Choose a CSV or TSV file up to 50 MB, or paste delimited text.
  2. Check the separator and decide whether the first row contains column names.
  3. Set the root and record element names, then review the table and XML output.
  4. Copy the XML or download a file with an .xml extension.

The table and generated XML include all parsed rows. Completely blank lines are skipped, and missing cells in shorter records remain empty. The file is read and converted in your browser rather than uploaded to RomitCSV.

Frequently asked questions

Does the first CSV row become a record?

By default, the first row is used for element names, so only the rows after it become records. Turn off First row contains column names when the file has no header row.

Can I convert TSV or semicolon-separated data?

Yes. Upload or paste TSV and choose Tab in the separator menu. You can also choose comma, semicolon, or pipe when auto-detection does not match your source.

Can I paste CSV instead of uploading a file?

Yes. Paste delimited text into the input box and choose Use pasted data to open the same XML workspace.

Why did a heading change in the XML?

XML element names cannot contain every character allowed in CSV headings. The converter replaces unsupported characters, generates a name for blank or numeric-start headings, and adds suffixes when cleaned names would otherwise repeat.

Can I choose a custom root and record element?

Yes. Edit the two name fields in the workspace. Each name must start with a letter or underscore and use only letters, numbers, periods, underscores, or hyphens. Names beginning with xml are reserved.

Does the converter create XML for a specific application?

It creates a general flat record structure. It does not know the schema required by a particular application, so check the element names and structure against that application’s import guide.

Related tools

To turn simple XML records back into a table, use XML to CSV. To prepare a CSV before conversion, open the CSV Validator, or browse all RomitCSV tools.