Skip to content
Create an account

Logic Gate Truth Tables

The rules and the AND table below are taken directly from our digital logic article. The OR and NOT outputs follow the rules stated in that same source.

At a glance

Two-input gate reference

A two-input gate has four input combinations; a three-input gate has eight. The table shows the output for each combination.

GateRule from our articleA=0 B=0A=0 B=1A=1 B=0A=1 B=1
AND (VE)Output is 1 only when all inputs are 10001
OR (VEYA)Output is 1 when at least one input is 10111
NANDInverted output of an AND gate1110
NORInverted output of an OR gate1000
XOROutput is 1 when the inputs differ0110

How to use this reference

Digital circuits use two states: true or false, 1 or 0, high or low voltage. A logic gate produces a new signal from those states.

The AND example in our article uses a door that opens only when a key is turned and the handle is pressed: both inputs must be 1.

The OR example uses a room light controlled by two switches: one closed switch is enough to make the output 1.

The NOT gate has a single input and inverts it: input 1 gives output 0, and input 0 gives output 1. It is also called an inverter.

NAND and NOR are called universal gates because, as our article states, all other logic operations can be built from them. XOR is the basis of bit-addition circuits.

Real gates are not instantaneous: a short delay between an input change and the output change can accumulate in large circuits.

The AND output rows are quoted from our article. OR, NOT, NAND, NOR and XOR rows are direct consequences of the rules stated there; no timing values are added.
Digital logic gates articleThe full explanation with everyday examples.Logic simulatorBuild gates and watch the truth table live.All browser simulatorsMore hands-on tools for electronics lessons.

Keep the reference close. Create a free account to save your place, open the simulators and follow the full electronics guides.

Topic tracking

Frequently asked questions

When is an AND output 1?

Only when every input is 1. For two inputs the four outputs are 0, 0, 0 and 1.

How many rows does a truth table need?

A two-input gate has four combinations. Our article notes that a three-input gate has eight.

What is a NOT gate?

It has one input and returns the opposite value: 1 becomes 0 and 0 becomes 1. It is also called an inverter.

Why are NAND and NOR called universal?

Because all other logic operations can be created using only those gates, as stated in our digital logic article.

Interactive circuit guide

Run the simulation, follow the build steps one by one and try it in our real app.

Real screenshot of our circuit simulator Stopped
Open in our app →

Step-by-step build