Fix CSV encoding online
Seeing Café or � where accents should be? The tool works out how the file was saved, undoes the damage and gives you a clean UTF-8 copy.
Before and after
| id | name | city |
|---|---|---|
| 1 | José GarcÃa | Málaga |
| 2 | Chloë Martin | Montréal |
| 3 | Sam O’Neil | Zürich |
| id | name | city |
|---|---|---|
| 1 | José García | Málaga |
| 2 | Chloë Martin | Montréal |
| 3 | Sam O’Neil | Zürich |
This UTF-8 file was opened as Windows-1252 and saved again. The repair reverses each garbled sequence. A file showing � instead was read with the wrong encoding, which the Read the file as option fixes.
Why it happens in Excel and Google Sheets
A CSV file does not record which character encoding it uses, so every program has to guess. In Excel on Windows, the plain CSV (Comma delimited) option saves in the system code page, usually Windows-1252 in North America and Western Europe, while CSV UTF-8 (Comma delimited) saves UTF-8. Most web apps and importers expect UTF-8. When they read a Windows-1252 file, each accented letter is an invalid byte and shows up as �.
The reverse happens on the way in. Google Sheets downloads CSV as UTF-8, but double-clicking that file opens it in Excel as Windows-1252 unless the file starts with a byte-order mark, so é appears as é and a curly apostrophe as ’. If someone saves the file at that point, the garbled text becomes the real content and stays broken in every program after.
How to fix it
With this free tool (up to 1,000 rows)
- Add the broken file above, or test with the sample. The tool detects UTF-8, UTF-16 and common Windows encodings.
- Look at names and accents in the preview. If they still look wrong, change Read the file as until they read correctly.
- Keep Repair garbled text on to turn sequences like
Caféback intoCafé. - Keep the UTF-8 marker (BOM) if people will open the file in Excel, then download the UTF-8 CSV.
- Garbled names stop copies of a record from matching, so fix the encoding before you remove duplicate rows.
With Rowforma, for the whole file and every import
- Fix the encoding here first and download the UTF-8 CSV.
- Upload it to a free Rowforma account. Rowforma reads files as strict UTF-8 and stops with an encoding error rather than importing damaged text.
- Map the columns to your template and review the values Rowforma flags.
- Download the ready file for your import, with unresolved rows in a separate file.
Clean characters are step one. Check the rest of the file too.
Once the file is clean UTF-8, Rowforma checks each row against your import rules, from required fields to allowed values, and holds anything doubtful for your approval before you download.
Questions
How can I tell which encoding my file uses?
The tool detects it for you. As a rule of thumb, à and †sequences mean a UTF-8 file was read as Windows-1252, and � means a Windows-1252 file was read as UTF-8. If you are unsure, switch Read the file as and watch the preview.
Should I add the UTF-8 marker (BOM)?
Add it if the file will be opened in Excel, which then shows accents correctly. Leave it off if your importer reports an unknown first column such as id, which means it does not expect the marker.
Can it bring back characters that became question marks?
No. If a program already replaced letters with a plain ? when it saved the file, the original letters are gone. Export the data again from the source as UTF-8.