CSV to XML converter

Paste CSV or open a .csv file and get XML. The first row gives the element names, and every following row becomes a <row> element in a <rows> root.

  • Free
  • No sign-up
  • Runs in your browser

Runs in your browser — your text is never sent to our servers.

How to use CSV to XML

  1. Paste your CSV into the input box, or click Open a file to load a .csv file.
  2. Leave the delimiter on Auto-detect, or pick comma, semicolon or tab. Optionally rename the root and row elements.
  3. Read the XML in the output box.
  4. Click Copy or Download to save data.xml.

Features

  • First row becomes the element names; invalid name characters become underscores
  • Duplicate headers are made unique (name, name_2)
  • Quoted fields with commas, quotes and line breaks are read correctly (RFC 4180)
  • Choose the delimiter, root and row element names, and indentation
  • Runs in your browser, so the CSV is never uploaded

Supported formats and limits

  • Maximum input: 10,000,000 characters

Examples

InputResult
name,age Ana,30 "Luis, Jr.",41<?xml version="1.0" encoding="UTF-8"?> <rows> <row> <name>Ana</name> <age>30</age> </row> <row> <name>Luis, Jr.</name> <age>41</age> </row> </rows>
first name;age Ana;30<?xml version="1.0" encoding="UTF-8"?> <people> <person> <first_name>Ana</first_name> <age>30</age> </person> </people> — Semicolon delimiter, root "people", row "person".

Limitations

  • The first row is always treated as the header. A file without a header row will use its first data row as element names.
  • All values are written as text; XML has no number or date types.
  • There are no XML attributes in the output, only elements.

Learn more

CSV is a simple table format: one record per line and fields separated by a delimiter, usually a comma. XML is a tree of named elements. To turn a table into a tree you need names, which is why the first row of the CSV, the header, is used to name the child elements of every record.

Some care is needed because XML names are stricter than CSV headings. A name cannot contain spaces, cannot start with a digit and cannot be empty, so headings are cleaned up: spaces become underscores, a leading digit gets an underscore in front, and repeated headings get a number. Values are escaped so characters such as & and < cannot break the document.

The structure produced is a root element holding one row element per record. Systems that expect a different layout, for example with attributes, may need a further transformation such as XSLT.

Frequently asked questions

Which row is used for the element names?

The first row. Each header becomes an element name; spaces and other invalid characters are replaced with underscores.

Can I use a semicolon or tab delimiter?

Yes. Leave Auto-detect on, or choose comma, semicolon or tab yourself.

Are commas inside quoted fields handled?

Yes. Fields in double quotes can contain the delimiter, doubled quotes and line breaks.

Is my CSV uploaded?

No. The conversion runs in your browser.

Sources

Last reviewed: September 30, 2026