Convert CSV to XML
Turn each row of a CSV into an XML element, using the header names as tags. Choose the root and row names. Your file is converted in your browser and never uploaded.
- Free, every time
- No cloud processing
- Set root and row names
- Attributes with @ headers
- Runs on your device. Files are never uploaded.
- Free and unlimited. No sign-up, no watermark.
CSV to XML in three steps
No account, no email, no waiting for an upload.
- STEP 01
Drop in your CSV
The separator is detected for you.
- STEP 02
Name the elements
The defaults are <rows> for the root and <row> for each line. Change them to suit the system you send the XML to.
- STEP 03
Copy or download the XML
Headers become tags inside every row element.
What CSV to XML does, and what it doesn't
We'd rather tell you up front than surprise you after the download.
What you get
- Row and root namesChoose the root element and the element that wraps each row.
- Headers as tagsColumn names become child elements. Invalid characters are replaced so the XML stays well-formed.
- Attributes from @ columnsA column named @id becomes an id attribute on the row element. Pick another prefix if you like.
- Typed valuesNumbers and true/false are read as values; leading-zero codes stay as text.
- Nested XML from dotted headersTurn on the nesting option so a.b headers become nested elements.
Good to know
- Empty cellsAn empty cell becomes an empty element, or is omitted when nesting is used. Choose what suits your consumer.
- No schemaThe output is well-formed but follows no XSD. Check syntax with the XML validator.
- Duplicate headersRepeated column names get a suffix such as _2 so no data is lost.
Your data never leave your device
The tool runs inside your browser instead of on our servers, so there is nothing to upload, store or delete afterwards.
Typical online tool upload
Your file travels over the internet, sits on someone else's computer for a while, and you wait for the upload and the download.
Mediaextractr no upload
The tool loads into your browser once, then works on your file locally. Nothing is sent, so nothing can leak.
When people use CSV to XML
Feed a partner system
Convert a spreadsheet export into the XML an older service expects.
Migrate spreadsheet data
Move rows into an XML-based tool or CMS.
Create XML test data
Turn a table of cases into XML fixtures.
Produce simple feeds
Make a basic XML list from a sheet.
Mediaextractr vs typical upload tools
| MediaextractrPrivate | Typical upload tools | |
|---|---|---|
| Your file is uploaded | Never | Yes |
| Sign-up needed | No | Often, after a few files |
| Daily file limit | None | Often 1–2 free files |
| Watermark | Never | Sometimes |
| Wait for upload & download | No | Yes |
| Speed on very large files | Depends on your device | Depends on their servers |
How rows become XML
With the header on, the first line gives the element names. Each following line becomes one row element, wrapped inside the root. A row such as 1,Ada becomes <row><id>1</id><name>Ada</name></row>.
Headers that are not valid XML names, such as ones with spaces, are changed. A space becomes an underscore, and a leading digit gets an underscore in front.
Useful tricks
Small header changes give you finer control:
- Prefix a header with @ to write it as an attribute, for example @id.
- Use headers like address.city together with the nesting option for nested elements.
- Check the result with the XML formatter.
- Need JSON instead? Use CSV to JSON. The reverse is XML to CSV.
A small example: CSV to XML
A file with the headers @id, name and city, and one row 7, Ada, Pune, becomes a row element with an id attribute holding 7 and two child elements. Rename the root to catalog and the row element to person to get a document that looks hand-written. Check the output with the XML validator.
Questions, answered
How do I convert CSV to XML?
Paste the CSV, set the root and row names if you like, and copy the XML.
Is the spreadsheet data uploaded when making XML?
No. The XML is written by script in this tab, and your rows stay on your device.
How can I make an XML attribute from a column?
Start the header with @, for example @id. It is written as an attribute.
What are the default tag names?
<rows> for the root and <row> for each record.
What if a header has spaces?
Spaces and other invalid characters are replaced with underscores in the tag name.
Can I use it on a mobile browser?
Yes. Paste your CSV in Safari or Chrome on iOS or Android and copy the XML.