Change CSV file encoding

·

2 min read

Changing the encoding of a CSV (Comma-Separated Values) file is a common task when you work with data from various sources. Different systems and applications may require or produce CSV files in specific encodings, such as UTF-8, ASCII, or ISO-8859-1. Encoding mismatches can lead to issues like garbled text or unreadable files, especially when dealing with non-English characters. In this post, I'll guide you through several methods to change the encoding of a CSV file, ensuring your data is compatible and correctly displayed across all platforms.

Using a Text Editor

  1. Notepad++ (Windows)

    • Open your CSV file in Notepad++.

    • Go to Encoding in the menu bar.

    • Choose Convert to UTF-8 (or another desired encoding).

    • Save your file.

  2. Sublime Text (Cross-platform)

    • Open your CSV file in Sublime Text.

    • From the bottom right, click on the encoding (e.g., UTF-8) to change it.

    • Select Save with Encoding and choose your preferred encoding.

    • Save the file.

These editors are beneficial for quick changes or when working with relatively small files.

Using Microsoft Excel

  1. Open your CSV file in Excel.

  2. Go to File > Save As.

  3. In the Save as type dropdown, select CSV (Comma delimited) (*.csv).

  4. Click on Tools near the Save button and select Web Options.

  5. Go to the Encoding tab and select the desired encoding from the dropdown.

  6. Save the file.