Truth Table Generator

One Boolean expression per line (max 6). Operators: NOT / AND / OR / XOR / -> / <->, or ! && || ⊕ → ↔; precedence NOT > AND > XOR > OR > implies > equivalence; up to 8 variables (256 rows)
Value format:
Calculation Result Download CSV

Introduction to the tool and how to use it

Truth Table Generator: enter a Boolean expression and instantly get the full truth table, sum-of-minterms (disjunctive normal form) and product-of-maxterms (conjunctive normal form); a staple for digital logic, discrete math, and propositional logic.

Supported operators (case-insensitive; math symbols also work directly):
   · NOT  NOT / ! / ¬ / ~
   · AND  AND / && / ∧ / &
   · XOR  XOR / ⊕ / ^
   · OR  OR / || / ∨ / |
   · Implication  -> / → / =>
   · Equivalence  <-> / ↔ / <=> / ≡
   · Parentheses must be paired; constants can be written as 0 / 1.

Precedence (low → high): equivalence ↔ < implication → < OR ∨ < XOR ⊕ < AND ∧ < NOT ¬. Implication A -> B -> C is right-associative and parses as A → (B → C); other equal-precedence operators are left-associative. Results are normalized to the math symbols ∧ ∨ ¬ ⊕ → ↔ so you can see at a glance how the machine read your expression.
Variables are detected automatically: a single letter A-Z, or a letter-plus-digit identifier (such as p1, A12); case-insensitive and shown uppercase. Up to 8 variables, so at most 2^8 = 256 truth-table rows; beyond that you get a notice.

How to read the two normal forms: number each row by variable order (first variable as the most significant bit) into a minterm index m. Rows evaluating true form the disjunctive normal form Σm(4, 6, 7) (sum of minterms); rows evaluating false form the conjunctive normal form ΠM(0, 1, 2, 3, 5) (product of maxterms). A tautology has an empty ΠM() (empty product = 1); a contradiction has an empty Σm() (empty sum = 0).

Parsing uses the built-in lexer → recursive descent → syntax tree → recursive evaluator; no eval is used, and mistakes are called out explicitly: unknown character, unknown identifier, unbalanced parentheses, missing operands, and so on each get a matching message.

How to use

  1. Write Boolean expressions in the input box, one per line (up to 6 lines; multiple expressions share the same variable columns and show results side by side), such as A AND (B OR NOT C).
  2. Choose the truth display format: T/F or 1/0.
  3. Click start calculation; the result table shows the index, variable columns, a result column per expression, and a note column (the minterm index m for that row). The output box also includes a monospace-aligned text truth table and the two normal forms.
  4. Results can be copied with one click and exported as CSV.


Message board

Suggestions and problems are both welcome, up to 250 characters.

  • No messages yet — be the first to say something.