Difference between casefold() and lower() in Python Last Updated : 01 Mar, 2025 Comments Improve Suggest changes Like Article Like Report In this article, we will learn the differences between casefold() and lower() in Python. The string lower() is an in-built method in Python language. It converts all uppercase letters in a string into lowercase and then returns the string. Whereas casefold() method is an advanced version of lower() method, it converts the uppercase letter to lowercase including some special characters which are not specified in the ASCII table for example 'ß' which is a German letter and its lowercase letter is 'ss'.lower() method in PythonIn this example, we have stored a string in variable 's1' which includes uppercase letters, and converted it to lowercase using the lower() method.Syntax of lower(): string.lower()Parameters: It does not take any parameter.Returns: It returns a lowercase string of the given string. Python s1 = "GeeksForGeeks" s2 = s1.lower() print(s2) Outputgeeksforgeeks casefold() method in PythonIn this example, we have stored a German letter 'ß' in 's1' and converted it to lowercase using both methods casefold() and lower() and we can see in the output that casefold() converts it to lowercase whereas using lower(), the letter is printed as it is after conversion.Syntax of casefold(): string.casefold()Parameters: It does not take any parameter.Returns: It returns a lowercase string of the given string. Python s1 = "ß" s2 = s1.casefold() print("Using casefold() - ",s2) s3 = s1.lower() print("Using lower() - ",s3) OutputUsing casefold() - ss Using lower() - ß Difference between lower() and casefold() in PythonFeaturelower()casefold()PurposeConverts uppercase letters to lowercase.Converts uppercase letters to lowercase, including special characters and locale-specific cases.Handling of Special CharactersDoesn't handle special or language-specific cases.Handles special cases like German "ß" (sharp S) correctly (e.g., "ß".casefold() => "ss").Use CaseBasic lowercase conversion for general text processing.Best for case-insensitive comparisons, especially for multilingual text.Example"HELLO".lower() => "hello""HELLO".casefold() => "hello"Example with Special Characters"ß".lower() => "ß""ß".casefold() => "ss" Comment More infoAdvertise with us Next Article Difference between casefold() and lower() in Python S sagar99 Follow Improve Article Tags : Python Python-Functions Python-Built-in-functions Practice Tags : pythonpython-functions Similar Reads Difference between str.capitalize() and str.title() The primary difference between str.capitalize() and str.title() lies in their scope of capitalization. str.capitalize() only capitalizes the first character of the entire string and str.title() capitalizes the first character of every word in the string. Let's understand both str.capitalize() and st 2 min read Conditional Decorators in Python In Python, decorators are functions or classes that wrap around a function as a wrapper by taking a function as input and returning out a callable. They allow the creation of reusable building code blocks that can either change or extend behavior of other functions. Conditional Decorators Given a co 2 min read isupper(), islower(), lower(), upper() in Python and their applications Python provides several built-in string methods to work with the case of characters. Among them, isupper(), islower(), upper() and lower() are commonly used for checking or converting character cases. In this article we will learn and explore these methods:1. isupper() MethodThe isupper() method che 2 min read Python String casefold() Method Python String casefold() method is used to convert string to lowercase. It is similar to the Python lower() string method, but the case removes all the case distinctions present in a string. Python String casefold() Method Syntax Syntax: Â string.casefold() Parameters: The casefold() method doesn't t 1 min read How to lowercase strings in a column in Pandas dataframe Analyzing real-world data is somewhat difficult because we need to take various things into consideration. Apart from getting the useful data from large datasets, keeping data in required format is also very important. One might encounter a situation where we need to lowercase each letter in any spe 2 min read Like