# CSV to XML

> Rows to XML elements or attributes, with valid tag names. Runs entirely in your browser — nothing is uploaded.

Source: https://toffeekit.com/tools/csv-to-xml

**Category:** [Data](https://toffeekit.com/category/data) · **Price:** Free · **Runs:** in your browser, nothing is uploaded

Open the tool: https://toffeekit.com/tools/csv-to-xml

**Also useful for:** csv to xml, xml, convert csv, xml export, elements, attributes

## How it works

1. Paste your CSV, drop a file or click Open.
2. Set Columns as Elements or Attributes.
3. Name the Root element and Row element and pick an Indent.
4. Copy the XML or click Save to download an .xml file.

## FAQ

### How do I convert CSV to XML?

Paste the CSV and each row becomes an element named row inside a rows root element. Each column becomes a child element, or an attribute if you choose Attributes.

### What happens to headers with spaces or symbols?

XML names can't contain spaces or most symbols, or start with a number or "xml". Those characters become underscores and a leading underscore is added where needed, so the output is always well-formed.

### Should I use elements or attributes?

Elements suit long text and data that may grow nested later. Attributes give a compact one-line-per-row file and suit short values like IDs and codes.

### How are special characters handled?

&, < and > are escaped in text, and quotes and line breaks are escaped in attributes. Control characters that XML 1.0 can't hold at all are removed, and you're told how many.

### What happens to empty cells?

They become self-closing tags like <city/>, or are left out entirely when Skip empty cells is on.

### Is CSV to XML free and private?

Yes. It's free with no sign-up or limits, and it runs entirely in your browser, so your files are processed on your device and never uploaded. It works on phones and computers alike.

## Privacy

CSV to XML runs entirely in your browser. Your files and text are processed on your device and are never uploaded.

## Related tools

- [CSV to JSON](https://toffeekit.com/tools/csv-to-json) — Turn CSV rows into JSON objects.
- [JSON to CSV](https://toffeekit.com/tools/json-to-csv) — Flatten JSON into a CSV you can open in Excel.
- [XML ⇄ JSON](https://toffeekit.com/tools/xml-json-converter) — Convert XML to JSON and back.
- [CSV Cleaner](https://toffeekit.com/tools/csv-cleaner) — Trim cells, drop empty rows, remove duplicates.
- [Delimiter Converter](https://toffeekit.com/tools/csv-delimiter-converter) — Switch between comma, semicolon, tab and pipe.
- [CSV Viewer](https://toffeekit.com/tools/csv-viewer) — Open a CSV as a sortable, searchable table.

