StringUtils.isBlank() checks that each character of the string is a whitespace character (or that the string is empty or that it's null). This is totally different than just checking if the string is empty.

From the linked documentation:

Checks if a String is whitespace, empty ("") or null.

 StringUtils.isBlank(null)      = true
 StringUtils.isBlank("")        = true  
 StringUtils.isBlank(" ")       = true  
 StringUtils.isBlank("bob")     = false  
 StringUtils.isBlank("  bob  ") = false

For comparison StringUtils.isEmpty:

 StringUtils.isEmpty(null)      = true
 StringUtils.isEmpty("")        = true  
 StringUtils.isEmpty(" ")       = false  
 StringUtils.isEmpty("bob")     = false  
 StringUtils.isEmpty("  bob  ") = false

Warning: In java.lang.String.isBlank() and java.lang.String.isEmpty() work the same except they don't return true for null.

java.lang.String.isBlank() (since Java 11)

java.lang.String.isEmpty()

Answer from arshajii on Stack Overflow
🌐
Educative
educative.io › answers › what-is-stringutilsisempty-in-java
What is StringUtils.isEmpty in Java?
isEmpty() is a static method of the StringUtils class that is used to check if a given string is empty or not. If a string satisfies any of the criteria below, then the string is considered to be empty.
🌐
Apache Commons
commons.apache.org › lang › apidocs › org › apache › commons › lang3 › StringUtils.html
StringUtils (Apache Commons Lang 3.20.0 API)
public class StringUtils extends Object · Operations on String that are null safe. IsEmpty/IsBlank - checks if a String contains text · Trim/Strip - removes leading and trailing whitespace · Equals/Compare - compares two strings in a null-safe manner · startsWith - check if a String starts ...
🌐
Apache Commons
commons.apache.org › proper › commons-lang › javadocs › api-2.6 › org › apache › commons › lang › StringUtils.html
StringUtils (Commons Lang 2.6 API)
java.lang.Object org.apache.commons.lang.StringUtils · public class StringUtils · extends Object · Operations on String that are null safe. IsEmpty/IsBlank - checks if a String contains text · Trim/Strip - removes leading and trailing whitespace · Equals - compares two strings null-safe ·
🌐
OpenRewrite
docs.openrewrite.org › recipe catalog › apache › commons › commons lang › replace any stringutils#isempty(string) and #isnotempty(string)
Replace any StringUtils#isEmpty(String) and #isNotEmpty(String) | OpenRewrite Docs
import org.apache.commons.lang3.StringUtils; class A { boolean test(String first) { return StringUtils.isEmpty(first); } } class A { boolean test(String first) { return first == null || first.isEmpty(); } } @@ -1,2 +1,0 @@ -import org.apache.commons.lang3.StringUtils; - class A { @@ -5,1 +3,1 @@ class A { boolean test(String first) { - return StringUtils.isEmpty(first); + return first == null || first.isEmpty(); } This recipe has no required configuration options.
Published   1 day ago
🌐
Spring
docs.spring.io › spring-framework › docs › current › javadoc-api › org › springframework › util › StringUtils.html
StringUtils (Spring Framework 7.0.5 API)
public StringUtils() @Deprecated(since="5.3") @Contract("null -> true") public static boolean isEmpty · (@Nullable Object str) Deprecated. in favor of hasLength(String) and hasText(String) (or ObjectUtils.isEmpty(Object)) Check whether the given object (possibly a String) is empty.
🌐
Apache Commons
commons.apache.org › proper › commons-lang › javadocs › api-3.9 › org › apache › commons › lang3 › StringUtils.html
StringUtils (Apache Commons Lang 3.9 API)
IsEmpty/IsBlank - checks if a String contains text · Trim/Strip - removes leading and trailing whitespace ... The StringUtils class defines certain words related to String handling.
🌐
iO Flood
ioflood.com › blog › stringutils-isempty
StringUtils.isEmpty() in Java: Your Method Guide
March 27, 2024 - StringUtils.isEmpty is a method in the Apache Commons Lang library that checks if a given string is empty or null.
🌐
Tabnine
tabnine.com › home page › code › java › org.apache.commons.lang3.stringutils
org.apache.commons.lang3.StringUtils.isEmpty java code examples | Tabnine
public T getPluginInfo(String pluginId) { if (isEmpty(pluginId)) { return null; } return pluginInfos.get(pluginId); } ... /** * @param source * @param token * * @return */ public static List<String> parseStringToStringList(String source, String token) { if (StringUtils.isBlank(source) || StringUtils.isEmpty(token)) { return null; } List<String> result = new ArrayList<String>(); String[] units = source.split(token); for (String unit : units) { result.add(unit); } return result; }
Find elsewhere
🌐
Apache Commons
commons.apache.org › proper › commons-lang › javadocs › api-3.3.2 › org › apache › commons › lang3 › StringUtils.html
StringUtils (Apache Commons Lang 3.3.2 API)
IsEmpty/IsBlank - checks if a String contains text · Trim/Strip - removes leading and trailing whitespace ... The StringUtils class defines certain words related to String handling.
🌐
Educative
educative.io › answers › what-is-stringutilsisnotempty-in-java
What is StringUtils.isNotEmpty in Java?
isNotEmpty() is a static method of the StringUtils class that is used to check if the given string is not empty.
🌐
AWS
sdk.amazonaws.com › java › api › 2.1.3 › software › amazon › awssdk › utils › StringUtils.html
StringUtils (AWS SDK for Java - 2.1.3)
This class's source was modified from the Apache commons-lang library: https://github.com/apache/commons-lang/ ... Checks if a CharSequence is empty ("") or null. StringUtils.isEmpty(null) = true StringUtils.isEmpty("") = true StringUtils.isEmpty(" ") = false StringUtils.isEmpty("bob") = false ...
🌐
Medium
medium.com › dev-java › stringutils-isnotempty-vs-stringutils-isnotblank-in-java-491f10680879
Java String Checks: Understanding isNotEmpty vs isNotBlank | by Anil R | Dev Java | Medium
April 23, 2025 - <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> <version>3.12.0</version> </dependency> Definition: StringUtils.isNotEmpty(CharSequence cs) The string is not null · The string is not empty ("") The string is null · The string is empty ("") 2 followers ·
🌐
Eduardo Figueiredo
homepages.dcc.ufmg.br › ~andrehora › examples › org.apache.commons.lang3.StringUtils.isBlank.11.html
org.apache.commons.lang3.StringUtils.isBlank
String someWhiteSpace = " \t \n"; StringUtils.isEmpty(someWhiteSpace); // false StringUtils.isBlank(someWhiteSpace); // true
🌐
Apache Commons
commons.apache.org › proper › commons-lang › javadocs › api-release › org › apache › commons › lang3 › StringUtils.html
StringUtils (Apache Commons Lang 3.11 API)
public class StringUtils extends Object · Operations on String that are null safe. IsEmpty/IsBlank - checks if a String contains text · Trim/Strip - removes leading and trailing whitespace · Equals/Compare - compares two strings in a null-safe manner · startsWith - check if a String starts ...
🌐
GitHub
github.com › apache › commons-lang › blob › master › src › main › java › org › apache › commons › lang3 › StringUtils.java
commons-lang/src/main/java/org/apache/commons/lang3/StringUtils.java at master · apache/commons-lang
if (noMoreMatchesForReplIndex[i] || isEmpty(searchList[i]) || replacementList[i] == null) { ... * A {@code null} reference passed to this method is a no-op, or if any "search string" or "string to replace" is null, that replace will be ignored. ... * StringUtils.replaceEachRepeatedly(null, *, *) = null
Author   apache
🌐
Apache Commons
commons.apache.org › proper › commons-lang › javadocs › api-2.4 › org › apache › commons › lang › StringUtils.html
StringUtils (Commons Lang 2.4 API)
StringUtils instances should NOT be constructed in standard programming. Instead, the class should be used as StringUtils.trim(" foo ");. This constructor is public to permit tools that require a JavaBean instance to operate. public static boolean isEmpty(java.lang.String str)
🌐
Stack Abuse
stackabuse.com › guide-to-apache-commons-stringutils-class-in-java
Guide to Apache Commons' StringUtils Class in Java
September 27, 2023 - As mentioned earlier, Apache Commons contains a number of methods, and we'll be covering some of the most used ones: StringUtils.isEmpty() and StringUtils.isBlank() StringUtils.equals() StringUtils.compare() StringUtils.indexOf() StringUtils.lastIndexOf() StringUtils.contains() StringUtils.containsIgnoreCase() StringUtils.containsAny() StringUtils.containsNone() StringUtils.containsOnly() StringUtils.substring() StringUtils.split() StringUtils.join() StringUtils.remove() StringUtils.replace() StringUtils.countMatches() To be able to use the Apache Commons library, we first need to import it into our project.
🌐
Apache Commons
commons.apache.org › proper › commons-lang › javadocs › api-3.1 › index.html
StringUtils (Commons Lang 3.1 API)
Commons Lang 3.1 API · Frame Alert · This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link toNon-frame version