compareToIgnoreCase() compare two strings lexicographically or as per dictionary ordering. But equalsIgnoreCase() checks only if both strings are equal or not . The return value of compareToIgnoreCase() is an integer that represents if one string is equal, greater than or less than the other one.