Convert CSV to Excel
Choose how your CSV is read, clean up its rows, and select, rename and arrange the columns before downloading an Excel file. This guide walks through the options using a small sample.
Try the sample CSV
Download orders-options.csv, a fictional order list with six columns and six data rows. It includes surrounding spaces, an empty row, a repeated Ada row and a shorter Eli row. The example will keep four columns and four data rows.
Step by step
- Download the sample CSV above. Open CSV to Excel and use Choose files to select orders-options.csv.
- Set Separator to ; and Text encoding to UTF-8. Leave First row is a header checked. Confirm that the preview shows Notes, Name, Amount, Account ID, City and Status as six separate columns. Finish these import settings before editing the columns.
- Untick Keep values as text for this example so the Amount values can be used in calculations. The text and number choices are explained below.
- Under Clean up data, tick Trim spaces around cells, Remove empty rows, Remove duplicate rows and Fill missing cells in shorter rows. The preview should now show four data rows and two removed rows.
- Under Columns, untick Notes and Status. Edit the header fields to rename Account ID to Account and Amount to Total. Use the up and down arrow buttons (Move up and Move down) until the selected columns appear in the preview as Name, Account, City, Total.
- Check the preview, then select Download Excel. Open orders-options.xlsx in Excel or another spreadsheet editor and follow the checks below.
Understand the import options
| Option | When to use it |
|---|---|
| Separator | Automatic detects a likely separator. You can choose a comma, semicolon, Tab or |, or use Custom for one other character. Choose the character that separates the fields in your file; this sample uses semicolons. |
| Text encoding | Automatic detects UTF-8, Windows-1252 or a marked UTF-16 file. You can also choose UTF-8, Windows-1252, UTF-16 LE or UTF-16 BE explicitly. This sample is UTF-8; Zoë should appear correctly. |
| First row is a header | Keep this checked when the first row contains column names. It makes that row the spreadsheet header and enables editing the names. Untick it when the first row contains data that should be treated like the other records. |
Choose text or numeric cells
| Keep values as text | Effect |
|---|---|
| Checked | All populated cells are written as text. Use this when you want to keep the original text values. Amounts such as 19.50 remain text and will not behave like numeric cells in SUM. |
| Unchecked | Eligible plain numbers are written as numeric cells; other values remain text. Use this for the example so Total can be summed. The setting applies to all columns, and Excel may display 19.50 as 19.5. |
Clean up the rows
| Option | When to use it |
|---|---|
| Trim spaces around cells | Remove spaces at the beginning and end of each cell, including headers. In the sample, this removes the spaces around Zoë. Spaces between words remain. |
| Remove empty rows | Remove rows whose cells are all empty or contain only spaces. This removes the sample's empty row. The header is kept. |
| Remove duplicate rows | Keep the first copy of each matching whole data row and remove later copies. This keeps one Ada row. Trimming and filling shorter rows, when enabled, happen before rows are compared. |
| Fill missing cells in shorter rows | Add blank cells at the end of shorter rows so they reach the widest row's column count. Eli's missing City and Status cells become blank; no missing values are guessed. |
The remaining data rows keep their source order: Zoë, Ada, Mika, Eli in this example. The tool has no controls to select or reorder individual data rows.
Select, rename and order columns
| Action | How it works |
|---|---|
| Select columns | Use the checkboxes to include or exclude columns. Keep at least one selected. Untick Notes and Status for the example. |
| Rename headers | Edit the name field beside a column when First row is a header is checked. Rename Account ID to Account and Amount to Total for the example. |
| Set the order | Use the up and down arrow buttons (Move up and Move down) to move columns in the list. Selected columns are exported in that list order, from left to right. The order in which you tick the checkboxes does not set the output order. Reticking a column returns it to its existing place. |
| Reset columns | Reset columns selects all columns again, restores their source order and removes your header renames. Your cleanup choices remain selected. |
Check the Excel file
- Confirm the four headers are Name, Account, City, Total in that order, with four data rows. Notes and Status should be absent.
- Check that the names are Zoë, Ada, Mika and Eli, with no surrounding spaces. Ada should appear once and Eli's City cell should be empty.
- With Keep values as text unticked, enter =SUM(D2:D5) in an empty cell. The total should be 43.75.
- Save and reopen the XLSX file. Check the headers, row order, names and values again. The original CSV file remains unchanged.
Questions and troubleshooting
Everything appears in one column
Change Separator to the character used between fields in the source file. For the sample, choose ;. Use Custom only when your file uses another single character.
Names contain strange characters
Check Text encoding. Try the encoding used when the file was created, then inspect an accented name. The sample uses UTF-8 and should show Zoë.
The first record became a header, or I cannot rename columns
Check First row is a header. Untick it if the first row is a data record. Tick it if the first row contains the names you want to edit.
My column choices or names disappeared
Changing Separator or Text encoding reads the file again and resets column selection, order and names. Finish those settings first, then arrange the columns. Reset columns also restores the original columns and names.
The preview shows only part of my file
The preview shows up to 12 data rows and 12 columns. The download includes all remaining rows and all selected columns, in the chosen order. Check a larger file in your spreadsheet editor after downloading it.
Amounts do not add up as numbers
If Keep values as text is checked, amounts are text. Untick it and download again for eligible plain numbers to become numeric cells. Currency symbols and decimal commas remain text. Numeric cells may display fewer trailing decimal zeros; this does not change the amount.
A code needs leading zeros
A code such as the sample's 00123 is an identifier. Keep values as text keeps populated cells as text. This converter also keeps a zero-prefixed code such as 00123 as text when the setting is unticked. Check the code in the downloaded XLSX. If zeros are already missing from the source CSV, conversion cannot restore them automatically.
Rows still look duplicated after I hide a column
Remove duplicate rows compares whole source rows after the selected cleanup, before excluded columns are removed. Rows with different Notes values remain separate even if Notes is unticked. Check the source differences before removing records.
Optional: compare the sample and reference downloads
These tables show the source values and the arranged data from the example. The reference workbooks were produced with the converter's export function using the same cleanup, header names and column order.
Before cleanup: sample CSV
The empty row and repeated Ada row are intentional. Eli's source row ends after Account ID. Surrounding spaces are preserved in this table.
| Notes | Name | Amount | Account ID | City | Status |
|---|---|---|---|---|---|
| internal | Zoë | 19.50 | 00123 | Bergen | Paid |
| archive | Ada | 5.00 | 12345 | Oslo | Paid |
| archive | Ada | 5.00 | 12345 | Oslo | Paid |
| follow up | Mika | 12.00 | 00234 | Trondheim | Pending |
| review | Eli | 7.25 | 34567 |
After cleanup and column choices
These are the values shown in the converter's preview. A spreadsheet editor may display numeric amounts with fewer trailing zeros.
| Name | Account | City | Total |
|---|---|---|---|
| Zoë | 00123 | Bergen | 19.50 |
| Ada | 12345 | Oslo | 5.00 |
| Mika | 00234 | Trondheim | 12.00 |
| Eli | 34567 | 7.25 |
| Reference file | Cell setting | Bytes |
|---|---|---|
| orders-options.xlsx | Keep values as text unchecked | 4952 |
| orders-options-text.xlsx | Keep values as text checked | 5180 |
Both references contain the same four rows and column choices. Their text and numeric cell types differ. The text reference has a descriptive filename; the converter downloads this sample as orders-options.xlsx.