Truth Tables
Truth tables for Boolean expressions: AND, OR, NOT, XOR, implies, iff; up to eight variables.
About this tool
Generate a common truth table for one Boolean expression per line. Empty lines are ignored. Generate uses the union of all variables, so each expression can be compared on the same assignments. Example loads four expressions and generates them; Clear removes input and output. Differences only shows assignments where at least two expressions disagree. Copy CSV copies the complete table, including rows outside the visible scrolling area, with quoted column names and CRLF line endings.
Syntax: ! or ¬ (NOT), & or ∧ (AND), ^ or ⊕ (XOR), | or ∨ (OR), -> or → (implication), <-> or ↔ (equivalence), parentheses and 0/1. Keywords AND/OR/NOT/XOR/NAND/NOR/XNOR are accepted. Precedence: NOT, AND/NAND, XOR, OR/NOR, implication, equivalence; implication associates to the right. ASCII variable names begin with a letter or underscore and may contain digits; case is ignored and keywords including T/F are reserved.
Variables are alphabetically ordered, the first is the most significant input bit. Assignments run from all-zero to all-one; 1 means true, 0 false. For a -> b the values are 1,1,0,1: only true implying false is false. For a ^ b they are 0,1,1,0. A column of only1 is a tautology; only0 a contradiction. Constants need no variables and therefore have one assignment. Error positions refer to the original line, including its leading spaces.
At most eight distinct variables (256 assignments), 16 expressions, 16384 total characters and 256 tokens per expression. Bounds precede recursive parsing and exponential enumeration. Wide and long tables scroll locally; focus the table region for keyboard scrolling. Input changes immediately remove old output. All calculation is local, inputs are not saved in cookies/URLs; clipboard contents remain separately until replaced. CNF/DNF provides canonical forms; Karnaugh map minimizes up to four variables.
After Generate, Ctrl/Command+Enter in the input, or Example, small edits update the table after a short typing pause. Clear stops automatic updates. CSV copies the complete table; it is disabled whenever no current result exists. Short column headings use only the space they need. Long headings are visually shortened with the complete expression in a tooltip and in CSV. Only the raw multiline input is remembered locally across navigation, reload and language changes. Results, errors and table scroll positions are not saved or rebuilt on opening; legacy completed/scroll fields are ignored. Above 100000 serialized characters the draft stays live in the app; download TXT before reload, which restores the previous saved input. Long tables use the available height and retain visible headers while scrolling.