Truth Table
Generate truth tables for Boolean logic expressions. Supports AND, OR, NOT, XOR, NAND and NOR. Auto-detects variables and shows all possible combinations. Processed in the browser.
Operadores: AND &&
OR ||
NOT !
XOR
NAND
NOR
— variáveis: letras maiúsculas (A, B, C…)
Operadores suportados
| Operador | Sintaxe | Descrição |
|---|---|---|
| AND | A AND B, A && B | Verdadeiro se ambos forem V |
| OR | A OR B, A || B | Verdadeiro se ao menos um for V |
| NOT | NOT A, !A | Negação |
| XOR | A XOR B | Verdadeiro se exatamente um for V |
| NAND | A NAND B | NOT (A AND B) |
| NOR | A NOR B | NOT (A OR B) |
Check your logic against every case
A three-clause if statement, a logic exercise, a digital circuit you need to double-check: the question is always the same, does the expression do what you expect in every combination? Type it using AND, OR, NOT, XOR, NAND and NOR (or &&, || and !) and the truth table renders instantly, one row per combination of values, with the result column highlighted in green and red. There is no button to press: the table rebuilds on every keystroke.
Precedence matters here: NOT is evaluated first, then AND and NAND, and finally OR, XOR and NOR, which share the lowest level and associate left to right. So A AND B XOR C is read as (A AND B) XOR C, and A XOR B OR C becomes (A XOR B) OR C, which may not be what you meant. Variable names can be whole words (SENSOR, VALVE), upper and lower case count as the same variable, and the limit is 8 variables, which means 256 rows.
When in doubt about precedence, add parentheses and move on. One genuinely useful trick: test equivalences such as De Morgan's laws by generating the table for NOT (A AND B), then for NOT A OR NOT B, and comparing the result columns. The tool only enumerates cases, it does not simplify the expression (that is Karnaugh map territory). Everything is computed in JavaScript in your browser; nothing leaves the page.
Frequently asked questions
What is the operator precedence?
How many variables can I use?
Can variable names be longer than one letter?
Related Tools
JSON ↔ CSV Converter
Convert data between JSON (array of objects) and CSV bidirectionally. Paste and convert instantly in the browser, no file upload needed.
Regex Tester
Test regular expressions in real time. See highlighted matches and captured groups.
Cron Expression Editor
Parse and build cron expressions with human-readable descriptions, next execution times and shortcuts for common schedules.