Runs on your device · Your file never leaves your device.
Drop a CSV or paste it and get an XML document with a <root> element, one <item> element per row and one child element per column, named after the header. Separators are detected automatically (comma, semicolon, tab, pipe), quoted fields are handled to RFC 4180, and a UTF-8 byte-order mark is stripped.
Column names that XML cannot use as element names — with spaces, symbols or a leading digit — are sanitised with underscores ("Unit price" becomes Unit_price), so the output is always well-formed. Values are written as text inside the elements; there are no attributes, which keeps the document simple for any parser.
You see the first 200 lines before downloading, and the conversion happens entirely on your device.
Not for: Producing a schema-specific XML (a bank, tax or e-commerce format) — the element names come from your headers, not from a schema.
XML holds every value as text, so there is nothing to gain from reading numbers or true and false, and this page does not offer it. Each value is written as it stands in the CSV: 1.50 stays 1.50, 1e3 stays 1e3, TRUE stays TRUE and the word NULL stays NULL. An empty cell gives an empty element, such as <note/>, and leading zeros, as in 007, are kept.
Duplicate and blank headers are fixed first: two columns called name become <name> and <name_2>, and a blank third header becomes <column_3>. Then each name is made legal for XML. Total (USD) becomes Total__USD_, because spaces and brackets turn into underscores, and 1st becomes _1st. A hyphen and a dot are allowed, so e-mail stays e-mail, and address.city stays one element with that name; it is not split into nested elements. Headers in any script, Arabic or Chinese for example, are kept as written.
Two headers that end up with the same name, such as "a b" and "a_b", are both written as <a_b> inside each <item>. A program that reads elements by name may then see only the first, so rename one of them in the CSV first.
The text is read by the same rules as /csv-to-json, which explains them with examples: how quotes work, how the separator is found, how the file's encoding is recognised, and what happens to a row with more or fewer cells than the header. In the XML, a missing cell becomes an empty element. Cells beyond the last header have no element name, so they are left out, and a message says how many rows had them and where the first one is.
The names <root> and <item> are fixed. If a system expects other names, such as <customers> and <customer>, replace them in a text editor after downloading; nothing else in the structure needs to change.
This page in other languages: العربية · Deutsch · Français · Español · Русский · Português · 中文 · हिन्दी · Türkçe · עברית · فارسی · اردو · Bahasa Indonesia · বাংলা