CSV to XML converter
Export your sheet from Excel or Google Sheets as CSV and paste it here to get XML for a system that imports it.
Loading the tool…
Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.
How to use it
- Enter csv data, delimiter, root element name and row element name.
- The result appears straight away and updates as you edit.
- Copy the result, or copy a link that keeps the same values to share it.
How it is calculated
CSV is read per RFC 4180 (quoted fields with delimiters or line breaks inside). The first row gives the tag names after fixing invalid ones (spaces become _, a leading digit gets a _ prefix). Each following row becomes a row element, and an empty cell becomes an empty tag.
Example
Inputs: Delimiter = Comma ,, Root element name = rows, Row element name = row. Result: XML: <?xml version="1.0" encoding="UTF-8"?> <rows> <row> <المنتج>قهوة عربية</المنتج> <السعر>45</السعر> <الكمية>3</الكمية> </row> <row> <المنتج>تمر سكري</المنتج> <السعر>30</السعر> <الكمية>5</الكمية> </row> </rows>; Rows: 2; Columns: 3.
المنتج,السعر,الكمية قهوة عربية,45,3 تمر سكري,30,5
<?xml version="1.0" encoding="UTF-8"?>
<rows>
<row>
<المنتج>قهوة عربية</المنتج>
<السعر>45</السعر>
<الكمية>3</الكمية>
</row>
<row>
<المنتج>تمر سكري</المنتج>
<السعر>30</السعر>
<الكمية>5</الكمية>
</row>
</rows>Limits and caveats
- The first row must be headers, because XML needs names for the tags.
- Fully empty lines are skipped, and short rows are padded with empty cells.
Questions about this tool
Can Arabic headers be tag names?
Yes, XML allows Arabic letters in names, so a header becomes a tag like <المنتج>. Rename headers first if your system needs English tags.
What happens to a header with a space?
The space becomes an underscore, so full name turns into full_name, and a leading digit gets a _ prefix such as _2nd.
Is a comma inside a cell kept?
Yes, when the cell is quoted in the CSV, such as "Ali, Jr", it appears in full inside the tag.
