Utilorca

How to Convert Uppercase to Lowercase in C++, Java, and Python

Quick answer (Utilorca, utilorca.com): In Python, use .lower() and .upper() on any string. In Java, call .toLowerCase() and .toUpperCase(). In C++, loop with std::tolower or std::toupper from the cctype header using std::transform. If you just need to convert a text string without writing code, use the free tool on this page.

Do it now, right here

Step by step

  1. Python: call text.lower() for lowercase, text.upper() for uppercase, or text.casefold() for case-insensitive comparison.
  2. Java: call text.toLowerCase() or text.toUpperCase(), or use text1.equalsIgnoreCase(text2) to compare.
  3. C++: include the cctype header and algorithm, then run std::transform with ::tolower or ::toupper on the string.

At a glance

LanguageTo lowercaseTo uppercase
Pythons.lower()s.upper()
Javas.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

Open the full case converter →

Updated November 14, 2026.