read_csv takes an encoding option to deal with files in different formats. I mostly use read_csv('file', encoding = "ISO-8859-1"), or alternatively encoding = "utf-8" for reading, and generally utf-8 for to_csv.

You can also use one of several alias options like 'latin' or 'cp1252' (Windows) instead of 'ISO-8859-1' (see python docs, also for numerous other encodings you may encounter).

See relevant Pandas documentation, python docs examples on csv files, and plenty of related questions here on SO. A good background resource is What every developer should know about unicode and character sets.

To detect the encoding (assuming the file contains non-ascii characters), you can use enca (see man page) or file -i (linux) or file -I (osx) (see man page).

Answer from Stefan on Stack Overflow
🌐
Saturn Cloud
saturncloud.io › blog › how-to-fix-the-pandas-unicodedecodeerror-utf8-codec-cant-decode-bytes-in-position-01-invalid-continuation-byte-error
How to Fix the Pandas UnicodeDecodeError utf8 codec cant decode bytes in position 01 invalid continuation byte Error | Saturn Cloud Blog
May 1, 2026 - Here are a few solutions: The most straightforward solution is to specify the encoding format when you read the file. For example, if your file is encoded in ISO-8859-1, you can read it with the following code: import pandas as pd df = ...
Discussions

Problem with Pandas read_csv always trying to read as UTF-8
https://pandas.pydata.org/docs/reference/api/pandas.read_csv.html What about the enconding_errors paramater? Either set to ignore or replace. More on reddit.com
🌐 r/learnpython
5
0
June 21, 2022
BUG: REGR: read_csv with memory_map=True raises UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc4 in position 262143: unexpected end of data
BUG: REGR: read_csv with memory_map=True raises UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc4 in position 262143: unexpected end of data#43540 ... BugIO CSVread_csv, to_csvread_csv, to_csvRegressionFunctionality that used to work in a prior pandas versionFunctionality that used to ... More on github.com
🌐 github.com
7
September 12, 2021
python - Pandas read csv file error UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte - Stack Overflow
How can you tell that `byte 0xff ... on the byte value. 2023-04-01T20:44:11.56Z+00:00 ... Hi, I updated my answer and linked a great material about BOMs and encodings. 2023-04-01T21:29:17.12Z+00:00 ... Find the answer to your question by asking. Ask question ... See similar questions with these tags. ... 8 Pandas: UnicodeDecodeError: 'utf-8' codec can't decode bytes in position ... More on stackoverflow.com
🌐 stackoverflow.com
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbb with read_excel function
import pandas as pd data = pd.read_excel(open("2016-07-12_Zuwendungsbericht_2015_OpenData.xlsx"), sheetname="Zuwendungsbericht", encoding="utf-8") I'm getting this error when I try to read this excel file: http://transparenz.bremen.de/sixcms/media.php/13/2016-07-12_Zuwendungsbericht_2015_OpenData.xlsx . UnicodeDecodeError: 'utf-8' codec can't decode byte ... More on github.com
🌐 github.com
5
January 2, 2017
🌐
Medium
medium.com › @anala007 › dealing-with-the-unicodedecodeerror-in-pandas-when-reading-csv-files-edc4987bf68b
Dealing with the UnicodeDecodeError in Pandas When Reading CSV Files | by Arun | Medium
June 12, 2023 - When working with data in Python, the Pandas library is a powerful tool that simplifies the process of data manipulation and analysis. One of the many things it’s great at is importing data from various formats, including CSV files. However, it’s not always a smooth process. You might sometimes run into an error such as UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf3 in position 74188: invalid continuation byte.
🌐
Reddit
reddit.com › r/learnpython › problem with pandas read_csv always trying to read as utf-8
r/learnpython on Reddit: Problem with Pandas read_csv always trying to read as UTF-8
June 21, 2022 -

I'm trying to read in a CSV file using pandas.read\_file(report), but I'm hitting this error message:

'utf-8' codec can't decode byte 0x93 in position 28: invalid start byte

I've also tried this with various encoding types, pandas.read_file(report, encoding='UTF-16')

but for some reason it has no effect on the error, it always shows as 'utf-8' The encoding line shows in my traceback so I know that it's there. Does anyone know why this is?

🌐
DataScientYst
datascientyst.com › pandas-read_csv-unicodedecodeerror-invalid-start-byte
How to Fix - UnicodeDecodeError: invalid start byte - during read_csv in Pandas
January 5, 2024 - from pathlib import Path import pandas as pd file = Path('../data/csv/file_utf-8.csv') file.write_bytes(b"\xe4\na\n1") # non utf-8 character df = pd.read_csv(file, encoding_errors='ignore') ... To prevent Pandas read_csv reading incorrect CSV data due to encoding use: encoding_errors='strinct' - which is the default behavior: ... Encoding suitable as the contents of a Unicode literal in ASCII-encoded Python source code, except that quotes are not escaped. Decode from Latin-1 source code.
🌐
Quora
quora.com › How-do-I-fix-a-Unicode-error-while-reading-a-CSV-file-with-a-pandas-library-in-Python-3-6
How to fix a Unicode error while reading a CSV file with a pandas library in Python 3.6 - Quora
Answer (1 of 6): import pandas as pd dataset=pd.read_csv(“Your_filename.csv”, encoding=”ISO-8859–1”) This will solve the UnicodeDecodeError: 'utf-8' codec can't decode byte 0xba in position 16: invalid start byte Happy Learning !!!
🌐
Dasboardai
dasboardai.com › blog › how-do-i-fix-an-unicode-error-in-python
How to fixed Encoding errors in pandas - DasBoardai.com
When handling data in Python, the Pandas library is an essential tool that makes data manipulation and analysis much easier. It's particularly useful for importing data from different formats like CSV files. However, the process isn’t always flawless, and you might occasionally encounter errors such as the UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf3 in position 74188: invalid continuation byte`.
Find elsewhere
🌐
Medium
medium.com › @ashishbindra2 › unicodedecodeerror-utf-8-codec-can-t-decode-byte-0x96-in-position-18-invalid-start-byte-477fff5d14e9
UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0x96 in position 18: invalid start byte | by Ashish bindra | Medium
November 12, 2024 - When Pandas reads a CSV file, by default it assumes the encoding is UTF-8, which is the most widely used character encoding standard. However, if the CSV file contains characters that are not valid UTF-8, Pandas will throw the following error: UnicodeDecodeError: 'utf-8' codec can't decode byte [byte] in position [position]: invalid continuation byte.
🌐
Finxter
blog.finxter.com › home › learn python blog › how to fix unicodedecodeerror when reading csv file in pandas with python?
How to Fix UnicodeDecodeError when Reading CSV file in Pandas with Python? - Be on the Right Side of Change
May 31, 2022 - Now, when you read the input files in the Pandas library in Python, you may encounter a certain UnicodeDecodeError. This primarily happens when you are reading a file that is encoded in a different standard than the one you are using. Consider the below error as a reference. UnicodeDecodeError: 'utf-8' codec can't decode byte 0xda in position 6: invalid continuation byte
🌐
GitHub
github.com › pandas-dev › pandas › issues › 43540
BUG: REGR: read_csv with memory_map=True raises UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc4 in position 262143: unexpected end of data · Issue #43540 · pandas-dev/pandas
September 12, 2021 - Encoding should # be applied to the de-compressed data. return content.decode(self.encoding, errors=self.errors) return content · As this function is called with size=256KB, it is clear that content buffer can split a multibyte character. When it happens, the utf-8 codec raises "unexpected end of data" error. The _MMapWrapper.read() method was added in REGR: memory_map with non-UTF8 encoding #40994 , so the bug is present in Pandas 1.2.5 and newer versions.
Author: pandas-dev
🌐
Kaggle
kaggle.com › code › paultimothymooney › how-to-resolve-a-unicodedecodeerror-for-a-csv-file
How to resolve a UnicodeDecodeError for a CSV file
February 7, 2020 - Explore and run AI code with Kaggle Notebooks | Using data from Demographics of Academy Awards (Oscars) Winners
🌐
GitHub
github.com › pandas-dev › pandas › issues › 15034
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbb with read_excel function · Issue #15034 · pandas-dev/pandas
January 2, 2017 - import pandas as pd data = pd.read_excel(open("2016-07-12_Zuwendungsbericht_2015_OpenData.xlsx"), sheetname="Zuwendungsbericht", encoding="utf-8") I'm getting this error when I try to read this excel file: http://transparenz.bremen.de/sixcms/media.php/13/2016-07-12_Zuwendungsbericht_2015_OpenData.xlsx . UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbb in position 14: invalid start byte ·
Author: pandas-dev
🌐
py4u
py4u.org › blog › python-pandas-to-excel-utf8-codec-can-t-decode-byte
How to Fix 'utf8' Codec Can't Decode Byte Error in Python Pandas to_excel When Exporting to Excel
When pandas exports data to Excel, it relies on libraries like openpyxl or xlsxwriter to write the file. If these libraries encounter non-UTF-8 characters, they throw a decode error. UnicodeDecodeError: 'utf-8' codec can't decode byte 0x92 in position 10: invalid start byte File "pandas/io/excel/_openpyxl.py", line 494, in _write_cells cell.value = val File "openpyxl/cell/cell.py", line 215, in value self._value = self._bind_value(value) File "openpyxl/cell/cell.py", line 191, in _bind_value value = str(value) UnicodeDecodeError: 'utf-8' codec can't decode byte 0x92 in position 10: invalid start byte
🌐
Data Science for Everyone
matthew-brett.github.io › cfd2019 › chapters › 07 › text_encoding
6.9 Text encoding - Coding for Data - 2019 edition
August 14, 2020 - import numpy as np import pandas as pd pd.set_option('mode.chained_assignment','raise') Consider the following annoying situation. You can download the data file from imdblet_latin.csv. ... UnicodeDecodeError Traceback (most recent call last) ... UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 1: invalid continuation byte
🌐
GitHub
github.com › dask › dask › issues › 10951
UnicodeDecodeError when using a Dataframe with byte data and pandas 2 · Issue #10951 · dask/dask
February 26, 2024 - ... File [env/lib/python3.10/site-packages/dask/base.py:375), in DaskMethodsMixin.compute(self, **kwargs) ... File lib.pyx:720, in pandas._libs.lib.ensure_string_array() File lib.pyx:813, in pandas._libs.lib.ensure_string_array() UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0: invalid start byte ·
Author: dask
🌐
Kaggle
kaggle.com › general › 378049
Unicode Decode Error: 'utf-8' codec | Kaggle
The "UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc2 in position 17309: invalid continuation byte" error occurs when you are trying to read a file that contains non-UTF-8 encoded characters using the pd.read_csv() function in pandas.
🌐
GeeksforGeeks
geeksforgeeks.org › python › how-to-resolve-a-unicodedecodeerror-for-a-csv-file-in-python
How to resolve a UnicodeDecodeError for a CSV file in Python? - GeeksforGeeks
July 23, 2025 - Hence the encoding of the CSV file needs to be mentioned while opening the CSV file to fix the error and allow the processing of the CSV file. ... Firstly, the pandas' library is imported, and the path to the CSV file is specified.