VOOZH about

URL: https://www.geeksforgeeks.org/c/tolower-function-in-c/

⇱ tolower() Function in C - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

tolower() Function in C

Last Updated : 29 May, 2025

C tolower() function is part of the C standard Library used to convert the uppercase alphabet to the lowercase alphabet. It does not affect characters other than uppercase characters.

Example


Output
a

Syntax of tolower()

The tolower() function is defined in the <ctype.h> header file.

where,

  • c: character that is to be converted. It is generally passed as integer that can represent an unsigned char.

Return Value

  • If the passed character is an uppercase character then it returns the ASCII value corresponding to the lowercase of the character passed as the argument.
  • If the passed character is already a lowercase or not a letter then it returns the same character.

Examples of tolower() Functions

The below examples demonstrate how to use the tolower() function in C:

Example 1

The below C program demonstrates the tolower() function.


Output
Original Character: M
After using tolower: m

Example 2

The below code converts all uppercase letters in the string to their lowercase equivalents, while leaving other characters unchanged.


Output
code_in_c_@0123
Comment