str.istitle()
str.istitle() Returns:
bool · Added in v3.x · Updated March 13, 2026 · String Methods string validation case
The .istitle() method checks whether a string follows title case rules. It returns True if each word in the string starts with an uppercase letter followed by lowercase letters. The method returns a boolean value, making it useful for validating titles, names, and other formatted text.
This method is part of Python’s suite of string classification methods. It’s commonly used for input validation, text processing, and ensuring consistent formatting. The key thing to remember is that .istitle() doesn’t just check if the first letter of each word is uppercase—it also requires that the rest of the letters in that word are lowercase.
Syntax
str.istitle()
Parameters
This method takes no parameters.
Examples
Basic usage
title = "Hello World"
print(title.istitle())
# True
lowercase = "hello world"
print(lowercase.istitle())
# False
# Mixed case fails
mixed = "Hello world"
print(mixed.istitle())
# False
Single words
# A single capitalized word is title case
print("Hello".istitle())
# True
print("hello".istitle())
# False
# Single character works too
print("A".istitle())
# True
print("a".istitle())
# False
Numbers and symbols
# Numbers at the start are ignored, letters after are checked
print("123Abc".istitle())
# True
# Symbols at the start are ignored too
print("!Hello".istitle())
# True
# Alphanumeric
print("Python3".istitle())
# True
Edge cases
# Multiple spaces are treated as word separators
print("Hello World".istitle())
# True
# Hyphens create separate words
print("Hello-World".istitle())
# True
# Underscores too
print("Hello_World".istitle())
# True
# Empty string returns False
print("".istitle())
# False
# Numbers only return False
print("123".istitle())
# False
# Punctuation only returns False
print("!!!".istitle())
# False
What fails
# Mixed case in a word fails
print("HeLLo World".istitle())
# False
# Lowercase after first uppercase fails
print("Hello worLd".istitle())
# False
# Numbers in the middle of words
print("1st Place".istitle())
# False (1st is treated as lowercase-ish)
Common Patterns
Validating user input
def format_as_title(text):
"""Ensure text is proper title case."""
if not text.istitle():
return text.title() # Convert to title case
return text
# Example usage
names = ["John Doe", "jane smith", "Alice Wonderland"]
formatted = [format_as_title(name) for name in names]
print(formatted)
# ['John Doe', 'Jane Smith', 'Alice Wonderland']
Processing a list of titles
titles = [
"The Great Gatsby",
"to kill a mockingbird",
"Pride and Prejudice",
"1984",
"ONE FLEW OVER THE CUCKOOS NEST"
]
# Find properly formatted titles
proper_titles = [t for t in titles if t.istitle()]
print(proper_titles)
# ['The Great Gatsby']
# Convert all to title case
title_cased = [t.title() for t in titles]
print(title_cased)
# ['The Great Gatsby', 'To Kill A Mockingbird', 'Pride And Prejudice', '1984', "One Flew Over The Cuckoos Nest"]
Input validation
def is_valid_book_title(title):
"""Validate that a book title follows title case."""
if not title:
return False
# Must be title case and have at least one letter
return title.istitle() and any(c.isalpha() for c in title)
print(is_valid_book_title("The Great Gatsby"))
# True
print(is_valid_book_title("the great gatsby"))
# False
print(is_valid_book_title("123"))
# False
Unicode Support
Python 3 handles Unicode case properly:
# Latin letters work as expected
print("Hello World".istitle())
# True
# Greek letters
greek = "Θαλής Μιλήσιος"
print(greek.istitle())
# True
cyrillic = "Война И Мир"
print(cyrillic.istitle())
# True
Behavior Notes
- Returns
Falsefor empty strings - Returns
Falsefor strings with no alphabetic characters - Each word is checked independently—words can be separated by spaces, tabs, newlines, or other whitespace characters
- Hyphens, underscores, and other word separators create separate words
- Unicode title case letters (category Lt) are recognized