Beginner

Logic Gate Calculator — AND, OR, NOT, NAND, NOR, XOR, XNOR

Select a logic gate and binary inputs to instantly see the output (0 or 1) — with the complete truth table showing every input combination and your chosen row highlighted.

Logic gate

Input A

Input B

Output
0

Output is 1 only when BOTH inputs are 1

Gate type
AND
Input A
1
Input B
0
Output state
LOW / FALSE
Full truth table — your current inputs are highlighted
1

A = 0, B = 0

Output = 0
2

A = 0, B = 1

Output = 0
=

A = 1, B = 0

Output = 0
4

A = 1, B = 1

Output = 1
Results are estimates for general information only and are not professional advice — always verify important results independently before relying on them. Read the full disclaimer.
Quick answer

How does this calculator work?

Select a gate (AND, OR, NOT, NAND, NOR, XOR, XNOR) and binary inputs to see the output and full truth table. AND = both must be 1; OR = any must be 1; NOT = flip; NAND/NOR = AND/OR then inverted; XOR = inputs differ; XNOR = inputs match. NAND and NOR are universal — any circuit can be built from just one of them.

Formula
AND: A·B • OR: A+B • NOT: Ā • NAND: ¬(A·B) • NOR: ¬(A+B) • XOR: A⊕B • XNOR: ¬(A⊕B)
How this is calculated

Logic gates are the elementary building blocks of digital circuits. Each gate accepts binary inputs — 0 (LOW, false) or 1 (HIGH, true) — and produces a single binary output according to a fixed Boolean rule. The complete behaviour of any gate is captured in a truth table that lists the output for every possible combination of inputs.

The seven fundamental gates are: AND (output 1 only when all inputs are 1), OR (output 1 when any input is 1), NOT (inverts a single input), NAND (AND then negated), NOR (OR then negated), XOR (1 when inputs differ), and XNOR (1 when inputs match). NAND and NOR are called universal gates because any Boolean function — and therefore any digital circuit — can be constructed from repeated copies of just one of them. This property simplifies semiconductor fabrication.

In CMOS hardware, 0 (LOW) is typically 0 V and 1 (HIGH) is the supply voltage (commonly 3.3 V or 5 V). Noise margins around each threshold allow for signal degradation along wires. High-level languages, assembly code, and ultimately every computation your device performs reduces to sequences of these gate-level operations.

Frequently asked questions

OR outputs 1 whenever at least one input is 1, including when both inputs are 1. XOR (exclusive OR) outputs 1 only when the inputs are different — one is 0 and the other is 1. When both inputs are 1, XOR outputs 0. XOR is used to detect differences, compute parity bits, build binary adders, and implement cryptographic operations.

Any Boolean function can be built using only NAND gates or only NOR gates. A NAND with both inputs tied together acts as a NOT gate. Two NANDs give an AND; combine with a NOT to get OR. This universality means manufacturers can build entire processors using a single gate cell type, reducing design complexity and allowing aggressive transistor-level optimisation.

In standard positive-logic CMOS, 0 (LOW) is approximately 0 V and 1 (HIGH) is the supply rail (3.3 V or 5 V typical). Any voltage below the LOW threshold is treated as 0; any above the HIGH threshold is treated as 1 — noise margins between these thresholds prevent spurious switching. Some older systems use negative logic, where LOW represents TRUE.

Also known as

boolean logic gate calculator
and or not gate output
truth table calculator
nand nor xor gate calculator
digital logic calculator
binary gate output calculator
logic circuit truth table

APA

TG we-Calculate Editorial Team. (2026). Logic Gate Calculator — AND, OR, NOT, NAND, NOR, XOR, XNOR [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/logic-gate-calculator

Chicago

TG we-Calculate Editorial Team. "Logic Gate Calculator — AND, OR, NOT, NAND, NOR, XOR, XNOR." TG we-Calculate. 2026. https://we-calculate.com/calculator/logic-gate-calculator.

IEEE

TG we-Calculate Editorial Team, "Logic Gate Calculator — AND, OR, NOT, NAND, NOR, XOR, XNOR," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/logic-gate-calculator

BibTeX

@misc{wecalculate_logic_gate_calculator, title = {Logic Gate Calculator — AND, OR, NOT, NAND, NOR, XOR, XNOR}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/logic-gate-calculator}}, year = {2026}, note = {TG we-Calculate} }

Did this calculator help you?