Boolean
Definition
A data type with only two possible values, true or false, fundamental to computer logic, conditional statements, and decision-making in programming.
Boolean is a data type named after mathematician George Boole that represents one of two values: true or false. In programming, booleans are the foundation of conditional logic, controlling program flow through if/else statements, while loops, and logical operations.
Boolean algebra uses three primary operators: AND (both conditions must be true), OR (at least one condition must be true), and NOT (inverts the value). These operators combine to create complex logical expressions that power everything from search filters to authentication systems.
In many programming languages, other data types can be evaluated as boolean: zero, null, undefined, empty strings, and NaN are typically falsy, while all other values are truthy. Understanding truthy and falsy values is essential for writing concise, bug-free conditional logic.
Related Calculators
Related Terms
JSON (JavaScript Object Notation)
techA lightweight data interchange format that is easy for humans to read and write and easy for machines to parse and generate.
HTML (HyperText Markup Language)
techThe standard markup language for creating web pages, defining the structure and content of a page using elements represented by tags.
CSS (Cascading Style Sheets)
techA stylesheet language used to describe the visual presentation and layout of HTML documents, controlling colors, fonts, spacing, and responsive design.
DOM (Document Object Model)
techA programming interface for web documents that represents the page structure as a tree of objects, allowing programs to change document structure, style, and content.
Related Articles
JSON Formatting Best Practices: Write Clean, Valid JSON
Master JSON formatting with best practices for syntax, nesting, and validation. Learn common errors, debugging tips, and how to write clean JSON data.
Regex Cheat Sheet: Essential Patterns Every Developer Needs
A practical regex reference guide with common patterns for emails, URLs, phone numbers, and more. Includes syntax explanations and real-world examples.
How to Generate Secure Passwords: Best Practices for 2026
Learn how to create strong, secure passwords that protect your accounts. Covers password length, complexity, managers, and multi-factor authentication.
Guide to QR Codes: How They Work, Types & Best Uses
Learn how QR codes work, the different types available, and best practices for creating and using them in marketing, payments, and information sharing.