Python lower() Method

Beginner
5 min read
Updated: Nov 2026
3 examples
String

Definition

lower() makes every letter in a string lower case, so "HeLLo" becomes "hello". Digits, spaces, and punctuation have no case, so they stay exactly as they were.

A string is immutable, so lower() never edits the string you call it on. It builds and returns a new string, and you decide whether to print it or store it. It is the standard first step before comparing text, such as emails or commands, without caring about capital letters.

text.lower() is a method of the built-in str type: call it on a string with dot notation. No import is needed, and it never changes the original string.

Syntax

Call it on any string. There are no arguments, but the parentheses are required.

python
result = text.lower()
CallWhat it does
"PyThOn".lower()Returns 'python'.
"ABC 123!".lower()Returns 'abc 123!'. Digits, spaces, and symbols are left alone.
"already lower".lower()Returns 'already lower', a new string with the same content.

For case-insensitive comparisons of international text, casefold() is stronger. To change the other way use upper(), and to capitalize only the first letter use capitalize().

Library declarations
python
str.lower() -> str
# returns: a new string; the original is unchanged
# raises: nothing (works for any string)

Parameters

lower() takes no arguments. It always works on the whole string.

Return Value

Return ValueDescription
strA new string in which every cased character is lower case. The original string is not changed.

Python Examples

Example 1 — Convert a Title to Lower Case

Call lower(), then check that the original string is untouched.

python
title = "Hello, PYTHON World!"
small = title.lower()

print(small)
print(title)
print(small == "hello, python world!")

How It Works

  1. A new string. lower() returns "hello, python world!" and stores it in small.
  2. The original stays. title still prints with its capital letters, because strings cannot be edited in place.
  3. Punctuation is kept. The comma, space, and exclamation mark have no case, so the comparison with the all-lower text is True.

Example 2 — Compare Text Without Caring About Case

Clean up what a user typed, then compare it with a saved value and with a command.

python
saved = "Admin"
typed = "  ADMIN "

print(typed.strip().lower() == saved.lower())
print(typed == saved)

for command in ["Start", "STOP", "Pause"]:
    if command.lower() == "stop":
        print("stopping")

How It Works

  1. Lower both sides. typed.strip().lower() removes the extra spaces and the capitals, and saved.lower() does the same for the saved name, so they match.
  2. A plain comparison is strict. typed == saved is False, because " ADMIN " and "Admin" are different strings.
  3. Commands in any case. Only "STOP" equals "stop" once lowered, so the loop prints one line.

Example 3 — Treat Emails in Different Cases as the Same

Lower every address, then let a set drop the duplicates.

python
emails = ["[email protected]", "[email protected]", "[email protected]"]
unique = {email.lower() for email in emails}

print(sorted(unique))
print(len(emails), len(unique))

How It Works

  1. Lower inside the loop. The set comprehension calls email.lower() on every address before adding it.
  2. Duplicates collapse. "[email protected]" and "[email protected]" both become "[email protected]", and a set keeps one copy.
  3. Three in, two out. The list still has 3 addresses, while the set of lowered addresses has 2.

Frequently Asked Questions

It returns a copy of the string with every letter converted to lower case. Digits, spaces, and punctuation are unchanged.
No. Strings are immutable, so lower() returns a new string. Assign the result, for example text = text.lower(), to keep it.
Lower both sides before comparing, as in a.lower() == b.lower(). For international text use casefold() instead of lower().
casefold() is more aggressive and is meant for caseless matching. For example it turns the German sharp s into "ss", while lower() keeps it unchanged.
Call islower(), which returns True when every letter is lower case and there is at least one letter.

Next: lstrip()

Return a copy with leading whitespace, or chosen characters, removed from the left end.

lstrip() tutorial →

CODETOFUN NEWS

Stay Ahead in Tech

Get the latest IT news, programming updates, and technology trends directly on your phone.

Your daily dose of tech, straight to your feed.

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

14 people found this page helpful