Truth Table Generator
Enter a boolean expression and its variables to build the truth table.
Result
How it is calculated
The tool accepts the variables A, B and C only (up to three), so a table has 2n rows: 2, 4 or 8. Write the expression with the words AND, OR, NOT, XOR or the symbols &, |, !, ^, plus parentheses; case does not matter. Precedence from strongest to weakest is NOT, then AND, then XOR, then OR, so A XOR B AND C means A XOR (B AND C) while A XOR B OR C means (A XOR B) OR C. If the variables box is empty, the tool uses whichever of A, B, C appear in the expression. Rows count up in binary with A as the leftmost, most significant bit, and the column R shows the result, 1 for true and 0 for false. The tool also reports the number of variables and rows. Any other letter, operator or symbol, or a syntax error such as an unmatched bracket, makes the tool return nothing.
Worked example
Expression (A OR B) AND NOT C with variables A, B, C gives 3 variables and 8 rows. The result is true only when at least one of A or B is true and C is false. Row 0 0 0: (false OR false) AND true = 0. Row 0 1 0: (false OR true) AND true = 1. Row 1 1 1: true AND false = 0. Reading R from top to bottom the table is 0, 0, 1, 0, 1, 0, 1, 0: the table shows 3 variables and 8 rows.
Common mistakes
- Using a fourth variable or letters beyond A to C, such as X and Y. Only A, B and C are recognised, and an expression using other letters returns nothing.
- Assuming XOR binds as tightly as AND or as loosely as OR. It sits between them:
A XOR B AND Cis A XOR (B AND C), butA XOR B OR Cis (A XOR B) OR C. When in doubt, write the brackets you mean. - Using operators that are not supported, such as NAND, NOR,
->or=. Build them from AND, OR and NOT, for example NOT (A AND B) for NAND. - Reading the rows in the wrong order. A is the first column and changes slowest, so 0 0 1 means A false, B false, C true.
- Leaving a bracket unclosed or putting two operators in a row, such as
A AND OR B. A syntax error produces no table at all.
About this calculator
A truth table lists every possible combination of true/false values for a boolean expression's variables alongside the resulting output, giving a complete and unambiguous definition of the expression's logic — for n variables there are exactly 2^n rows, so a 3-variable expression (A, B, C) produces 8 rows covering every possible input state.
This generator evaluates expressions built from AND, OR, NOT and XOR (accepting either the words or the symbols &, |, !, ^) and fills in every combination automatically. Truth tables are the basic verification tool in digital logic design and computer engineering — used to check that a circuit or boolean condition behaves as intended, to simplify expressions with Karnaugh maps, and to prove logical equivalence between two different-looking expressions.
Was this helpful?
You can pick up to 3 reactions.
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
- Loan Calculator
- Profit Calculator
- Discount Calculator
- BMI Calculator
- Percentage Calculator
- Ideal Weight Calculator
- Age Calculator
- Pregnancy Due Date Calculator
- Compound Interest Calculator
- BMR Calculator (Basal Metabolic Rate)
- Tip Calculator
- Fuel Cost Calculator
- Date Difference Calculator
- Sleep Cycle Calculator
- Daily Water Intake Calculator
- Simple Interest Calculator
- Heart Rate Zones Calculator
- Running Pace Calculator
- Pet Age Calculator
- Calories Burned Calculator
- Macro Calculator
- TDEE Calculator (Total Daily Energy Expenditure)
- Waist-to-Hip Ratio Calculator
- Honor Roll Calculator
- One Rep Max (1RM) Calculator
- Ovulation Calculator
- Electricity Cost Calculator
- Unit Price Calculator
- Savings Goal Calculator
- Break-Even Point Calculator
- Paint Calculator
- Course Grade Average Calculator
- Business Days Calculator
- Time Duration Calculator
- Fuel Economy Calculator
- Temperature Converter
- Tile Calculator
- Aspect Ratio Calculator
- Roman Numeral Converter
- Goal Weight Timeline Calculator
- Salary Converter (Hourly to Annual)
- Credit Card Validator (Luhn)
- Body Surface Area (BSA) Calculator
- Feels-Like Temperature Calculator
- Ohm’s Law Calculator
- PPI (Pixel Density) Calculator
- Molar Mass Calculator
- Zodiac Sign Calculator (Western + Chinese)
- IBAN Validator
- Shoe Size Converter
- Country Info & Dialing Code Lookup
- Time Zone Difference (World Clock)
- CAGR (Compound Annual Growth Rate) Calculator
- Rule of 72 Calculator
- Blood Alcohol Content (BAC) Calculator
- Lean Body Mass (LBM) Calculator
- Pythagorean Theorem Calculator
- Speed Converter
- Download Time Calculator
- Date Calculator (Add/Subtract)
No calculators found
Comments (1)
The tool is handy for proving two expressions are the same: run each one and compare the R columns row by row. NOT (A AND B) and NOT A OR NOT B both give 1, 1, 1, 0 for the rows 00, 01, 10 and 11, which is De Morgan's law in action. Matching columns over every row is a full proof for up to three variables. Which simplification or equivalence are you trying to confirm?