Boneyard Tools

CSV to XML Converter

Paste CSV to get well-formed XML. The header row becomes element names, quoted fields with commas survive, and special characters are escaped for you.

How to convert CSV to XML

  1. Paste or type your CSV into the box.
  2. Set the root and row element names and whether the first row is a header.
  3. Copy the XML output.

Examples

Header row to elements

name,age
Ada,36
<?xml version="1.0" encoding="UTF-8"?>
<root>
  <row>
    <name>Ada</name>
    <age>36</age>
  </row>
</root>

Frequently asked questions

Is my CSV uploaded anywhere?

No. The conversion runs entirely in your browser, so your data never leaves your device.

How are column names chosen?

With a header row, each column name comes from the first row. Without one, columns are named column1, column2 and so on.

What if a header is not a valid XML name?

Invalid characters become underscores and a leading digit is prefixed, so spaces or symbols in headers still produce well-formed XML.

Are quoted fields with commas handled?

Yes. The parser follows RFC 4180, so quoted fields can contain commas, line breaks and escaped quotes without breaking columns.

Are special characters escaped?

Yes. Ampersands, less-than and greater-than in cell values are escaped to keep the XML valid.

Related tools