Logic expressions

Operators
NOT ! ~ ¬ not
AND & && ∧ * · and
OR | || ∨ + or
XOR ^ ⊕ xor
NAND nand ↑
NOR nor ↓
IMPLIES -> => → ⊃ implies
IFF <-> <=> ↔ ≡ iff xnor

Truth table

Enter a logic expression to build its truth table.

A tool that builds a truth table straight from a logic expression. Type something like "A and B", "A -> B", or "not (A or B)" and it lists every combination of the variables (A, B, C…) — 2 to the power of the number of variables rows — with the value of the expression in each row. It supports AND, OR, NOT, XOR, NAND, NOR, implication (→) and biconditional (↔), written either as symbols (! ~ & | ^ -> <->) or as words (and / or / not / xor / implies / iff). Precedence is NOT > AND > XOR > OR > implies > iff, and parentheses override it. Each expression is automatically classified: a tautology if it is always true, a contradiction if it is always false, otherwise contingent. Enter several expressions and they appear as separate columns, and the tool checks whether they match in every row — that is, whether they are logically equivalent (handy for verifying De Morgan's laws or rewriting implications). Switch the display between T / F and 1 / 0, and copy the finished table as Markdown or CSV to drop into reports and notes. All evaluation and table building happen locally in your browser, and the expression you enter is never sent to any server.

How to use

  1. Type an expression into a row (e.g. A and B, A -> B, not (A or B)). You can use symbols or words; open "Operators" to see every accepted notation.
  2. The truth table for all combinations of the variables is built instantly, and each expression is labelled tautology, contradiction, or contingent. Add more rows with "+ Add expression" to compare them and check equivalence.
  3. Toggle the display between T/F and 1/0. Use "Copy Markdown" or "Copy CSV" to export the table.

FAQ

Is my logic expression sent to a server?

No. Evaluating the expression, building the truth table, and converting it to Markdown or CSV all happen entirely in your browser; what you type is never uploaded, stored, or transmitted. It works fully locally.

Which operators and symbols are supported?

NOT (! ~ ¬ not), AND (& && ∧ and), OR (| || ∨ + or), XOR (^ ⊕ xor), NAND (nand ↑), NOR (nor ↓), implication IMPLIES (-> => → implies), and biconditional IFF (<-> <=> ↔ ≡ iff / xnor). Constants are 1, 0, true, false. Variables are names that start with a letter, such as A or p.

What is the operator precedence?

From highest to lowest: NOT > AND/NAND > XOR > OR/NOR > implies (→) > iff (↔). Implication is right-associative (A->B->C means A->(B->C)). Use parentheses to force a different grouping.

Can it detect tautologies, contradictions, and equivalence?

Yes. A single expression is classified as a tautology when it is true in every row, a contradiction when it is false in every row, and contingent otherwise. Enter two or more expressions and the tool checks whether they agree in every row — i.e. whether they are logically equivalent — which is useful for verifying De Morgan's laws such as not(A and B) ≡ (not A) or (not B).

How many variables can I use?

Up to 10. A truth table has 2 to the power of the number of variables rows (1024 rows for 10 variables), so the limit keeps the table from growing unmanageably large.