Logic Gate Calculator

Logic gates are the atoms of digital electronics: each takes binary inputs and produces a binary output by a fixed Boolean rule. With two inputs A and B you can evaluate the whole family of basic gates at once. Enter A and B as 0 or 1 and this calculator returns the output of AND, OR, XOR, NAND, NOR, and XNOR, plus the single-input NOT of A. Every output comes straight from the standard truth tables of Boolean algebra, so the results are exact and unambiguous.

0.00
0.00
0.00
0.00
0.00
0.00
0.00

Logic gate definitions

AND = 1 only if A and B are both 1
OR = 1 if A or B (or both) is 1
XOR = 1 if exactly one of A, B is 1
NAND = NOT (A AND B)
NOR = NOT (A OR B)
XNOR = NOT (A XOR B)
NOT A = 1 minus A

These are the standard two-input Boolean truth tables. Each output is exact for the four input combinations 00, 01, 10, and 11.

Digital logic context

  • NAND and NOR are universal: any logic function can be built from either alone.
  • XOR underpins binary addition and parity-bit error checking.
  • The standard graphic symbols for these gates are defined in IEEE Std 91.
  • A two-input gate has four input rows in its truth table; an n-input gate has 2 to the n rows.
  • NOT is the only single-input gate here; it simply inverts its input.

Logic gate calculator: frequently asked questions

What is a logic gate?

A logic gate is a building block of digital circuits that takes one or more binary inputs (0 or 1) and produces a single binary output according to a fixed Boolean rule. The basic gates are AND, OR, NOT, and the combinations NAND, NOR, XOR, and XNOR. This calculator evaluates all of them for two inputs.

What is the difference between OR and XOR?

OR outputs 1 if either or both inputs are 1, so 1 OR 1 is 1. XOR (exclusive OR) outputs 1 only when exactly one input is 1, so 1 XOR 1 is 0. XOR is the basis of binary addition and parity checking, while OR is the basic inclusive disjunction.

Why are NAND and NOR called universal gates?

Any Boolean function can be built entirely from NAND gates, or entirely from NOR gates, by combining them. Because of this universality and their simple transistor-level construction, NAND and NOR are heavily used in real integrated circuits. NAND is AND followed by NOT; NOR is OR followed by NOT.

What inputs does this calculator accept?

Each input must be 0 or 1. Any other value is treated as invalid and the outputs show n/a. The NOT output applies only to input A, since NOT is a single-input gate; the two-input gates use both A and B.

How do these gates relate to truth tables?

A truth table lists the output of a gate for every combination of inputs. With two inputs there are four combinations: 00, 01, 10, and 11. The gate definitions this calculator uses are exactly the standard truth tables taught in digital logic and defined in IEEE standards.

Official sources

Reviewed by the CalculatorHub team, edited by James Graham, 16 June 2026. See our methodology.