Take the 2-minute tour ×

I have an Excel file that has some Spanish characters (tildes, etc.) that I need to convert to a CSV file to use as an import file. However, when I do Save As CSV it mangles the "special" Spanish characters that aren't ASCII characters. It also seems to do this with the left and right quotes and long dashes that appear to be coming from the original user creating the Excel file in Mac.

Since CSV is just a text file I'm sure it can handle a UTF8 encoding, so I'm guessing it is an Excel limitation, but I'm looking for a way to get from Excel to CSV and keep the non-Ascii characters in tact.

share|improve this question
stackoverflow.com/questions/155097/… /// –  belisarius Nov 19 '10 at 1:26
I saw that question before I posted but it is about already having a UTF8 CSV and opening it in Excel not the other way around. –  Jeff Treuting Nov 19 '10 at 6:36
The answers below seem to work, but they're just workarounds. Does anyone know how to make Excel do this? –  NielW Jan 27 at 21:43

24 Answers 24

up vote 161 down vote accepted

A simple workaround is to use Google Spreadsheet. Paste (values only if you have complex formulas) or import the sheet then download CSV. I just tried a few characters and it works rather well.

EDIT: Another alternative - basically they use VB macro or addins to force the save as UTF8. I have not tried any of these solutions but they sound reasonable.

share|improve this answer
Thanks. I already have a Google Docs account so this was easy to do. –  Jeff Treuting Nov 19 '10 at 7:10
I tried Notepad++ first and that worked only in some cases. This worked brilliantly. –  GotDibbs Aug 23 '12 at 22:07
Perhaps Joel Slotsky (former PM of Excel) could send them his decade-old post on The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets? –  Indolering May 23 '13 at 5:56
With the normal Windows Notepad (using save as, and then choosing utf-8 in the encoding option) worked for me. For me that's the best approach for me since that must be done by users that have no admin rights in their machines, so installing additional software is not required. –  Fer Oct 2 '13 at 9:06
OpenOffice JustWorks(tm) with no hassle - I think it should be included –  Robert Ševčík - Robajz Oct 2 '13 at 10:31

I've found OpenOffice's spreadsheet application, Calc, is really good at handling CSV data. In the "Save As..." dialog, click "Format Options" to get different encodings for CSV. LibreOffice works the same way AFAIK.

Hope this helps!

share|improve this answer
I'm sure this works, I just don't happen to have OpenOffice already so Google Docs was easier in my situation. but thanks for the suggestion –  Jeff Treuting Nov 19 '10 at 7:11
OpenOffice Calc has more and better options when opening and saving "CSV" files (field separators, encoding etc) than both Google Docs and Excel. Also, Google Docs currently suffers from a limit of 400,000 cells per spreadsheet, which OpenOffice Calc does not. –  Christian Davén Sep 20 '12 at 12:43
Thank you. I didn't think of firing OpenOffice up, you saved me so much time! –  Pablo Dec 4 '13 at 10:36
I can confirm LibreOffice also works: it offers character encoding options on export that are sadly lacking in Excel. –  Rupert Rawnsley Oct 28 at 11:28

I know this is an old question but I happened to come upon this question while struggling with the same issues as the OP.

Not having found any of the offered solutions a viable option, I set out to discover if there is a way to do this just using Excel.

Fortunately, I have found that the lost character issue only happens (in my case) when saving from xlsx format to csv format. I tried saving the xlsx file to xls first, then to csv. It actually worked.

Please give it a try and see if it works for you. Good luck.

share|improve this answer
Weird... but it works! –  SomaMan Mar 4 '13 at 15:00
Great, worked for me too! –  Marko D Apr 13 '13 at 13:50
For me, on Excel for Mac 2011, this works but only if I choose Windows comma separated (CSV). It doesn't work if I use the default or DOS CSV options - both these replace the accented characters with random junk characters. Tested for characters including é,è,â... Don't know if it's real UTF8 but the characters aren't mangled. –  user568458 Jul 30 '13 at 16:28
Quick confirmation - the files produced with this method on (Excel for Mac 2011) do not produce UTF-8 csvs, BUT, they do produce CSVs that at least contain the correct characters and can therefore can be painlessly converted to UTF8 in a text editor, which is a big step forward from the ludicrous mangled junk that Excel spits out by default. –  user568458 Jul 30 '13 at 16:55
Yes, agreed, this worked for me as well (Excel Mac 2011) and it really deserves more upvotes. –  cbmanica Sep 5 '13 at 0:16
  1. Save the Excel sheet as "Unicode Text (.txt)". The good news is that all the international characters are in UTF16 (note, not in UTF8). However, the new "*.txt" file is TAB delimited, not comma delimited, and therefore is not a true CSV.

  2. (optional) Unless you can use a TAB delimited file for import, use your favorite text editor and replace the TAB characters with commas ",".

  3. Import your *.txt file in the target application. Make sure it can accept UTF16 format.

I use this procedure to import data from Excel to Moodle.

share|improve this answer
Finally something that worked! Tried the above Excel options on Excel 2013 without success. I just switched to using \t as split character when I parsed it and it worked perfect! –  Mattias Lindberg Jan 6 at 8:16
Needed to export an XLS as CSV to import in MySQL. Using Excel 2003 I exported in format "Unicode Text (.txt)", then used Notepad++ to replace the TAB with ;, then imported the txt-file into phpmyadmin with default "Character set of the file: utf-8", Format "CSV using LOAD DATA". All encoding was transferred correctly. –  Echt Einfach TV May 26 at 17:29
For smaller files and simple data I use this shortcut: select the area or columns that I want to export, then copy (Ctrl+C). Then go to my text editor (for example, Gedit in Ubuntu) and paste. The text editor has all the data as TAB delimited. Then save as a text file, usually in UTF8. The final format may depend on your text editor configuration. –  elomage May 27 at 19:19
That's the best workaround for me! Now I can import import files via phpMyAdmin easily! –  LeandroCR Sep 26 at 15:13

You can use iconv command under Unix (also available on Windows as libiconv).

After saving as CSV under Excel in the command line put:

iconv -f cp1250 -t utf-8 file-encoded-cp1250.csv > file-encoded-utf8.csv

(remember to replace cp1250 with your encoding).

Works fast and great for big files like post codes database, which cannot be imported to GoogleDocs (400.000 cells limit).

share|improve this answer
That is useless if your content contains characters which can not be encoded in 1250, a better way would be to export as "Unicode .txt" in Excel and use iconv to convert from Utf16. Maybe also do a sed or tr to translate from '\t' to ',' –  Sebastian Godelet Jul 5 at 13:11
Excel's default encoding seems to be CP858 when saving as CSV or MS-DOS CSV, and Windows 1252 when saving as Windows CSV (as tested on Excel for Mac 2011). –  claymation Jul 30 at 18:45

"nevets1219" is right about Google docs, however if you simply "import" the file it often does not convert it to UTF-8.

But if you import the CSV into an existing Google spreadsheet it does convert to UTF-8.

Here's a recipe:

  • On the main Docs (or Drive) screen click the "Create" button and choose "Spreadsheet"
  • From the "File" menu choose "Import"
  • Click "Choose File"
  • Choose "Replace spreadsheet"
  • Choose whichever character you are using as a Separator
  • Click "Import"
  • From the "File" menu choose "Download as" -> CSV (current sheet)

The resulting file will be in UTF-8

share|improve this answer

Another one I've found useful: "Numbers" allows encoding-settings when saving as CSV.

share|improve this answer
Could you elaborate a bit, please? –  Pere Sep 16 at 15:02
^ it's an application in Mac OSX –  ToonSuperLove Dec 20 at 0:18

For those looking for an entirely programmatic (or at least server-side) solution, I've had great success using a combination of catdoc's xls2csv tool and iconv with the following:

Install catdoc:

apt-get install catdoc

Do the conversion:

xls2csv file.xls > file-cp1252.csv 
iconv -f cp1252 -t utf-8 file-cp1252.csv > file-utf8.csv

This is blazing fast and has worked without a hitch for me so far.

share|improve this answer

Microsoft Excel has an option to export spreadsheet using Unicode encoding. See following screenshot.

enter image description here

share|improve this answer
"Unicode Text" saves in UTF-16 LE (Little Endian), not in UTF-8 as asked by the OP. –  ax. Jul 18 '12 at 7:22
Yes, but it is the best way to get Unicode support for your x-separated-values in Excel. I've had all sorts of issues trying to get Excel to play ball with UTF-8! Read More –  mcNux Apr 24 '13 at 16:15

Assuming an Windows environment, save and work with the file as usual in Excel but then open up the saved Excel file in Gnome Gnumeric (free). Save Gnome Gnumeric's spreadsheet as CSV which - for me anyway - saves it as UTF-8 CSV.

share|improve this answer

open .csv fine with notepad++. if you see your encoding is good (you see all characters as they should be) press encoding , then convert to ANSI else - find out what is your current encoding

share|improve this answer
that worked for me.. had problem with greek characters when exportedmysql db as csv and imported it to excel.. –  nikolas May 24 '13 at 9:47

another solution is to open the file by winword and save it as txt and then reopen it by excel and it will work ISA

share|improve this answer

Easy way to do it: download open office (here), load the spreadsheet and open the excel file (.xls or .xlsx). Then just save it as a text CSV file and a window opens asking to keep the current format or to save as a .ODF format. select "keep the current format" and in the new window select the option that works better for you, according with the language that your file is been written on. For Spanish language select Western Europe (Windows-1252/ WinLatin 1) and the file works just fine. If you select Unicode (UTF-8), it is not going to work with the spanish characters.

share|improve this answer
  1. Save xls file (Excel file) as Unicode text=>file will be saved in text format (.txt)

  2. Change format from .txt to .csv (rename the file from XYX.txt to XYX.csv

share|improve this answer
the simpliest solution, worked for me –  Xylian May 14 at 9:12

A second option to "nevets1219" is to open your CSV file in Notepad++ and do a convertion to ANSI.

Choose in the top menu : Encoding -> Convert to Ansi

share|improve this answer
No idea why you were downvoted. Notepad++ did it for me. Can't store my file in Google Spreadsheet as it is confidential. –  Zane Mar 28 '13 at 17:55

I was not able to find a VBA solution for this problem on Mac Excel. There simply seemed to be no way to output UTF-8 text.

So I finally had to give up on VBA, bit the bullet, and learned AppleScript. It wasn't nearly as bad as I had thought.

Solution is described here: http://talesoftech.blogspot.com/2011/05/excel-on-mac-goodbye-vba-hello.html

share|improve this answer

I used the following solution: Mac Exel 2008 > file > Save-as and then under format use MS_DOS Comma Separated (.csv). Worked perfect.

share|improve this answer
The question was specifically about UTF-8. –  Olivier 'Ölbaum' Scherler Jul 24 '12 at 6:48

Another way is to open the UTF-8 CSV file in Notepad where it will be displayed correctly. Then replace all the "," with tabs. Paste all of this into a new excel file.

share|improve this answer

What about using Powershell.

Get-Content 'C:\my.csv' | Out-File 'C:\my_utf8.csv' -Encoding UTF8
share|improve this answer

As funny as it may seem, the easiest way I found to save my 180MB spreadsheet into a UTF8 CSV file was to select the cells into Excel, copy them and to paste the content of the clipboard into SublimeText.

share|improve this answer

Encoding -> Convert to Ansi will encode it in ANSI/UNICODE. Utf8 is a subset of Unicode. Perhaps in ANSI will be encoded correctly, but here we are talking about UTF8, @SequenceDigitale.

There are faster ways, like exporting as csv ( comma delimited ) and then, opening that csv with Notepad++ ( free ), then Encoding > Convert to UTF8. But only if you have to do this once per file. If you need to change and export fequently, then the best is LibreOffice or GDocs solution.

share|improve this answer
Welcome so SO! You may edit your own answers, so there is no need to answer twice - you can always add to your old answer. –  malenkiy_scot Jun 7 '12 at 8:33
"Utf8 is a subset of Unicode": this makes no sense. UTF-8 is an encoding of Unicode. –  jameshfisher Mar 10 at 18:47

And for those who have sublime text: save with encoding utf-16 LE with BOM should do it ;-)

share|improve this answer

(On a Mac:) From Excel save as CSV file. Open the CSV file in TextWrangler (it’s free) and use "save as". In the save dialog choose Unicode (UTF-8). Done

(I guess you can do this with TextEdit also - if you play with the open and save settings. Try Open files: auto, Save files: UTF-8)

share|improve this answer

You can save excel as unicode text, it is tab-delimited.

share|improve this answer
Does not answer question. –  Superbest Oct 6 '12 at 20:54

protected by Community Mar 14 '13 at 20:06


Would you like to answer one of these unanswered questions instead?
