Logic Gate Visualizer

Simulate digital logic gates. Click inputs on the diagram to toggle.

Truth Table

Input A Input B Output

What are Logic Gates?

Logic gates are the fundamental building blocks of digital electronics. They are physical devices that implement Boolean functions, performing logical operations on one or more binary inputs (0 or 1) and producing a single binary output.

Every digital device you own—from your smartphone to your laptop—is essentially a massive collection of billions of microscopic logic gates. By combining simple gates like AND, OR, and NOT, engineers can create complex circuits capable of addition, memory storage, and running software.

How Logic Gates Work (Truth Tables)

The behavior of a logic gate is defined by its Truth Table, which lists all possible input combinations and their resulting output.

Common Gates

Practical Applications

Logic gates operate at the heart of computing:

FAQ

What is the difference between XOR and OR?

An OR gate outputs 1 even if both inputs are 1 (inclusive OR). An XOR (Exclusive OR) gate outputs 0 if both inputs are 1. Essentially, XOR strictly means "one or the other, but not both."

Are logic gates analog or digital?

Logic gates are digital components that process binary signals. However, physically they are built from analog transistors (MOSFETs) that are driven into saturation or cutoff states to represent 1s and 0s.

Why are NAND gates called "Universal"?

A NAND gate is called "Universal" because you can construct any other boolean function (AND, OR, NOT, etc.) using only a combination of NAND gates. This is why flash memory (like in USB drives) is built almost entirely from NAND cells.