How to Apply UTF 8 Encoding on CSV File in Excel

What Is UTF-8 Encoding?

The UTF-8 encoding is the most used character encoding for the internet. It is used in emails and web pages. It allows access to both Unicode standard characters and ASCII characters.


How to Apply UTF-8 Encoding on a CSV File in Excel: 2 Ways

Method 1 – Using the Save As Command

Steps:

  • Open the CSV file in Excel.
  • Go to the File tab.

going to file tab to apply utf 8 encoding on csv file in excel

  • Choose the Save As command.
  • From the drop-down list, choose CSV UTF-8 (Comma Delimited) (*.csv) option.
  • Click on Save.

using save as command to apply utf 8 encoding on csv file in excel

Read More: [Fixed!] CSV UTF 8 Not Available in Excel


Method 2 – Applying VBA to Encode a CSV File

Steps:

  • Go to the Developer tab and select Visual Basic.

going to visual basic module to apply utf 8 encoding on csv file in excel

  • The VBA editor will appear.
  • Select Insert and choose Module to open a VBA Module.

  • Enter the following code in the Module and Save the code.
Sub EncodingToUTF8()
  Dim AM_WS As Worksheet
  Dim AM_Path As String
  Application.ScreenUpdating = False
  AM_Path = ActiveWorkbook.Path & "\" & _
  Left(ActiveWorkbook.Name, InStr(ActiveWorkbook.Name, ".") - 1)
  For Each AM_WS In Worksheets
    AM_WS.Copy
    ActiveWorkbook.SaveAs Filename:=AM_Path & "_" & AM_WS.Name _
    & ".csv", FileFormat:=xlCSVUTF8, CreateBackup:=False
    ActiveWorkbook.Close False
  Next
  Application.ScreenUpdating = True
End Sub

writing and saving code to apply utf 8 encoding on csv file in excel

We named the Subroutine as EncodingToUTF8. The first variable is AM_WS which is a Worksheet variable. The second one is AM_Path and it is a String type variable. In the next few lines, the code takes each worksheet and changes its name to Workbook name_Worksheet name.csv in this format. The FileFormat:=xlCSVUTF8 line encodes each CSV file with UTF-8 encoding.

  • Click the Run button.

running vba code to apply utf 8 encoding on csv file in excel

  • All the sheets will be converted.

using vba code to apply utf 8 encoding on csv file in excel

Read More: How to Encode Data in Excel


How to Open a UTF-8 Encoded CSV File in Excel Without Changing the Language Format

Steps:

  • Go to the Data tab.
  • Click on the Get Data command.
  • From the drop-down, select From File.
  • Select From Text/CSV.

 

  • Select the CSV file and click on Import.
  • A new window will appear on the screen.

  • Under the File Origin, choose 65001:Unicode (UTF-8).
  • Select a Comma as the Delimiter.
  • Click on Load.

  • The CSV file data will be loaded to Excel without any change in formatting.

Read More: How to Change Encoding in Excel


Download the Practice Workbook


Related Articles


<< Go Back to Excel Encoding | Excel Files | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Adnan Masruf
Adnan Masruf

Adnan Masruf, holding a BSc in Naval Architecture & Engineering from Bangladesh University of Engineering and Technology, plays a pivotal role as an Excel & VBA Content Developer at ExcelDemy. His deep passion for research and innovation seamlessly aligns with his dedication to Excel. In this capacity, Masruf not only skillfully addresses challenging issues but also exhibits enthusiasm and expertise in gracefully navigating intricate situations, underscoring his steadfast commitment to consistently delivering exceptional content. His interests... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo