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-stringutilsisnotblank-in-java
What is StringUtils.isNotBlank in Java?
isNotBlank() is a static method of the StringUtils class that is used to check if a given string is not blank.
🌐
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 - When working with strings in Java, it’s common to perform checks to see whether a string is not empty or not blank. Apache Commons Lang provides two very useful utility methods for this: StringUtils.isNotEmpty() and StringUtils.isNotBlank(). Press enter or click to view image in full size ·
🌐
O'Reilly
oreilly.com › library › view › jakarta-commons-cookbook › 059600706X › ch02s03.html
2.2. Checking for an Empty String - Jakarta Commons Cookbook [Book]
November 16, 2004 - Checking for nonblank strings is just as easy; StringUtils.isNotBlank( ) will return the compliment of isBlank( ). If a string is empty, contains only whitespace, or is null, the StringUtils.isNotBlank( ) method will return false.
Author   Timothy M. O'Brien
Published   2004
Pages   400
🌐
GeeksforGeeks
geeksforgeeks.org › java › java-stringutils-isnoneblank-method
Java StringUtils.isNoneBlank() Method with Examples - GeeksforGeeks
October 24, 2023 - The StringUtils.isNoneBlank() function is part of the Apache Commons Lang library, which provides utility methods for working with strings in Java. This function is used to check if multiple strings are not blank or empty.
🌐
javakeypoint
javakeypoint.wordpress.com › 2018 › 01 › 18 › stringutils-isnotempty-vs-stringutils-isnotblank
StringUtils.isNotEmpty() VS StringUtils.isNotBlank() | javakeypoint
January 18, 2018 - StringUtils.isNotEmpty() StringUtils.isNotEmpty() is used to find if the String is not empty/String is length 0 and not null. Example: StringUtils.isNotEmpty(null) = false StringUtils.isNotEmpty("") = false StringUtils.isNotEmpty(" ") = true ...
🌐
AWS
sdk.amazonaws.com › java › api › latest › software › amazon › awssdk › utils › StringUtils.html
StringUtils (AWS SDK for Java - 2.42.6)
StringUtils.isBlank(null) = true StringUtils.isBlank("") = true StringUtils.isBlank(" ") = true StringUtils.isBlank("bob") = false StringUtils.isBlank(" bob ") = false · Parameters: cs - the CharSequence to check, may be null · Returns: true if the CharSequence is null, empty or whitespace only · Since: 2.0, 3.0 Changed signature from isBlank(String) to isBlank(CharSequence) public static boolean isNotBlank ·
🌐
Sonar Community
community.sonarsource.com › rules and languages › report false-positive / false-negative...
Commons-lang StringUtils isNotBlank method still raise NPE - Report False-positive / False-negative... - Sonar Community
March 12, 2020 - Does Sonar support commons-lang StringUtils ? org.apache.commons commons-lang3 3.7 Env: INFO: SonarQube Scanner 3.2.0.1227 INFO: Java 1.8.0_121 Oracle Corporation (64-bit) INFO: Linux 4.19.2-1.el7.elrepo.x86_64 amd64 Community EditionVersion 7.6 (build 21501) code to reproduce this issue: public class DetectorImport { public String check1(Nonentity nonentity) { String s; ...
Find elsewhere
🌐
Apache Commons
commons.apache.org › proper › commons-lang › javadocs › api-2.6 › src-html › org › apache › commons › lang › StringUtils.html
StringUtils.isBlank - Apache Commons
260 public static boolean isNotBlank(String str) { 261 return !StringUtils.isBlank(str); 262 } 263 · 264 // Trim · 265 //----------------------------------------------------------------------- 266 /** 267 * <p>Removes control characters (char &lt;= 32) from both ·
🌐
Codehaus-plexus
codehaus-plexus.github.io › plexus-utils › apidocs › org › codehaus › plexus › util › StringUtils.html
StringUtils (Plexus Common Utilities 4.0.2 API)
StringUtils.isNotBlank(null) = false StringUtils.isNotBlank("") = false StringUtils.isNotBlank(" ") = false StringUtils.isNotBlank("bob") = true StringUtils.isNotBlank(" bob ") = true
🌐
GitHub
github.com › openrewrite › rewrite-apache › issues › 7
Recipe for replacing StringUtils#isBlank(CharSequence) and StringUtils#isNotBlank(CharSequence) · Issue #7 · openrewrite/rewrite-apache
March 15, 2024 - At least Java 11 is required due to the availability of java.lang.String#isBlank(). class A { void foo(String bar) { boolean isBlankBar = StringUtils.isBlank(bar); boolean isNotBlankBar = StringUtils.isNotBlank(bar); } } class A { void foo(String bar) { boolean isBlankBar = (bar == null || bar.isBlank()); boolean isNotBlankBar = (bar != null && !bar.isBlank()); } } Reactions are currently unavailable ·
Published   Mar 15, 2024
🌐
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.
🌐
Eduardo Figueiredo
homepages.dcc.ufmg.br › ~andrehora › examples › org.apache.commons.lang3.StringUtils.isBlank.11.html
org.apache.commons.lang3.StringUtils.isBlank
= " + StringUtils.isBlank(var2)); System.out.println("var3 is blank? = " + StringUtils.isBlank(var3)); System.out.println("var4 is blank? = " + StringUtils.isBlank(var4)); System.out.println("var1 is not blank? = " + StringUtils.isNotBlank(var1)); System.out.println("var2 is not blank?
🌐
Spring
docs.spring.io › spring-framework › docs › current › javadoc-api › org › springframework › util › StringUtils.html
StringUtils (Spring Framework 7.0.5 API)
This class delivers some simple functionality that should really be provided by the core Java String and StringBuilder classes. It also provides easy-to-use methods to convert between delimited strings, such as CSV strings, and collections and arrays. Since: 16 April 2001 · Author: Rod Johnson, Juergen Hoeller, Keith Donald, Rob Harrop, Rick Evans, Arjen Poutsma, Sam Brannen, Brian Clozel, Sebastien Deleuze · Constructors · Constructor · Description · StringUtils() All MethodsStatic MethodsConcrete MethodsDeprecated Methods ·
🌐
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
Replace any StringUtils#isEmpty(String) and #isNotEmpty(String) with s == null || s.isEmpty() and s != null && !s.isEmpty(). apache · commons · GitHub: IsNotEmptyToJdk.java, Issue Tracker, Maven Central · This recipe is available under the Moderne Source Available License.
Published   1 day ago
🌐
Oracle
docs.oracle.com › cd › E55783_02 › Platform.11-2 › apidoc › atg › core › util › StringUtils.html
StringUtils (ATG Java API)
public static java.lang.String CLASS_VERSION · Class version string. public StringUtils() public static int numOccurrences(java.lang.String pString, char pDelimiter) Returns the number of times the specified character appears in the specified String. The String must be non-null.
🌐
Apache Commons
commons.apache.org › proper › commons-lang › javadocs › api-2.6 › org › apache › commons › lang › StringUtils.html
StringUtils (Commons Lang 2.6 API)
StringUtils.isNotBlank(null) = false StringUtils.isNotBlank("") = false StringUtils.isNotBlank(" ") = false StringUtils.isNotBlank("bob") = true StringUtils.isNotBlank(" bob ") = true
🌐
BytePlus
byteplus.com › en › topic › 498648
Stringutils isnotempty vs stringutils isnotblank
Build better products, deliver richer experiences, and accelerate growth through our wide range of intelligent solutions. Core content of this page: Stringutils isnotempty vs stringutils isnotblank