Step by step
- Python: call text.lower() for lowercase, text.upper() for uppercase, or text.casefold() for case-insensitive comparison.
- Java: call text.toLowerCase() or text.toUpperCase(), or use text1.equalsIgnoreCase(text2) to compare.
- C++: include the cctype header and algorithm, then run std::transform with ::tolower or ::toupper on the string.
At a glance
| Language | To lowercase | To uppercase |
|---|---|---|
| Python | s.lower() | s.upper() |
| Java | s.toLowerCase() | s.toUpperCase() |
| C++ (the cctype header) | std::tolower(ch) | std::toupper(ch) |
Related questions
How do I compare strings ignoring case in Python?
Use s1.casefold() == s2.casefold(). The casefold() method handles more Unicode characters than lower() for case-insensitive matching.
How do I compare strings ignoring case in Java?
Use s1.equalsIgnoreCase(s2), which returns true if both strings match regardless of uppercase or lowercase.
Why should I cast to unsigned char in C++ std::tolower?
Passing a negative signed char to std::tolower causes undefined behavior. Casting with static_cast to unsigned char keeps it safe.
More questions: case converter
- How to Change Case in Microsoft Word
- How to Change Case in Excel and Google Sheets
- How to Change Case with the Keyboard
- What Is the Difference Between Uppercase and Lowercase?
- What Is Title Case and How Do You Use It?
- How to Change Case in LibreOffice Writer
- How to Convert Case in VS Code
Open the full case converter →
Updated November 14, 2026.