CSV to XML Converter
Rows become elements. Columns become children. Enterprise integration awaits.
What this does
Paste CSV with a header row, get XML. The whole file sits inside <root>, each line becomes a <row>, and each cell becomes a child element named after its column. Comma, semicolon, tab, and pipe delimiters are detected for you. The first row is always the header.
An order export with the usual messy headers goes in:
Order ID,Customer Name,Total ($),Notes
1001,Acme & Sons,250.00,"Ship <before> Friday"
1002,Bob's Bikes,99.5, And comes out as:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<row>
<Order_ID>1001</Order_ID>
<Customer_Name>Acme & Sons</Customer_Name>
<Total____>250.00</Total____>
<Notes>Ship <before> Friday</Notes>
</row>
<row>
<Order_ID>1002</Order_ID>
<Customer_Name>Bob's Bikes</Customer_Name>
<Total____>99.5</Total____>
<Notes></Notes>
</row>
</root> The headers became legal tag names, the ampersand and angle brackets got escaped, and the missing note became an empty element.
Common use cases
Feeding a system that only imports XML: an older ERP, a SOAP service, a vendor's product feed spec. The data lives in a spreadsheet. The integration wants XML. Somebody has to translate.
Building XML test fixtures from a table someone already maintains.
Getting a starting structure to reshape. Most XML consumers want their own element names, so convert here, then rename.
Things to know
XML names can't contain spaces or most punctuation, and they can't start with a digit. So every character outside letters, digits, _, hyphen, and period becomes a _. Order ID turns into Order_ID. Total ($) turns into Total____, one _ per character. 1st becomes _1st, and an empty header becomes a lone _. Accented letters get replaced too, which is how Prénom ends up as Pr_nom.
When two headers land on the same tag, the second one gets a suffix. "first name" and "first_name" come out as first_name and first_name_1.
Every value is text. 250.00 stays 250.00, and nothing gets a type attribute. Ampersands, angle brackets, and both kinds of quotes are escaped. Line breaks inside quoted cells stay inside the element.
Short rows get empty elements for the missing cells. Long rows keep their spare cells as extra <_extra> elements, and a note by the controls says how many rows overflowed.
Privacy
All of this runs in your browser. Your order export goes from CSV to XML without visiting anyone's server, ours included. After one visit, it works offline too.
Questions
Can I change the root and row element names?
Not in the tool. It always writes <root> and <row>. Rename them afterward with find and replace: <row> and </row> first, then <root> and </root>. Our Find & Replace tool does it without your data leaving the browser either.
Can cells become attributes instead of child elements?
No. Every cell becomes a child element of its row, and the output has no attributes at all. If your target wants <row id="1001">, convert here and reshape the result with XSLT or a short script.
Will other XML tools accept the output?
It's well-formed: one XML declaration, one root, escaped text, legal element names. Valid against a specific XSD is a different question, since that depends on the schema's element names and order. Paste the result into the XML Formatter and hit Validate if you want a second opinion. One gap: control characters like U+0001 in a cell pass straight through, and XML 1.0 doesn't allow them.
Does it work with semicolon-separated CSV?
Yes. The delimiter is detected automatically, so semicolon files from European Excel just work. There's no manual override on this page, though. A single-column file of decimal-comma numbers like 3,5 has no semicolon to find, so it gets split at the comma.