Logic Gate Calculator

Evaluate AND, OR, NOT, NAND, NOR, XOR, and XNOR gates and inspect the complete truth table.

Evaluate a logic gate
Choose a gate, toggle its binary inputs, and calculate the output.

Truth table

Input AInput BOutput
000
010
100
111

About logic gates

Logic gates are the fundamental decision-making elements of digital electronics. Each gate receives one or more binary inputs, represented by zero and one, and produces a binary output according to a Boolean rule. In physical circuits those states correspond to voltage ranges rather than perfect numbers, but binary notation makes the behavior easy to analyze. This calculator evaluates the seven common gate types and generates the complete truth table for the selected operation. An AND gate outputs one only when both inputs are one. OR outputs one when either or both inputs are one. NOT is a unary gate that inverts its single input. NAND and NOR negate AND and OR respectively, so their outputs are opposite to the underlying operation. XOR, or exclusive OR, outputs one when the two inputs differ. XNOR outputs one when the inputs match, making it useful as a one-bit equality detector. A truth table lists every possible input combination and the corresponding output. Two binary inputs create four combinations: zero-zero, zero-one, one-zero, and one-one. A single-input NOT gate has only two rows. Truth tables provide a systematic way to verify a circuit, derive a Boolean expression, compare apparently different designs, and identify conditions that activate an output. Larger circuits can be analyzed by adding columns for intermediate gates. NAND and NOR are called universal gates because either type alone can be combined to reproduce every other Boolean operation. This property is valuable in integrated-circuit design and in practical prototyping when a designer wants to minimize the number of chip families. XOR is especially common in adders, parity generators, controlled inverters, and change detectors, while XNOR appears in comparators and matching circuits. Use the buttons to set input values and then calculate the selected operation. The displayed expression is a compact evaluation, while the table beneath it remains a complete reference for that gate. Real hardware also has propagation delay, fan-out, noise margins, supply constraints, and undefined voltage regions; none of those electrical characteristics are represented by an ideal Boolean calculator. Consult the relevant logic-family data sheet before translating a logical design into a physical circuit.

Logic gate examples

OperationResultExplanation
AND with A = 1, B = 11Both inputs must be high for AND to be high.
OR with A = 0, B = 11At least one high input makes OR high.
XOR with A = 1, B = 01XOR is high because the inputs differ.
NAND with A = 1, B = 10NAND is the inverse of the AND result.

How to use the logic gate calculator

  1. Choose one of the seven supported gate operations.
  2. Toggle input A and, for a two-input gate, input B between zero and one.
  3. Select Calculate output to evaluate the current binary inputs.
  4. Compare the result with every possible combination in the generated truth table.

Logic gate FAQ

What is the difference between OR and XOR?

OR is high when either input or both inputs are high. XOR is high only when exactly one input is high.

Why does a NOT gate have one input?

NOT performs unary inversion, so it needs only one binary value. An input of zero becomes one, and an input of one becomes zero.

What is a universal logic gate?

A universal gate can be combined with copies of itself to implement every Boolean function. Both NAND and NOR have this useful property.

What does a truth table show?

A truth table enumerates all possible input combinations and their outputs. It is a direct way to define and verify the behavior of a digital function.

Are zero and one actual circuit voltages?

They represent low and high logic ranges rather than exact universal voltages. The valid ranges depend on the logic family, supply voltage, and device data sheet.