Boolean Validator
Check whether text is a valid boolean as you type it, right in your browser, without sending it anywhere.
Input
Output
No value
Guide
What is a boolean?
A boolean is a value with two states, true or false, named after the mathematician George Boole. Programs store yes-or-no facts this way: whether a newsletter box is ticked, whether a feature is switched on, whether a parcel has shipped. In text, booleans show up as words or digits: true and false in JSON and many config files, 1 and 0 in databases, CSV exports and URL parameters such as ?debug=1, and yes and no in spreadsheets and settings files.
You check a boolean when a form field, an API, an environment variable or an imported file should hold one, so that a stray maybe or Y gets caught before your code reads it as true or false.
Tool description
Type or paste a value into the Value field, and the result shows as you type: "Boolean is valid" or "Boolean is not valid". Spaces and line breaks around a pasted value are ignored.
Also accept yes, no and any letter case starts off, and the check is then strict: only four values pass, exactly as written. Turn it on to accept yes and no too, and capital letters anywhere in the words.
Values that pass
- With the setting off:
true,false,1and0, with the words in small letters only - With the setting on:
true,false,yesandnoin any letter case, such asTrue,TRUE,tRuE,YesandNO, as well as1and0
Values that always fail
- Short forms:
y,n,t,f - Other words:
on,off,enabled,null - Other numbers, and other ways to write 1 and 0:
2,-1,01,1.0 - Words in other languages, such as
jaoroui - Words in quotes, as in
"true", and two words, as intrue false
Good to know
- The check says whether a value is one of the accepted words, not which state it stands for:
0andnopass just like1andyes. - In JSON, only
trueandfalsein small letters are booleans. This check also passes1and0, which JSON reads as numbers. - YAML 1.1 and some config formats also read
on,off,yandnas booleans. To accept such words, list them in the Allowed Values Checker.
Features
- Checks true, false, 1 and 0
- A setting for yes, no and any letter case
- Results as you type, with no button to press
- Runs in your browser, so nothing you type is sent anywhere