As a Python developer, I was working on a data-cleaning project where I had to process large CSV files exported from a U.S. retail system. The issue was that many of the text fields came wrapped in single or double quotes.
At first, I thought Python would have a built-in way to strip quotes from strings. But it turns out, there isn’t a single “one-click” solution. Instead, we can use a few simple methods to handle this quickly.
In this tutorial, I’ll walk you through five easy ways to remove quotes from a string in Python. I’ll share the exact code I use in my projects so you can apply it right away.
Method 1: Use str.replace in Python
In Python, the str.replace() method is a simple way to replace all occurrences of a substring within a string. To remove all double quotes from a string in Python, we replace them with an empty string.
Consider the following example:
input_string = "Always Keep a Positive Mindset"
resultant_string = input_string.replace('"', '')
print(resultant_string)I want to replace(“”) from the first argument, and then the second argument is the new substring, an empty string in Python.
Output:
Always Keep a Positive MindsetYou can refer to the screenshot below to see the output.

I used this input_str.replace the (‘”‘, ”) line of code to initiate the replacement process.
Method 2: Use Regular Expression
Python provides a re module for complex string manipulation. It allows for pattern matching and can remove double quotes under specific conditions or patterns.
import re
thought = "Believe you can you're halfway there."
output_string = re.sub('"', '', thought)
print(output_string)output_string = re.sub('"', '', thought)Output:
Believe you can you're halfway there.You can refer to the screenshot below to see the output.

The re.sub() function from the re module in Python replaces occurrences of a pattern with the first argument in a string and the third argument with a replacement string, i.e., the second argument.
Method 3: Use the str.translate() with str.maketrans()
The str.translate() method in Python is used for removing specific characters from a string. We use it with str.maketrans() to remove double quotes from a string.
input_string = "Nothing is impossible. The word itself says 'I'm possible!"
translator = str.maketrans('', '', "'")
output_string = input_string.translate(translator)
print(output_string)translator = str.maketrans('', '', "'")
output_string = input_string.translate(translator)Output:
Nothing is impossible. The word itself says Im possible!You can refer to the screenshot below to see the output.

In the str.maketrans() function, the argument is a string of characters to be removed from the source string. Along with this, we used the str.translate() function to remove the double quotes in Python.
Method 4: Use list comprehension
List comprehension is a brief way to process elements in a collection. We can use the approach to remove quotes from a string using list comprehension.
input_text = '"Stay focused desciplined, and determined always"'
result = ''.join([char for char in input_text if char != '"'])
print(result)Output:
Stay focused desciplined, and determined alwaysYou can refer to the screenshot below to see the output.

This method uses list comprehension to filter out quotation marks and join the remaining characters into a clean string.
Method 5: Use filter() method in Python
Python’s filter() function can filter out characters we don’t want in our string, like double quotes.
input_quote = "Hard Work Is The Formula For Success"
output_quote = ''.join(filter(lambda x: x != '"', input_quote))
print(output_quote)output_quote = ''.join(filter(lambda x: x != '"', input_quote))Output:
Hard Work Is The Formula For SuccessThis is the full source code of Python to remove a quote from a string using the filter() method.

I used the lambda function in the filter() function for each character in input_quote, keeping only those that are not double quotes, and the join function is used to concatenate the filter characters into a new string.
Conclusion
In this article, I have described the various methods to remove quotes from a string in Python, like str.replace(), regular expression(re), str.translate() with str.maketrans(), list comprehension, and using the filter() method.
I hope this helps you understand the step-by-step procedure to remove quotes from strings with illustrative examples.
You may also like to read:
- Try except in Python while Loop
- For loop vs while loop in Python
- Python For Loop with Index
- Use Python While with Assignment

I am Bijay Kumar, a Microsoft MVP in SharePoint. Apart from SharePoint, I started working on Python, Machine learning, and artificial intelligence for the last 5 years. During this time I got expertise in various Python libraries also like Tkinter, Pandas, NumPy, Turtle, Django, Matplotlib, Tensorflow, Scipy, Scikit-Learn, etc… for various clients in the United States, Canada, the United Kingdom, Australia, New Zealand, etc. Check out my profile.