araç köşesi

Convert CSV to XML

Turn each CSV row into a tagged XML record; the delimiter is detected and a semicolon file from Europe works too

Your data stays with you. Conversion happens inside the browser; nothing is sent to a server.

How it works

The usual case looks like this: your product list lives in Excel or Google Sheets, and an accounting package, an online store or a government portal wants the data as an XML file. Save the sheet as CSV (File → Save As → CSV in Excel, File → Download → CSV in Google Sheets), open the file in Notepad or TextEdit, copy everything and paste it into the left box. The XML appears in the right box as soon as you paste. The tool looks at the first few lines to work out the delimiter, so a comma file from US Excel and a semicolon file from a colleague in Germany or France both split correctly. A header row "Product,Qty,Price" with 200 rows under it becomes one document with 200 <row> elements, each holding <Product>, <Qty> and <Price>. If the receiving program expects <products> containing <product>, type those two names in the root and row boxes. A header with a space or a bracket is rewritten with underscores ("Product Name" becomes Product_Name), a header starting with a digit gets a leading underscore, and the result line says how many headers were changed and what each one became. Cell values are written exactly as they are: 1,250.00 stays 1,250.00 and a ZIP code such as 02134 keeps its leading zero, because XML has no number type and interpreting the value is the job of the program that reads the file. A comma or a line break inside a quoted cell is data and does not split the column. Copy the result with one click or download it as .xml.

This tool is also known as csv to xml, csv to xml converter, convert csv to xml online, csv file to xml, excel csv to xml, semicolon csv to xml.

What is CSV?

CSV is a plain-text table: one line per record, one delimiter between cells. Excel, Google Sheets, bank statements and online store back-ends all export it. The catch is that the delimiter is not fixed: the name says "comma-separated", but Excel on a computer set to a decimal comma writes semicolons, a table copied from a spreadsheet uses tabs, and some reports use a pipe character. When a cell itself contains the delimiter, the cell is wrapped in double quotes and any quote inside it is doubled; a reader that ignores this rule splits "Plate, porcelain" into two columns. This tool detects the delimiter from the first lines and applies the quoting rule.

What is XML?

XML is a text format in which every value sits between an opening and a closing tag: <Price>320.00</Price>. Tags are elements; name="value" pairs written inside an opening tag are attributes; one outermost element (the root) wraps the whole document, and everything else is nested inside it. An element name starts with a letter or an underscore and contains no spaces, which is why spreadsheet headers usually need adapting on the way in. Accounting software, ERP systems and government data exchanges ask for XML because each value carries the name of its field with it: the reader looks at the name, not the column position.

What is the difference between CSV and XML?

A CSV is a table: the meaning of a value comes from its position, the third cell belongs to the third header, and a change of delimiter, quoting or decimal mark can quietly corrupt the file. In XML each value sits inside its own named tag, the column order does not matter, the document describes itself and can be checked against a schema (XSD); the price is size, since the same table is several times longer as XML. Neither format carries type information: "1,250.00" is text in both. What XML adds is the ability to label that text by name and nest it. Open it in Excel as CSV; hand it to a program or an institution as XML.

Three traps: header names, numbers and a delimiter inside quotes

Header names: an XML element name cannot contain spaces, brackets or most punctuation, and cannot start with a digit. A header like "Product Name" written as it is would give a file no parser can open. Instead of dropping the header, the tool bends it to the rule and tells you in the result line: "Product Name" becomes <Product_Name>, "2024 sales" becomes <_2024_sales>, "Price (USD)" becomes <Price__USD_>. Accented letters such as é or ñ are legal in XML names and are kept. If two columns share a header, the second one gets a _2 suffix so the two are not mixed up.

Numbers: this tool never interprets a cell. Unlike the CSV to JSON page, there is no "convert to number" step here, because XML has no number type; every value is plain text between two tags. So 1,250.00 keeps its thousands separator, 12.5 keeps its decimal point and a ZIP code like 02134 or a phone number starting with 0 keeps its leading zero. If the program on the other side needs a different notation (a decimal comma, say, or no thousands separator), change it in the spreadsheet before you export; the tool will not guess for you.

A delimiter inside quotes: a quoted cell such as "Plate, porcelain" keeps its comma and stays one cell, a line break inside quotes stays inside the record, and a doubled quote ("") is read as one quote character. If a row has more cells than the header row, the extra cells are named column4, column5 and so on; if a row is shorter, the missing fields are simply not written, so they cannot be mistaken for empty cells.

  • "Product Name" → <Product_Name> (space becomes underscore, and you are told)
  • "2024 sales" → <_2024_sales> (a name starting with a digit gets an underscore in front)
  • 1,250.00 · 12.5 · 02134 → written as text, never interpreted
  • "Plate, porcelain" → one cell; a delimiter inside quotes is data

Which setting for which job

Row element name: the default row works with most import screens, but if the receiving system expects a specific name (product for a product list, customer for a customer list, entry for a ledger), type it in and the output is ready to use as it stands. The name you type goes through the same XML rule as the headers, so "product record" comes out as <product_record>.

Root element name: XML requires exactly one outermost element. The name root is generic and safe, but if a structure like <products> holding <product> is expected, put products in the root box. A plural root with a singular row name is the usual convention and reads naturally to whoever opens the file.

Empty cells: if the receiving program looks for the same fields in every record (most import routines do), keep "Write an empty element": an empty phone cell becomes <Phone/> and the field count stays constant. If you want the file small or empty fields invisible, pick "Skip it" and the element is left out of that record. Set the delimiter by hand only when the automatic detection guesses wrong: if the first lines of your file also contain semicolons inside the text, choosing "Semicolon" yourself settles it.

Frequently asked questions

How do I convert a CSV file to XML?

Open the CSV in Notepad, TextEdit or any text editor, copy its contents and paste them into the left box on this page; the XML is built in the right box at once. The first row is taken as the header row and each header becomes an element name; every data row becomes one <row> element. Copy the result or download it as an .xml file.

Why does my CSV come out as one column?

The file is probably separated by semicolons rather than commas. Excel does this on a computer whose regional settings use a decimal comma (Germany, France, Spain and most of Europe), and a comma-only reader then sees each line as a single cell. On this page the delimiter is detected from the first lines, so a semicolon file normally splits correctly. If you still see one column, set "Column delimiter" to "Semicolon" by hand; the field count in the result line shows when it is right.

Why were my column headers changed in the XML?

An XML element name cannot contain spaces, brackets or quotes and cannot start with a digit or with the letters xml. A header that breaks those rules, written unchanged, would give a file no program can parse. The tool adapts the header instead of dropping it: spaces and disallowed marks become underscores, a name starting with a digit gets a leading underscore, accented letters are kept. The result line reports how many headers changed and what each became; keep the headers plain in the spreadsheet and nothing is touched.

Is the data I paste uploaded anywhere?

No. Parsing the CSV and writing the XML both happen inside your browser; a product list, a customer file or a price table you paste never leaves this page and is not stored anywhere. Once the page has loaded, the conversion works even with the internet switched off.