CSV to XML Converter
Paste CSV/TSV data to convert it into XML, where each row becomes a
What this CSV to XML conversion does
There are still plenty of situations that call for tabular data in XML: intake specifications for long-established business systems, input for reporting engines, and a number of APIs. Paste CSV or TSV here and this tool turns it into XML with one record per row. The output uses the straightforward shape `
The first line is read as a header and each column heading becomes a tag name. XML restricts what a tag name may look like, so **headings that begin with a digit, are empty, or contain disallowed characters are replaced automatically with a numbered name such as `column1` or `column2`.** Ampersands, less-than and greater-than signs in values are escaped into entity references. Everything runs in your browser, so data you would rather not send anywhere — customer records, for instance — stays with you.
How to convert CSV into XML
- Paste CSV or TSV The first line is treated as headings and the rest as data. Tab-separated input works too.
- Check the tag names Headings become tag names directly. Note that a heading which cannot legally be a tag name is replaced with a numbered one.
-
Review the generated XML
`
` sits at the top with each record below it as a ` `.
- Copy it for the next step Use it directly as input to an XML-consuming system, or as the source for an XSLT transformation.
Tips for getting more out of it
- Enable "Treat first line as header" to use the header row's column names directly as XML tag names (headers that aren't valid XML tag names — such as those starting with a digit or containing symbols — automatically fall back to `column1`, `column2`, etc.).
- If you don't use headers, every row is treated as data, and each column becomes a `column1`, `column2`, ... tag.
- Use this tool whenever a legacy XML-based API, a SOAP integration, or certain enterprise systems require XML instead of CSV for data import.
- The generated XML safely escapes special characters using character entity references (
&,<,>), so you can import it directly into external systems.
Where this conversion helps
Loading into a system that only accepts XML
Shapes data prepared in a spreadsheet into something a core business system expecting XML will take.
Producing a data source for a reporting engine
Many reporting engines take XML as their data source, and this gets you from a CSV to a prototype quickly.
Preparing practice data for XSLT
When writing a transformation stylesheet, you can produce sample XML from a table you already have.
Seeing the structure with your own eyes
Viewing the column-to-value relationship as XML nesting sometimes makes the structure easier to grasp than the flat CSV.
CSV to XML terms explained
- Tag name restrictions
- An XML tag name must start with a letter or an underscore and cannot contain spaces or most punctuation. **Headings that do not satisfy this are replaced automatically with names like `column1`.**
- Entity reference
- Rewriting `&`, `<` and `>` as `&`, `<` and `>`. **The ampersand has to be converted first, or the result is double-escaped.**
- The row element
- The element representing one record. This tool nests `
` elements inside a single `
`. - TSV
- Tab-separated tabular data. Copying out of a spreadsheet usually produces this format.
- Header row
- The column headings on the first line. Because tag names come from them, writing them with letters, digits and underscores keeps the output readable.
Frequently Asked Questions
&, <, and > into character entity references (&, <, >) before output, so even if your cell values contain these characters, the result is generated as valid, parseable XML.
Side Note — Why XML Came to Be Called "Verbose"
XML (Extensible Markup Language) was standardized by the W3C in 1998, and by the early 2000s it held an overwhelming position in the web industry as "the standard format for exchanging data between systems." It was used everywhere — from communication protocols like SOAP and XML-RPC, to RSS and Atom feed syndication, to configuration files such as Maven's pom.xml.
However, because XML requires an explicit opening and closing tag for every element, it tends to produce larger data sizes than JSON (which became popular from the mid-2000s onward) when representing the same data, earning it a reputation as "verbose." For instance, the JSON `{"name":"Alice"}` corresponds to XML like <name>Alice</name>, where the tags themselves can easily take up more characters than the actual data.
Even so, XML offers a mature set of specifications that JSON lacks, including strict type and structure validation via XML Schema, collision avoidance through namespaces, and transformation via XSLT. This rich validation and transformation ecosystem is one reason XML continues to be chosen for mission-critical system integration in finance, healthcare, and government today.