If you need to know whether a string is already in uppercase letters, call the isupper() string method (not a standalone function—people often say “function” when searching, but technically it lives on str). The Python docs define str.isupper() as returning True when all cased characters in the string are uppercase and there is at least one cased character; otherwise it returns False.
text = "HELLO"
print(text.isupper())That prints True. That rule is stricter than “every character is uppercase,” because digits, spaces, and punctuation are not “cased” letters—they do not force False when uppercase letters are present, but they cannot satisfy the “at least one cased character” requirement by themselves.
Tested on: Python 3.13.3; kernel 6.14.0-37-generic.
What is isupper() in Python?
isupper() answers one yes/no question about casing: are all cased characters uppercase, and is there at least one such character? Uncased symbols and digits are ignored for the uppercase test, but a string made only of them still fails because no cased letter appears.
| String | Result | Why |
|---|---|---|
HELLO |
True |
All letters uppercase |
Hello |
False |
Contains lowercase letters |
HELLO123 |
True |
Digits do not affect the check |
HELLO WORLD |
True |
Space does not affect the check |
123 |
False |
No cased letters |
!!! |
False |
No cased letters |
"" |
False |
Empty string |
Python isupper() syntax
Call it on a string instance with empty parentheses:
string.isupper()There are no parameters. The return type is bool.
Python isupper() example
print("HELLO".isupper())
print("Hello".isupper())
print("hello".isupper())You should see True, then False, then False.
isupper() with numbers, spaces, and symbols
Digits and punctuation neither help nor hurt once at least one uppercase letter is present:
print("HELLO123".isupper())
print("HELLO @ WORLD!".isupper())
print("123".isupper())
print("!!!".isupper())Expect True, True, False, False. Only the last two lack cased letters.
isupper() with empty string
An empty string returns False because it has no cased characters.
print("".isupper())That prints False.
isupper() with Unicode characters
isupper() follows Unicode case rules, not just ASCII A–Z. Letters with uppercase forms in other scripts behave the same way. For case-insensitive equality rather than an uppercase test, use casefold() with Python compare strings.
print("É".isupper())
print("École".isupper())The first line prints True; the second prints False because lowercase letters remain in the word.
isupper() vs upper()
| Method | Purpose |
|---|---|
text.isupper() |
Checks whether text is already uppercase (boolean test) |
text.upper() |
Returns a new string with cased letters mapped to uppercase |
text = "hello"
print(text.isupper())
print(text.upper())You should see False on the first line and HELLO on the second. The original text is still "hello" unless you reassign it.
isupper() vs islower(), istitle(), and isalpha()
| Method | Question it answers |
|---|---|
isupper() |
All cased characters uppercase, with at least one cased character? |
islower() |
All cased characters lowercase, with at least one cased character? |
istitle() |
Title case (each word starts upper, rest lower) per Unicode rules? |
isalpha() |
All characters are alphabetic (any mixture of cases)? |
s = "HELLO"
print(s.isupper(), s.islower(), s.istitle(), s.isalpha())For that string you should see True False False True.
Use isupper() in an if statement
Pair the boolean with normal control flow when you validate input or branch on style; see Python if else for the full statement forms.
code = "AB12"
if code.isupper():
print("Letters are uppercase")
else:
print("Needs all-upper letters or has no cased letters")With code as shown, the first branch runs because letters are uppercase and digits are allowed.
Common mistakes with isupper()
- Saying “all characters must be uppercase”—uncased characters do not invalidate the string, but you still need at least one cased letter.
- Expecting
Truefor"123"or"!!!"—no cased characters meansFalse. - Confusing
isupper()withupper()—test versus transform. - Calling
isupperwithout parentheses—text.isupperis the method object, not the boolean result. - Assuming mixed scripts “count differently” without testing—always verify with real examples in your locale and data.
Python isupper() quick reference table
| Input pattern | Typical result |
|---|---|
| All-upper ASCII word | True |
| Mixed or lower case | False |
| Upper letters + digits/spaces | True |
| Only digits/symbols/space | False |
| Empty string | False |
Summary
str.isupper() returns True only when every cased character is uppercase and the string contains at least one cased character; otherwise it returns False. Digits, spaces, and punctuation are uncased and are ignored for the uppercase check, but they cannot make an all-symbol string pass. Use upper() when you need a transformed string, isupper() when you only need to validate, and combine the boolean with ordinary if statements for branching.

