A truth table lays out every possible combination of true/false values for a logical expression's variables and shows the resulting output for each one β the foundation of propositional logic, digital circuit design, and formal proofs. This calculator builds that table for any expression you type, using a safe, hand-written parser rather than a dynamic code-execution shortcut, and automatically classifies the result as a tautology, contradiction, or contingency.
How the calculator works
Your expression is read into a small parse tree that already encodes operator precedence: NOT binds tightest, then AND, then XOR, then OR, then IMPLIES, and finally IFF (the biconditional), which binds loosest β the same convention used in most logic textbooks. Every distinct single-letter variable is collected automatically, and the calculator generates all 2βΏ possible true/false combinations for n variables, evaluating the parse tree once per row. No eval() or dynamic code execution is used anywhere β the parser only recognizes variables, the supported operators, and parentheses, so nothing you type can run as code.
Reading the input syntax
Variables must be single letters (A, B, Cβ¦), and operators can be typed three ways: as a keyword (AND, OR, NOT, XOR, IMPLIES or THEN, IFF), as an ASCII alias (&&, ||, !, ->, <->), or as the formal symbol (β§ β¨ Β¬ β β β) β all three forms can be mixed freely in the same expression. Parentheses override the default precedence exactly like in arithmetic, so A OR (B AND NOT C) and (A OR B) AND NOT C produce different tables.
Limits and edge cases
The parser rejects anything that isn't a single-letter variable, a supported operator, or a parenthesis β multi-letter identifiers (like foo) throw a clear error rather than silently being ignored, since only single letters are treated as variables. To keep the table readable and the computation instant, expressions are capped at 8 distinct variables (256 rows) and 300 characters; going over either limit returns a plain-language error instead of a wrong or truncated table.