FreeConvert1PDF, document and archive tools
Tool index A–Z

CSV to XML

A supplier portal wants your price list as XML, but it lives in a spreadsheet. Save the sheet as CSV and convert it here: each spreadsheet row becomes one XML record and each column becomes a field inside it, named after the column title.

Choose files
or drop them here
CSV · TSV · TXT · folders work too
Processed on your device: your files are never uploaded.No sign-upNo watermarkNo daily limitNo queue

How to convert CSV to XML

  1. Save the sheet as CSV and pick the file here.
  2. Enter the element names the portal expects, such as PriceList for the root and Article for each record.
  3. Convert and upload the downloaded XML wherever it is needed.

Records and fields

With root name PriceList and record name Article, a sheet with the columns ArticleNo, Description and Price produces <PriceList>, then one <Article> per row containing <ArticleNo>, <Description> and <Price>. The column order of the sheet is kept inside every record.

Blank cells are written as empty elements like <Price/>, so each record carries the full set of fields even when some are missing.

Column titles that are not valid names

XML is strict about names. Spaces and punctuation in a title become underscores, so "Price (net)" turns into <Price__net_>, and a title beginning with a number is given a leading underscore. Columns without a title are called column1, column2 and so on; a title used twice gets a _2 suffix.

Rename the columns in the spreadsheet before saving if the portal requires exact field names. Element names are case-sensitive in XML, so Price and price count as two different fields.

Separators and encodings

Comma, semicolon, tab and pipe separated files are recognised without any setting, and quoted fields keep their commas and line breaks. Special characters in product names, like & or <, are escaped automatically.

CSV files saved by older Excel versions in Windows-1252 are decoded correctly, and the XML is written in UTF-8.

Questions

My sheet has no header row. What now?

Untick the header option. Fields are then named column1, column2 and so on.

Is the price list uploaded?

No, the XML is built in your browser.

Can a column become an attribute instead of an element?

Not directly. Convert the CSV to JSON, rename the keys you want as attributes so they start with @, then run JSON to XML.