Boolean Function Calculator

Enter a formula or a value vector — get the truth table, PDNF, PCNF, Zhegalkin polynomial, Post classes, minimal DNF and CNF, a Karnaugh map and step-by-step solutions. Everything runs in your browser: no install, no data sent to a server.

How to write functions

Variables are Latin or Russian letters, with or without a numeric index: a, b, x1, X12, abc. Case matters: x and X are different variables, and x2 sorts before x10. Names stick together: ab is a single variable, not a·b.

OperatorMeaningHow to type
NegationNOT¬a, !a
ConjunctionANDa ∧ b, a & b, a * b, a • b
DisjunctionORa ∨ b, a + b
Exclusive ORXORa ⊕ b, a ^ b
Implicationa implies ba → b, a -> b, a => b
Equivalencea equals ba ≡ b, a = b, a <=> b, a ~ b
Sheffer strokeNANDa ↑ b, a | b
Peirce arrowNORa ↓ b

Precedence: parentheses → negation → conjunction and Sheffer stroke → disjunction and Peirce arrow → XOR → implication → equivalence. Neighbors on the same level associate to the left; implication associates to the right: a → b → c reads as a → (b → c).

You may omit the conjunction sign only next to parentheses: a(b∨c), (a∨b)c, (a∨b)(c∨d). Everywhere else use an explicit sign: a ∧ b. After a negation the sign is required too.

Instead of a formula you can enter a value vector — a string of zeros and ones whose length must be a power of two: 0001, 1 0 1 1 0 1 0 1. Variables then come from the «Variables» button in the toolbar under the input (next to «Keyboard»), which expands on click: eight symbols need three names, e.g. x1, x3, x5. Table rows go from 00…0 to 11…1, the last variable toggles fastest. The full table supports functions of at most 10 variables (1024 rows).

Frequently asked questions

What can the Boolean function calculator do?

From a formula or a value vector the calculator builds a truth table (up to 10 variables, 1024 rows), PDNF, PCNF, the Zhegalkin polynomial, Post classification, minimal DNF and CNF, a Karnaugh map (2–6 variables) and the list of dummy variables. Turn on «Show solution» to see the intermediate steps.

How do I write a formula?

Variables are Latin or Russian letters, with or without a numeric index (a, b, x1, X12, abc); case matters: x and X are different variables. Operators: ¬ (NOT), ∧ (AND), ∨ (OR), ⊕ (XOR), → (implication), ≡ (equivalence), ↑ (NAND), ↓ (NOR). Precedence: parentheses, negation, ∧/↑, ∨/↓, ⊕, →, ≡. Implication associates to the right: a→b→c means a→(b→c). Synonyms are accepted: !, &, *, , +, ^, ->, =>, =, <=>, ~, |.

How does the calculator differ from the truth table generator?

The truth table generator only builds a table from a formula. The calculator is the fuller tool: on top of the table it adds PDNF, PCNF, the Zhegalkin polynomial, Post classes, minimization, a Karnaugh map, dummy variables and step-by-step solutions. Note: in the calculator the symbol | means NAND (Sheffer stroke), while in the generator it means OR — it has a different, simpler syntax. If you only need the table, the generator is enough; for PDNF, PCNF, the Zhegalkin polynomial or a Karnaugh map, you are on the right page.

Related tools and materials

Test the function in the simulator →