Logic Gate Truth Table

Interactive AND, OR, NAND, NOR, XOR, XNOR, NOT truth tables.

Calculator Electronics Updated Apr 18, 2026
How to Use
  1. Pick a gate type; click inputs to toggle 0/1.
  2. Full truth table updates live.
Input
Presets
Gate
A
B
Y
Gate

Truth Table

Pick a gate to see its full truth table.

Gate Cheatsheet

AND
Y = A · B
1 only if all inputs are 1.
OR
Y = A + B
1 if any input is 1.
NAND
Y = (A · B)'
Functionally complete — can build any logic.
NOR
Y = (A + B)'
Also functionally complete.
XOR
Y = A ⊕ B
1 when inputs differ; half-adder sum.
NOT
Y = A'
Inverter.

History of Logic Gates

George Boole published An Investigation of the Laws of Thought in 1854, introducing the algebra of logic that now bears his name — AND, OR, NOT operating on true/false values. Claude Shannon\'s 1938 master\'s thesis "A Symbolic Analysis of Relay and Switching Circuits" connected Boolean algebra to electromechanical relays, founding the field of digital circuit design almost single-handedly.

The first practical logic gates were vacuum-tube circuits in computers like ENIAC (1945) and Colossus (1944). Transistor-transistor logic (TTL) appeared in 1961 with the Texas Instruments SN5400 series NAND gate; CMOS logic families followed in 1963 from RCA. TTL and CMOS remained the dominant discrete-logic families for decades. Today, discrete 74-series logic is rare — most digital function now lives inside FPGAs or full SoCs — but truth tables are still the fundamental tool for describing any digital behavior.

NAND (and NOR) are functionally complete: any Boolean function, no matter how complex, can be implemented using NAND gates alone (or NOR alone). This universality property made NAND the dominant choice for early CMOS libraries — fabs only had to characterize one cell design to offer a full logic family. Modern standard-cell libraries include dozens of gate types for compactness and speed, but the underlying logic-completeness principle is unchanged.

About This Calculator

Pick a gate type and input values (A and B for 2-input gates, just A for NOT). The tool computes Y and shows the full truth table below. Useful for verifying homework, building intuition for new gate types (XNOR, for instance), and quickly looking up unfamiliar equations.

For serious design work, use a proper HDL simulator (Verilog/VHDL with ModelSim, Icarus Verilog, Verilator) or schematic capture with logic simulation (LTspice, Qucs). This calculator is a quick reference, not a synthesis tool. Everything runs client-side; no values leave your browser.

Frequently Asked Questions

Why NAND is universal?

Any Boolean function can be built from NAND gates alone (same for NOR).

XOR uses?

Parity checking, half-adder sum.

Common Use Cases

Homework

Validate truth tables.

PCB Design

Pick CMOS logic family.

Last updated: