ToolFeather
Developer / SEORuns in your browser

CSV to XML Converter

Turn a CSV export into XML: each row becomes a record element, each column a child element named after its header — with the delimiter detected for you and header names made XML-safe.

Quick presets

CSV to XML Converter

CSV
XML

Table preview –

Runs in your browser — nothing you enter is uploaded or stored.

ToolFeather · CSV → XML
Scratchpad auto-saved
Stored in this browser (localStorage)
Step-by-step~40s read

How it works — in four simple steps

No signup and nothing to install — it all runs in your browser.

1

Add your CSV

Paste it into the left box, press Open file, or drag a .csv file onto it. Sample loads a realistic example.

2

Set the options

Adjust the options above the boxes — the output updates instantly as you change them.

3

Check the result

Read the status line: it reports rows, keys and any value that couldn't be represented in XML.

4

Copy or download

Copy the XML or download it as a .xml file. Nothing was uploaded at any point.

Pro tip

Rename a header to start with @ (like @sku) and that column becomes an attribute on each record element.

Features

Delimiter auto-detection

Comma, semicolon, tab or pipe is sniffed from the first lines — European Excel exports with ; just work.

Header row or not

Use the first row as field names, or treat every row as data with generated column1, column2… names.

Rebuild nested objects

Headers like address.city can be folded back into nested objects instead of flat dotted keys.

Your element names

Set the root element and the name used for each array item, and invalid characters are fixed for you so the XML stays well-formed.

Attributes kept, clearly marked

XML attributes become keys with an @ prefix (or _ / - / none), so they never collide with child elements of the same name.

Declaration on demand

Include or omit the <?xml version="1.0" encoding="UTF-8"?> line.

Private by design

Parsing and conversion run in your browser with JavaScript — your data is never uploaded, logged or stored.

About the CSV to XML Converter

CSV is a flat grid and XML is a tree, so converting CSV to XML means wrapping the grid in two levels of elements: a root for the whole file and a record element for each row. Inside each record, every column becomes a child element named after its header, so a row Ada,London under the headers name,city becomes <row><name>Ada</name><city>London</city></row>.

The CSV is parsed by an RFC 4180 parser, so quoted fields with commas, doubled quotes and line breaks inside cells come through intact. The delimiter is detected from the first lines (comma, semicolon, tab or pipe), which matters for files saved by European versions of Excel. Header names are cleaned into legal XML names: spaces and symbols become underscores and a name that starts with a digit gets a leading underscore — Unit price (€) becomes Unit_price rather than breaking the document.

Want a column as an attribute instead of a child element? Rename its header to start with @ (for example @id) and it's written as <row id="…">. Headers with dots, like address.city, can be nested into sub-elements with the Nest dotted headers option.

Examples

A small product export with a header that isn't a legal XML name, a price column and a quoted description containing a comma.

CSV input
@sku,name,Unit price,stock,description
TF-MUG,Feather mug,12.50,40,"Ceramic, 350 ml"
TF-TEE,Logo tee,19.00,12,"Organic cotton, unisex"
TF-CAP,Cap,15.00,0,Adjustable strap
XML output
<?xml version="1.0" encoding="UTF-8"?>
<products>
  <product sku="TF-MUG">
    <name>Feather mug</name>
    <Unit_price>12.50</Unit_price>
    <stock>40</stock>
    <description>Ceramic, 350 ml</description>
  </product>
  <product sku="TF-TEE">
    <name>Logo tee</name>
    <Unit_price>19.00</Unit_price>
    <stock>12</stock>
    <description>Organic cotton, unisex</description>
  </product>
  <product sku="TF-CAP">
    <name>Cap</name>
    <Unit_price>15.00</Unit_price>
    <stock>0</stock>
    <description>Adjustable strap</description>
  </product>
</products>

This output was produced by the converter on this page with root products and item product — load it with the “Product feed” preset above and change any option to see the effect.

How CSV maps to XML

In CSVBecomes in XML
The whole fileone root element (default <rows>)
Each data rowa record element (default <row>)
Header city, value Pune<city>Pune</city>
Header @idattribute id="…" on the record
Header address.city + Nest option<address><city>…</city></address>
Header Unit price<Unit_price> (legal XML name)
Empty cellempty element <city/>
"Smith & Co"Smith &amp; Co

Things that trip people up

CSV vs XML at a glance

PropertyCSVXML
SpecificationRFC 4180 (2005)XML 1.0 Fifth Edition (W3C, 2008)
File extension.csv.xml
Media typetext/csvapplication/xml (RFC 7303)
Data typestext only — every cell is a stringtext only (types come from a schema)
CommentsNoYes <!-- -->
NestingNone (flat rows)Unlimited

Frequently asked questions

5 answers
How do I set the root and row element names?
Type them in the Root element and Array item boxes. Defaults are <rows> and <row>; for a product feed you might use <products> and <product>.
Can a CSV column become an XML attribute?
Yes — start the header with @, e.g. rename id to @id, and it's written as an attribute on each record element.
Does it keep leading zeros?
Yes. XML stores everything as text, and the converter never reformats values, so ZIP codes like 02139 and IDs like 007 are written exactly as they appear in the CSV.
Can I convert an Excel file directly?
Save the sheet as CSV first, or use Excel to JSON and then JSON to XML. The CSV route keeps exactly what you see in the cells.
Is my data uploaded anywhere?
No. The CSV is parsed and converted by JavaScript in your browser tab; nothing is sent to a server, so it is safe for internal exports, customer lists and configuration files with secrets.