CSV/XML

CSV to XML Converter

Generate XML from strict CSV or TSV while preserving field text and Unicode names

Data Format
🔒 100% client-side — your data never leaves this page
Maintained by Evan•Updated: September 30, 2026

Convert a defined record mapping locally. Review the mapping rules below before using the output; this does not preserve every XML/JSON data model. Input stays in this page; drafts are not stored. Limits: 1 MiB input, 4 MiB output, 20,000 XML nodes including attributes, 64 element levels. Textareas normalize pasted line endings; upload UTF-8 to retain original CSV carriage returns.

CSV / TSV

First row supplies unique XML names; @name creates a record attribute. Values remain text, including leading zeros and formula-like strings. Quoted empty values are records; blank physical lines are skipped. Every row must match the header width. Namespaces and invalid names are rejected. Up to 5,000 rows × 100 columns, also subject to the XML node limit.

About this tool

CSV to XML reads one unique non-empty header row and at least one data record. Ordinary headers become child elements and @name headers become attributes on each record. Root and record names are configurable; valid Unicode XML names are accepted. Names are never silently sanitized, and namespaces, duplicate/empty headers and invalid names are rejected. Choose comma, Tab, semicolon or pipe; auto mode examines the header and refuses ambiguous delimiter ties. Every row must match the header width. Blank physical lines are skipped, while quoted empty values remain records. Values remain exact text, including leading zeros, literal formula-like strings and embedded newlines; XML escaping preserves parsed text and attribute values without adding formatting whitespace. There is no #text header mapping, type inference or XSD validation. Up to 5,000 rows and 100 columns are allowed, also subject to the XML node limit. Input is limited to 1 MiB, output to 4 MiB, XML to 20,000 nodes including attributes and 64 element levels. UTF-8 uploads use strict decoding; pasted text follows the browser textarea line-ending rules. Processing runs locally, and draft input is not saved.

Scenario Recipes

01

Create a small XML import fixture from CSV

Goal: Make names and field text explicit before testing a receiving schema.

  1. Use unique valid XML headers. Prefix intended record attributes with @ and retain exact identifiers as CSV text.
  2. Set the root, record and delimiter. Convert, then inspect empty values, Unicode names and multiline fields.
  3. Download the XML and validate the receiving schema separately. Adjust source headers explicitly if the receiver needs different names.

Result: XML with exact accepted field text and no guessed renaming or types.

Failure Clinic (Common Pitfalls)

Two invalid headers used to collapse to the same attribute

Cause: Replacing punctuation with underscores can overwrite an existing value.

Fix: Rename invalid source headers explicitly. This tool rejects invalid names and duplicate headers.

The file has a quoted blank record or uneven rows

Cause: Skipping all empty-looking records loses data, while filling short rows guesses missing values.

Fix: Keep quoted empty records and make every row the same width as the header. Only physical blank lines are skipped.

Production Snippets

A Tab delimiter is a real tab character

tsv

@id	名称	value
001	李明	9007199254740993

Root: records; record: record
<records><record id="001"><名称>李明</名称><value>9007199254740993</value></record></records>

Frequently Asked Questions

How do I create attributes or Unicode elements?

Use @id for a record attribute and a valid XML name such as 名称 for a child element. XML namespace colons and xmlns are rejected; names are not silently renamed.

Will 001 or 9007199254740993 be rounded?

No. All CSV fields remain text. The tool does not infer numeric values, dates or formulas.

How are empty rows and mismatched widths handled?

A blank physical line is skipped. A quoted empty field is a data record. Records with fewer or more fields than the header are rejected.

Why does pasting a carriage return differ from uploading it?

Browser textareas normalize pasted line endings. Upload the original UTF-8 file when the exact distinction matters; serialization uses character references to preserve accepted carriage returns.

Keep browsing