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
🌐
Apache Commons
commons.apache.org › proper › commons-lang › apidocs › org › apache › commons › lang3 › StringUtils.html
StringUtils (Apache Commons Lang 3.20.0 API)
java.lang.Object · org.apache.commons.lang3.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/Compare - compares two strings ...
🌐
Educative
educative.io › answers › what-is-stringutilsisblank-in-java
What is StringUtils.isBlank in Java?
isBlank() is a · static · the methods in Java that can be called without creating an object of the class. method of the StringUtils which is used to check if the given string is blank.
🌐
Apache Commons
commons.apache.org › proper › commons-lang › javadocs › api-2.6 › src-html › org › apache › commons › lang › StringUtils.html
StringUtils.isBlank - Apache Commons
220 * StringUtils.isBlank(null) = true · 221 * StringUtils.isBlank("") = true · 222 * StringUtils.isBlank(" ") = true · 223 * StringUtils.isBlank("bob") = false · 224 * StringUtils.isBlank(" bob ") = false · 225 * </pre> 226 * 227 * @param str the String to check, may be null ·
🌐
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.
🌐
Codehaus-plexus
codehaus-plexus.github.io › plexus-utils › apidocs › org › codehaus › plexus › util › StringUtils.html
StringUtils (Plexus Common Utilities 4.0.2 API)
Since release 3.5.0 it no longer returns true for strings containing only whitespace characters. ... Checks if a String is whitespace, empty ("") or null. StringUtils.isBlank(null) = true StringUtils.isBlank("") = true StringUtils.isBlank(" ") = true StringUtils.isBlank("bob") = false ...
🌐
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 ·
🌐
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 - Use StringUtils.isBlank() . This method will return true if it is supplied with an empty, zero length, or whitespace-only string. This method gracefully handles a null input by returning true.
Author   Timothy M. O'Brien
Published   2004
Pages   400
🌐
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 ·
Find elsewhere
🌐
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
🌐
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
🌐
Eduardo Figueiredo
homepages.dcc.ufmg.br › ~andrehora › examples › org.apache.commons.lang3.StringUtils.isBlank.11.html
org.apache.commons.lang3.StringUtils.isBlank
public void testIsBlank() { assertTrue(StringUtils.isBlank(null)); assertTrue(StringUtils.isBlank("")); assertTrue(StringUtils.isBlank(StringUtilsTest.WHITESPACE)); assertFalse(StringUtils.isBlank("foo")); assertFalse(StringUtils.isBlank(" foo ")); } public class CheckEmptyString { public static void main(String[] args) { String var1 = null; String var2 = ""; String var3 = " ttt"; String var4 = "Hello World"; System.out.println("var1 is blank? = " + StringUtils.isBlank(var1)); System.out.println("var2 is blank?
🌐
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.
🌐
Oracle
docs.oracle.com › cd › E55783_02 › Platform.11-2 › apidoc › atg › core › util › StringUtils.html
StringUtils (ATG Java API)
Parameters: pStr - The string to check is not null or zero length · Returns: true if String is not empty · public static boolean isBlank(java.lang.String pStr) Return true if pStr is null, the empty string, or consists entirely of whitespace where whitespace is defined by the String.trim method.
🌐
iO Flood
ioflood.com › blog › stringutils-isempty
StringUtils.isEmpty() in Java: Your Method Guide
March 27, 2024 - Are you finding it challenging to use StringUtils.isEmpty in Java? You're not alone. Many developers struggle with this task, but there's a tool that can make
🌐
Apache Commons
commons.apache.org › proper › commons-lang › apidocs › src-html › org › apache › commons › lang3 › StringUtils.html
StringUtils.isBlank - Source code - Apache Software Foundation
1525 * @param defaultStr the default CharSequence to return if {@code str} is {@link #isBlank(CharSequence) blank} (whitespaces, empty ({@code ""}) or 1526 * {@code null}); may be null. 1527 * @return the passed in CharSequence, or the default. 1528 * @see StringUtils#defaultString(String, String) 1529 * @see #isBlank(CharSequence) 1530 */ 1531 public static <T extends CharSequence> T defaultIfBlank(final T str, final T defaultStr) { 1532 return isBlank(str) ?
🌐
Medium
sanjaysingh-dev.medium.com › why-every-java-developer-should-know-stringutils-real-world-use-cases-explained-51cf27633060
Why Every Java Developer Should Know StringUtils: Real-World Use Cases Explained | by Sanjay Singh | Medium
April 8, 2025 - Avoid NullPointerException when working with strings. Simplify common string operations with reusable, tested methods. Use isBlank() instead of isEmpty() when whitespace handling matters.
🌐
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.