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.

AND OR NOT XOR NAND NOR IMPLIES ( )
Enter a boolean expression above and click Generate Table.

How to Use the Boolean Truth Table Generator

  1. Type a boolean expression using variables A, B, C, D, E, or F and operators. Or click operator buttons to insert them.
  2. Click "Generate Table" — the truth table is created for all combinations of your variables.
  3. Review the Karnaugh map below (for 2–4 variables) to visualize groupings for simplification.
  4. 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.

Frequently Asked Questions

The evaluator supports AND, OR, NOT, XOR, NAND, NOR, and IMPLIES. You can use full words or symbols: & or AND, | or OR, ! or NOT, ^ or XOR. Parentheses are fully supported for grouping.
A truth table lists all possible input combinations for a boolean expression and shows the output for each. For n variables there are 2^n rows. Truth tables verify logical equivalence, show circuit behavior, and help simplify expressions.
A Karnaugh map is a visual method for simplifying boolean expressions. It arranges truth table outputs in a grid using Gray code ordering, making it easy to identify groups of adjacent 1s that can be combined to minimize the expression. This tool generates K-maps for 2, 3, and 4 variables.
You can write NOT using the word "NOT" (e.g., NOT A), the exclamation mark "!" (e.g., !A), or the tilde "~" (e.g., ~A). All three are equivalent and can be used anywhere in the expression.
OR (inclusive or) returns true if at least one input is true — including when both are true. XOR (exclusive or) returns true only when exactly one input is true. For example: 1 OR 1 = 1, but 1 XOR 1 = 0.