str.title() Title case

Last updated: 2026-09-22

str.title() Title case

str.title() returns a titlecased version: first letter of each word uppercased, rest lowercased.

CategoryString Methods
KindBuilt-in Type Method
Python Versionall

📝 Syntax

str.title()

Returns:str. A titlecased copy of the string.

Mutates the original:No (returns a new object)

▶ Example

Edit the code, press Run, and see the result in the output panel:

Output:

Hello World
They'Re Here
More case studies coming soon — check back later.

❓ FAQ

QHow does title() behave with words containing apostrophes?
AIt is not smart enough. "they're".title() gives "They'Re", where the 're after the apostrophe is treated as a new word and capitalized. Be careful when processing English text.
QWhat is the difference from capitalize()?
Atitle() capitalizes the first letter of every word and lowercases the rest; capitalize() only capitalizes the very first character of the whole string and lowercases everything else.
QHow do I check whether a string is already in title format?
AUse istitle(). Note that a result produced by title() is not necessarily True for istitle(), for example "They'Re".
Web-Tutorial.com

Web-Tutorial Tech Team

A team of developers maintaining programming tutorials. Each tutorial is written and reviewed by developers with expertise in that field. We work to keep our content accurate and reliable — if you spot an issue, please let us know.

100%

🙏 帮我们做得更好

我们是刚上线的编程教程站,几个人的小团队,精力有限。页面虽经检查,难免还有疏漏——链接失效、排版错乱、内容有误、语言生硬……

如果您发现了,麻烦告诉我们,我们会在收到反馈后第一时间进行修复,再次感谢您的光临 🙏