There is no function that does this in the C standard. Unix systems that comply with POSIX are required to have strcasecmp in the header strings.h; Microsoft systems have stricmp. To be on the portable side, write your own:

int strcicmp(char const *a, char const *b)
{
    for (;; a++, b++) {
        int d = tolower((unsigned char)*a) - tolower((unsigned char)*b);
        if (d != 0 || !*a)
            return d;
    }
}

But note that none of these solutions will work with UTF-8 strings, only ASCII ones.

🌐
curl
daniel.haxx.se › blog › 2022 › 05 › 19 › case-insensitive-string-comparisons-in-c
case insensitive string comparisons in C | daniel.haxx.se
May 23, 2022 - Back in 2008, I had a revelation when it dawned on me that the POSIX function called strcasecmp() compares strings case insensitively, but locale dependent. Because of this, “file” and “FILE” is not actually a case insensitive match in Turkish but is a match in most other locales. curl ...
🌐
freeCodeCamp
freecodecamp.org › news › strcmp-in-c-how-to-compare-strings-in-c
strcmp in C – How to Compare Strings in C
April 27, 2023 - To compare case-insensitive strings, use a custom function like strcasecmp() or a standard library function like stricmp().
🌐
Cprogramming
cboard.cprogramming.com › c-programming › 115060-case-insensitive-string-comparison.html
case insensitive string comparison
I once took a quiz that asked me to write a case-insensitive version of strcmp. What I did was to simply compare every pair of characters (one from each string) after I had converted them to uppercase.
🌐
Lemoda
lemoda.net › c › ignore-case-string-compare
Compare strings ignoring case in C
This is an example C program which illustrates comparing strings with strcmp and strcasecmp. The latter routine compares strings case-insensitively.
🌐
Daniel Lemire's blog
lemire.me › blog › 2020 › 04 › 30 › for-case-insensitive-string-comparisons-avoid-char-by-char-functions
For case-insensitive string comparisons, avoid char-by-char functions – Daniel Lemire's blog
April 30, 2020 - It is a well-defined problem for ASCII strings. In C/C++, there are basically two common approaches. You can do whole string comparisons: bool isequal = (strncasecmp(string1, string2, N) == 0); Or you can do …
Find elsewhere
🌐
IBM
ibm.com › docs › en › aix › 7.1.0
IBM Documentation
We cannot provide a description for this page right now
🌐
Quora
quora.com › In-C-whats-the-best-way-to-do-case-insensitive-string-comparison
In C++ what's the best way to do case-insensitive string comparison? - Quora
Answer (1 of 20): First, you should read Jerry Coffin's answer to In C++ what's the best way to do case-insensitive string comparison?, which talks a little about why this problem is harder than it sounds. The easy answer, if you’re limiting yourself to the standard ASCII set, is that you conver...
🌐
Cplusplus
cplusplus.com › forum › beginner › 243351
Comparing strings regardless of case - C++ Forum
Sadly, there isn't really a built-in way to do case-insensitive string compare. At least not one that I know of. I suggest writing your own function, e.g. "iequals(a, b)" and convert each character to lower before comparing.
🌐
Study Plan
studyplan.dev › pro-cpp › c-strings › q › case-insensitive-c-string-comparison
Case-Insensitive C-String Comparison | Working with C-Style Strings | StudyPlan.dev
August 8, 2023 - If we reach the end of one or both ... be null terminators). This function returns 0 for equal strings, a negative value if s1 is lexicographically before s2 (ignoring case), and a positive value otherwise....
🌐
Lafstern
lafstern.org › matt › col2_new.pdf pdf
How to do case-insensitive string comparison Matt Austern
order" comparison, where we build up string comparison from character-by-character ... guilty as anyone else; I use it in my book a half dozen times. It's almost right, but that's not good ... You should try this out on your system. On my system (a Silicon Graphics O2 running IRIX ... Hm, how odd. If you're doing a case-insensitive comparison, shouldn't "gewürztraminer"
🌐
The Open Group
pubs.opengroup.org › onlinepubs › 009696799 › functions › strcasecmp.html
strcasecmp
strcasecmp, strncasecmp - ... strncasecmp(const char *s1, const char *s2, size_t n); The strcasecmp() function shall compare, while ignoring differences in case, the string pointed to by s1 to the string pointed to by s2....
🌐
Cplusplus
cplusplus.com › forum › beginner › 211832
How to do a case insensitive search/comparison of a string?
Then compare both lower-case only strings to each other. This way you don't have to worry about comparing an upper-case against a lower-case since everything is lower-case. In line 7 JLBorges is using the std version of tolower(char) to quickly convert the string in a single-line for-each loop and then returns the copy for the comparison in line 15.
🌐
Gotw
gotw.ca › gotw › 029.htm
GotW #29: Strings
This is the original GotW problem and solution substantially as posted to Usenet. See the book Exceptional C++ (Addison-Wesley, 2000) for the most current solutions to GotW issues #1-30. The solutions in the book have been revised and expanded since their initial appearance in GotW.
🌐
GeeksforGeeks
geeksforgeeks.org › c++ › case-insensitive-string-comparison-in-cpp
Case-Insensitive String Comparison in C++ - GeeksforGeeks
July 23, 2025 - Iterate through each character of both strings. Convert each character to lowercase format using std::tolower method. If any character is different return false. If all characters were same return true. The following program illustrates how we can compare two case-insensitive strings in C++: