Zero Signup ToolsFree browser tools

Converter Tools

CSV to XML Converter

Convert CSV to well-formed XML in your browser. Pick the root and row element names, emit columns as child elements or attributes, and download the result.

Quick presets

146 chars

XML output

XML ready4 rows4 columns21 elements520 B
<?xml version="1.0" encoding="UTF-8"?>
<rows>
  <row>
    <id>1</id>
    <name>Ada Lovelace</name>
    <role>Engineer</role>
    <active>true</active>
  </row>
  <row>
    <id>2</id>
    <name>Alan Turing</name>
    <role>Researcher</role>
    <active>true</active>
  </row>
  <row>
    <id>3</id>
    <name>Grace Hopper</name>
    <role>Admiral</role>
    <active>false</active>
  </row>
  <row>
    <id>4</id>
    <name>Margaret Hamilton</name>
    <role>Software Lead</role>
    <active>true</active>
  </row>
</rows>

Everything runs in your browser. Your CSV is never uploaded.

Options

Delimiter
Column layout
Element names
Formatting

Indent

How to use

  1. Paste your CSV into the input on the left, or click Load sample to see the format the tool expects.
  2. Pick a delimiter (comma, tab, semicolon, pipe, or a custom character) so the parser splits rows correctly.
  3. Choose the column layout: each column as a child element (most common), as an attribute (compact), or a mixed layout with the first column as an attribute.
  4. Set the root and row element names. The defaults rows and row work for most cases; for Android strings.xml use resources and string.
  5. Toggle First row is header on if your CSV has a header row, or off if every row is data. Sanitize header names rewrites invalid characters into underscores.
  6. Read the XML on the right, watch the row, column, element, and byte counters, then click Copy XML or Download .xml to save the output.

About this tool

CSV to XML Converter turns a CSV (or any delimiter-separated) document into a well-formed XML 1.0 document right in your browser. Pick how each row should look: every column as a child element of the row (the common case used by SOAP services, XSLT pipelines, and most XML serializers), every column as an attribute on the row element (compact output for things like Android strings.xml or simple ID-value lists), or a mixed layout that treats the first column as an id-style attribute and the rest as child elements. The CSV parser is RFC 4180 compliant: it understands quoted fields, escaped double quotes inside quoted fields, fields that span multiple lines inside quotes, and any mix of CRLF and LF newlines. The delimiter picker covers comma, tab, semicolon, pipe, and a custom character so the tool also handles TSV files and European CSV files that use semicolons. The XML writer is built around the XML 1.0 specification: ampersands, angle brackets, and quotes are escaped inside text and attribute values, control characters that the spec forbids are stripped (and counted in a warning so you know it happened), and the optional <?xml version="1.0" encoding="UTF-8"?> declaration is added when you want it. Header cells are sanitized into valid XML element names by default: spaces and other invalid characters become underscores, names that start with a digit are prefixed with an underscore, duplicates get _2, _3 suffixes, and a side panel lists every rename so nothing happens silently. Switch to strict mode if you would rather see an error message when a header is not already a valid XML name. Empty cells can be emitted as self-closing tags or as explicit open and close pairs for parsers that need them. Live counters show the number of rows, columns, elements, attributes, and bytes in the output, and you can copy the XML or download it as data.xml with one click. Useful for preparing data for legacy XML APIs, SOAP requests, .NET XmlSerializer round-trips, Android resource files, RSS-like feeds, configuration files, and any tooling that still consumes XML. Everything runs locally in your browser, so the CSV you paste here never leaves your device.

Free to use. Works in your browser. No signup, no login.

Related tools

You may also like

All tools
All toolsConverter Tools