Python String lower() Method
The Python string lower() method returns a lowercase version of a string.
It is useful when you want to:
- convert text to lowercase
- compare text without case differences
- clean up user input
- make simple text matching easier
text = "Hello WORLD"
result = text.lower()
print(result) # hello world
Important: lower() returns a new string. It does not change the original string in place.
What lower() does
lower() is a string method that changes uppercase letters to lowercase letters.
Key points:
lower()returns a lowercase version of a string- It works on string objects
- It creates and returns a new string
- The original string stays unchanged
If you are new to strings, see what a string is in Python or learn more in Python strings explained.
Basic syntax
The syntax is:
string.lower()
Important details:
- It takes no arguments
- You call it directly on a string
- You can use it on a string literal or a string variable
Example:
print("HELLO".lower()) # hello
name = "PyThOn"
print(name.lower()) # python
Simple example
Here is a basic example with a variable:
text = "Hello WORLD"
lower_text = text.lower()
print(lower_text)
print(text)
Output:
hello world
Hello WORLD
This shows two things:
lower()returns the lowercase result- the original
textvariable does not change unless you reassign it
If you want to keep the lowercase version in the same variable, reassign it:
text = "Hello WORLD"
text = text.lower()
print(text) # hello world
Return value
lower() returns a string.
That means you can store the result in a variable, print it, or use it in comparisons.
A common beginner use case is comparing text in a case-insensitive way:
answer = "YES"
if answer.lower() == "yes":
print("Correct")
This is especially useful with the input() function:
answer = input("Type yes or no: ")
if answer.lower() == "yes":
print("You typed yes")
else:
print("You typed something else")
Common use cases
lower() is often used to normalize text before working with it.
Common examples:
- Normalize user input before comparison
- Make text matching easier
- Prepare text for simple searches
- Clean mixed-case data
Example: checking user input
color = input("What is your favorite color? ")
if color.lower() == "blue":
print("Nice choice!")
else:
print("Got it.")
Example: simple search
message = "Python Is Fun"
if "python" in message.lower():
print("Found it")
If you also need to remove extra spaces, lower() is often used with strip():
name = " ALICE "
clean_name = name.strip().lower()
print(clean_name) # alice
Important beginner note
Strings are immutable in Python.
That means a string cannot be changed in place. Methods like lower() do not edit the original string. They return a new one.
So this does not update the original variable:
text = "HELLO"
text.lower()
print(text) # HELLO
To keep the lowercase version, save the result:
text = "HELLO"
text = text.lower()
print(text) # hello
Common mistakes
Forgetting parentheses
A very common mistake is writing lower instead of lower().
Wrong:
text = "HELLO"
print(text.lower)
This prints the method itself, not the lowercase string.
Correct:
text = "HELLO"
print(text.lower())
Not saving the result
Another common mistake is expecting the original variable to change automatically.
Wrong:
text = "HELLO"
text.lower()
print(text) # still HELLO
Correct:
text = "HELLO"
text = text.lower()
print(text) # hello
Using lower() on a non-string value
lower() only works on strings.
Wrong:
number = 123
print(number.lower())
This causes an error because integers do not have a lower() method.
You can check the type first:
text = "HELLO"
print(type(text))
print(text.lower())
Comparing text without normalizing case
This can cause unexpected results:
answer = "Yes"
if answer == "yes":
print("Match")
else:
print("No match")
Because "Yes" and "yes" are different strings, this prints No match.
Better:
answer = "Yes"
if answer.lower() == "yes":
print("Match")
When casefold() may be better
For most beginner examples, lower() is enough.
But for advanced Unicode case-insensitive matching, casefold() can be stronger than lower().
For everyday beginner tasks like input checking and simple comparisons, lower() is usually the right choice.
lower() vs upper()
lower() and upper() are very similar.
lower()changes letters to lowercaseupper()changes letters to uppercase- Both return new strings
- Both leave the original string unchanged unless you reassign the result
Example:
text = "Hello World"
print(text.lower()) # hello world
print(text.upper()) # HELLO WORLD
If you want the opposite conversion, see the Python string upper() method.
FAQ
Does lower() change the original string?
No. It returns a new lowercase string. Reassign it if needed.
Does lower() take any arguments?
No. The method is called as string.lower().
What does lower() return?
It returns a new string with lowercase letters.
Can I use lower() on user input?
Yes. It is commonly used with input() to compare answers without case problems.
What is the difference between lower() and casefold()?
lower() is simpler and common for beginners. casefold() is stronger for some Unicode case-insensitive comparisons.