EN
My tools

CSV to XML Converter

Convert CSV or Excel cells to XML: header names become element or attribute names, with your own root and row names, escaping, indentation and declaration.

My tools →
Advertisement

Many systems — older web services, accounting and ERP imports, product feeds — accept XML but not CSV. Paste CSV, TSV or cells copied from Excel and get well-formed XML: each row becomes an element named as you choose, and each column becomes a child element or an attribute named after its header. Header names are turned into valid XML names, and every value is escaped so ampersands, angle brackets and quotes cannot break the document.

How to use this tool

  1. Paste the data with the column names in the first row.
  2. Name the root element and the row element.
  3. Choose child elements or attributes for the columns, and what happens to empty cells.
  4. Pick the indentation and whether to include the XML declaration.
  5. Copy the XML.

Formula

<root> → one <row> per data row → one <column>value</column> (or column="value") per cell

XML names cannot contain spaces or most punctuation, cannot start with a digit, and names beginning with "xml" are reserved, so headers are adjusted: spaces and other characters become _, a leading digit or "xml" gets an _ in front, and duplicates are numbered. Text escapes & < >; attribute values also escape " and line breaks (&#10;) so they survive attribute-value normalization. Control characters XML 1.0 forbids are removed.

Example

The sample customer list becomes <customers> with three <customer> elements. The second one contains <name>O'Brien &amp; Sons</name> — the & is escaped — and the third has an empty <email/> because Lin has no address. With "Attributes" the first row becomes <customer id="1" name="Ada Lovelace" email="ada@example.com" joined="2024-02-29"/>.

Frequently asked questions

Elements or attributes?

Elements handle long text, line breaks and future nesting better and are what most imports expect. Attributes give a compact one-line-per-row file. Check what the receiving system requires.

Why was my column name changed?

It was not a valid XML name — for example "First Name" (space), "2nd" (starts with a digit) or "a:b" (a colon means a namespace prefix). The table under the result shows each original header and the name used.

Can it convert Excel files directly?

Paste the cells here, or use the Excel to XML converter, which reads .xlsx files and can also produce Excel 2003 XML.

Is my data uploaded?

No. Conversion runs in your browser.

Sources

Last updated:

Cite or embed this tool
APA

kakaoCalc. (2026, November 8). CSV to XML Converter. https://kakao.mobile/tools/csv-to-xml-converter/

MLA

“CSV to XML Converter.” kakaoCalc, 8 Nov. 2026, kakao.mobile/tools/csv-to-xml-converter/.

Paste this code into your page. The widget runs in your visitors' browsers, shows no ads and keeps a link back to this page. Embedding terms

Advertisement