Empty String Checker
Check whether text is empty, optionally counting text of only spaces and line breaks as empty, right in your browser.
Input
Output
No value
Guide
What is an empty string?
In programming, a string is a piece of text, and an empty string is one with no characters at all: its length is zero, and code writes it as "". A form field left blank sends an empty string. Text made only of spaces or line breaks looks just as blank, but it isn't empty: it holds characters you can't see. Systems disagree about such text. Some keep a single space as real content, while many forms trim the spaces first and then reject the field as blank.
You run into this when you test a required field, compare what different systems accept, or want to know whether a cell copied from a spreadsheet is really empty or hides a space.
Tool description
Type or paste text into the Text box. This check looks at an empty box too, so the result shows from the start: "The text is empty." As soon as the box holds any character, even a single space, it reads "The text isn't empty."
Count spaces and line breaks as empty starts off. Turn it on, and text made of nothing but white space (spaces, tabs and line breaks) counts as empty too, while any other character still makes the text not empty.
Checked cases
| Text in the box | Setting off | Setting on |
|---|---|---|
| Nothing | Empty | Empty |
| One space | Not empty | Empty |
| A few line breaks | Not empty | Empty |
| A tab | Not empty | Empty |
| A non-breaking space | Not empty | Empty |
| A full-width space | Not empty | Empty |
| A zero-width space | Not empty | Not empty |
| A Hangul filler | Not empty | Not empty |
hello with spaces around it |
Not empty | Not empty |
Good to know
- With the setting on, every kind of space counts as white space, including the non-breaking space and the full-width space of Chinese and Japanese text.
- Some characters only look blank: the zero-width space, and the Hangul filler that people use for blank names in games and chats. They aren't white space, so they keep the text from being empty either way. Pasted into the Unicode Character Browser, they show up with their names.
- To remove the spaces around a text, use the Text trimmer.
Features
- Checks an empty box too, with a result from the start
- A setting to count spaces, tabs and line breaks as empty
- Tells white space apart from characters that only look blank
- Results as you type, with no button to press
- Runs in your browser, so nothing you type is sent anywhere