Boneyard Tools

Boolean Truth Table Generator

Type a boolean expression with variables like A, B and C and get the full truth table for every combination of inputs. Supports the common logic operators and parentheses, and shows how many rows come out true.

How to generate a truth table

  1. Type a boolean expression using variables and operators, for example A AND (B OR C).
  2. Read the generated table: one column per variable plus a result column for every combination of inputs.
  3. Switch between T/F and 1/0, check the count of true rows, then copy the table.

Examples

Conjunction

A AND B
4 rows; the result is true only when A and B are both true.

Grouped expression

(A AND B) OR C
8 rows over A, B and C; true whenever C is true or both A and B are true.

Frequently asked questions

Which operators are supported?

NOT (also ! or ~), AND (&&, &, *), OR (||, |, +), XOR (^), NAND, NOR, XNOR, IMPLIES (->) and IFF (<->). Operator names are case-insensitive and you can group with parentheses. The constants TRUE, FALSE, 1 and 0 are also allowed.

What is the order of precedence?

From tightest to loosest binding: NOT, then AND, then XOR, then OR, then IMPLIES, then IFF. NOT and IMPLIES are right-associative; the others are left-associative. Use parentheses when you want a different grouping.

How are variables named?

A variable is any identifier, so single letters like A, B and C work, and so do whole words like rain or isOpen. Columns appear in the order the variables first show up in your expression.

How many variables can I use?

Up to 12, which is a 4096 row table. The table doubles in size with each extra variable, so the cap keeps it from getting unwieldy. Beyond that the generator reports an error instead of locking up your browser.

Is my expression sent to a server?

No. Parsing and table generation happen entirely in your browser, so nothing you type is uploaded or stored.

What happens with an invalid expression?

If parentheses do not match, an operator is missing an operand, or there is an unexpected character, the generator shows an error message instead of a table so you can fix the input.

Related tools