Boolean Logic Truth Table Generator
Enter a boolean expression to generate its truth table. Variables A–F are auto-detected. Supports AND, OR, NOT, XOR, NAND, NOR, IMPLIES.
How to Use the Boolean Truth Table Generator
- Type a boolean expression using variables A, B, C, D, E, or F and operators. Or click operator buttons to insert them.
- Click "Generate Table" — the truth table is created for all combinations of your variables.
- Review the Karnaugh map below (for 2–4 variables) to visualize groupings for simplification.
- Copy or download the truth table as CSV for use in reports or coursework.
Supported Operators and Syntax
The evaluator accepts both word-form and symbol-form operators:
- AND — also
&&,&,* - OR — also
||,|,+ - NOT — also
!,~ - XOR — also
^ - NAND — NOT (A AND B)
- NOR — NOT (A OR B)
- IMPLIES — also
=>,->; equivalent to NOT A OR B
Variables are single letters A through F (case-insensitive). Parentheses are fully supported for grouping sub-expressions. Example expressions: A AND (B OR NOT C), (A XOR B) NAND C, A IMPLIES (B AND C).
Understanding the Karnaugh Map
A Karnaugh map (K-map) arranges truth table outputs in a 2D grid using Gray code ordering (00, 01, 11, 10) so that adjacent cells differ by only one variable. Groups of adjacent 1s (called "prime implicants") can be circled to eliminate variables and produce a minimized sum-of-products expression. Groups must be powers of 2 (1, 2, 4, 8, 16 cells) and can wrap around edges. K-maps work for 2, 3, and 4 variables. For 5+ variables, Quine-McCluskey or computer-aided methods are preferred.
Practical Applications of Boolean Logic
Boolean algebra is the mathematical foundation of digital circuits, programming, and search queries. In hardware design, logic gates (AND, OR, NOT, NAND, NOR, XOR) implement boolean expressions directly in silicon. CPU arithmetic units, memory decoders, and flip-flops are all constructed from these gates. In programming, conditional statements rely on boolean expressions to control program flow. Database queries use AND, OR, and NOT to filter records. Search engines use boolean operators for advanced queries. Understanding truth tables helps you debug complex conditionals, verify that your logic handles all edge cases, and simplify redundant conditions. For other logic-related developer tools, see the Regex Tester or JSON Formatter.