How to Make a String Lowercase in Python with lower()
"Basil" and "basil" are different strings to Python, so a check like plant == "basil" fails as soon as someone types a capital letter. lower() gives you a lowercase copy of the text, which makes such checks work. This guide does it on Python 3.15.2.
Syntax
<lowercase_text> = <text>.lower()
| Part | What it means |
|---|---|
<text> | The string to convert |
.lower() | Returns a new string with every letter in lowercase |
<lowercase_text> | The new string. <text> itself doesn't change |
The Python documentation says str.lower() will "Return a copy of the string with all the cased characters converted to lowercase."
The Example
A variable holds the plant name Basil, with a capital B. The script prints it in lowercase, prints the original to show that it didn't change, and then compares the lowercase version with "basil".
Prerequisites
- uv and Python 3. This guide uses uv 0.13.10 with Python 3.15.2, in a project made with
uv init.
Step 1: Write the Script
plant = "Basil"
print(plant.lower())
print(plant)
print(plant.lower() == "basil")

Step 2: Run It
uv run python lowercase.py
basil
Basil
True

plant.lower() gave basil. plant itself still says Basil, because Python strings can't be changed: the documentation calls them "immutable sequences of Unicode code points", so lower() builds a new string instead. The comparison is True because the lowercase copy matches "basil" exactly. That's how you check text without caring about capital letters. The command works unchanged in PowerShell.
Common Mistakes
| Mistake | What happens | Do this instead |
|---|---|---|
Leaving off the parentheses: plant.lower | Python prints the method itself instead of calling it: <built-in method lower of str object at 0x100c138a0>, with a different address after at on each run | Add the parentheses: plant.lower() |
Expecting plant.lower() to change plant | plant still prints Basil | Save the result: after plant = plant.lower(), print(plant) printed basil |
FAQ
What about letters like ß?
lower() leaves ß alone, because it's already lowercase. casefold() goes further: "Straße".lower() gave straße, while "Straße".casefold() gave strasse. The documentation explains that "Casefolding is similar to lowercasing but more aggressive because it is intended to remove all case distinctions in a string." Use casefold() when you compare text that can contain such letters.
Does lower() change anything that isn't a letter?
No. It only converts "cased characters", the letters that have an uppercase and a lowercase form. "Plant 2: BASIL!".lower() gave plant 2: basil!: the digit, the colon, the space and the exclamation mark stayed as they were.
Conclusion
plant.lower() returned basil, a new lowercase string, while plant stayed Basil. Comparing the lowercase copy with "basil" gave True.
Additional Resources
- str.lower() — the method and how it lowercases.
- str.casefold() — the stronger version for comparing text.
- Text sequence type: str — Python strings and their methods.
