UltKit

CSV to XML Converter

Wrap the rows of a CSV file in XML elements so a program that only reads markup can import them. The header line names the tags, the delimiter is detected for you, and characters that would break XML are escaped.

Data Converter

or drop CSV, TSV, TXT … files here ·

Max 95 MB per file· Up to 20 files· Deleted after 30 minutes

Output

Files are processed on our servers and deleted after 30 minutes.

How to use this tool

  1. 1

    Upload the CSV

    Drop one or more .csv, .tsv or delimited .txt files, up to 20 at a time and 95 MB each. Commas, semicolons, tabs and pipes are recognized automatically.

  2. 2

    Set the root tag

    Under Advanced settings, change XML root tag from rows to the name your import expects, for example catalog or contacts. Pick a Text encoding if the CSV came from an old Windows program.

  3. 3

    Convert to XML

    Press Convert to XML and download the file. Open it in a browser first: if it displays as a tree, it is well-formed.

Why turn a CSV into XML

CSV is the format data leaves a system in; it was only written down as RFC 4180 in October 2005, decades after programs began exchanging it. XML is often the format data has to arrive in. A catalog designer feeding Adobe InDesign, a developer whose XSLT stylesheet turns records into an HTML report, an office worker importing a supplier list into Microsoft Access: each has rows in a spreadsheet export and a tool that expects tags.

Doing it by hand means a script or a long search-and-replace, and both tend to miss the hard cases: a company name with an ampersand, a quoted field with a line break inside, a file saved with semicolons by a European copy of Excel. The converter parses the CSV properly first and only then writes markup. If the data is still in a workbook, Excel to XML skips the CSV step entirely.

CSV to XML example with escaped characters

Semicolon CSV with a quoted field and an ampersand, root tag set to suppliers
name;city;since
"Hart & Sons; Ltd";Leeds;1998
Nordlicht GmbH;Bremen;2011

<?xml version="1.0" encoding="UTF-8"?>
<suppliers>
  <row>
    <name>Hart &amp; Sons; Ltd</name>
    <city>Leeds</city>
    <since>1998</since>
  </row>
  <row>
    <name>Nordlicht GmbH</name>
    <city>Bremen</city>
    <since>2011</since>
  </row>
</suppliers>
Well-formed XMLWell-formedness · Parseable XML
XML that obeys the syntax rules of the XML 1.0 specification: exactly one root element, every opening tag closed, tags properly nested, attribute values quoted and the characters & and < escaped inside text. A parser must stop at the first error, so one stray ampersand can reject a whole file. Well-formed is not the same as valid, which also means matching a schema such as an XSD.

CSV to XML converter limits

CSV files per batch
20
largest single file
95 MB
characters for the root tag
64
before uploads are erased
30 min

CSV and XML format facts

CSV

Comma-separated values

CSV is a plain-text format for tables in which each line is a row and commas separate the columns. It has been used since the early days of computing and is described in RFC 4180, though many variants use semicolons or tabs and different text encodings. Nearly every spreadsheet, database and analytics tool can import and export it, which makes it the default format for moving data between systems. CSV stores only values, with no formulas, formatting, multiple sheets or data types.

Compression
–
Transparency
–
Animation
–
Introduced
–
CSV converter

XML

Extensible Markup Language

XML is a markup language for structured data published by the W3C in 1998. It uses nested tags with attributes and supports schemas, namespaces and validation, which makes it robust for complex documents. It underlies RSS feeds, SVG, Office documents, sitemaps and many enterprise and government data exchanges. XML is verbose compared with JSON, but every programming language and many spreadsheet tools can read it.

Compression
–
Transparency
–
Animation
–
Introduced
1998 · W3C
XML converter

CSV becomes XML when a flat export has to enter a pipeline built on markup: an XSLT report, a layout tool with XML import, a database's XML loader or an integration whose parser rejects anything that is not well-formed.

The trade-off is structure for size. CSV has no types, no nesting and no place inside the file to say which encoding it uses, but it is compact. XML repeats every column name twice per row and declares its encoding on the first line. When the receiving program is modern, JSON is usually lighter than XML; JSON to XML covers the reverse case where a JSON source has to meet an XML-only system.

CSV to XML FAQ

Which programs import the XML made from a CSV?

Anything that reads generic XML: Microsoft Access through External Data, Adobe InDesign's XML import for data-driven layouts, XSLT processors that turn data into reports, and in-house tools written against an XML parser. Each row arrives as a row element under the root tag you chose.

My receiver wants product instead of row as the record tag. Can I change it?

The record element is always row, and you rename the outer element with XML root tag. If a strict schema names the record differently, a one-line XSLT template or a find-and-replace on <row> and </row> renames it.

What happens to commas and quotes inside a value?

The CSV is parsed by its quoting rules first, so "Smith, Jane" stays one value. In the XML the comma needs no escaping, while & and < become &amp; and &lt;.

Does the delimiter matter for a semicolon CSV from European Excel?

Auto detect reads semicolons, tabs and pipes as well as commas. If a file has very few columns and the guess goes wrong, set Delimiter to Semicolon explicitly and convert again.

What if my CSV has no header row?

Turn off First row is header. Columns then get generic names in order, and every line, including the first, becomes a record. Rename the tags afterward or add a header line to the CSV and convert again.

Is the XML larger than the CSV?

Yes, usually several times larger, because every value is wrapped in an opening and a closing tag that repeat on each row. Turn off Pretty print to drop indentation and line breaks if size matters, or zip the file before sending it.