AND Logic Gate Simulator – Free

This AND gate simulator evaluates a two-input AND gate for the values you choose. Set each input to 0 or 1 and the result shows the single output bit.

How to use the AND Gate Simulator tool

  1. Choose 0 or 1 in the Input A list. It starts at 1.
  2. Choose 0 or 1 in the Input B list. It starts at 0.
  3. Select Calculate to evaluate the gate.
  4. Read the output bit in the Result box. It is 1 only when both inputs are 1.
  5. Select Copy to copy the bit, or Clear to return both lists to their starting values.

How an AND gate works

An AND gate is a basic digital logic gate with two or more inputs and one output. The output is high, written 1, only when every input is high. If any input is low, the output is low. In Boolean algebra the operation is written A · B, AB or A ∧ B, and most programming languages spell the bitwise form with the & operator. It behaves like multiplication on the values 0 and 1: 1 × 1 = 1, and anything times 0 is 0.

This simulator models the two-input form. It reads Input A and Input B as single bits, applies a bitwise AND and prints one bit. There is no timing, voltage or propagation delay in the model. It answers the logic question only.

AND gate truth table

A two-input gate has four possible input combinations, and three of them give 0. The page opens with Input A at 1 and Input B at 0, which is the third row below.

Because only one row produces 1, an AND gate is a natural detector for one exact combination. Put inverters in front of some inputs and it detects any other single combination, which is how address decoders are built.

A  B  |  A AND B
0  0  |  0
0  1  |  0
1  0  |  0
1  1  |  1

Symbols, chips and transistors

On schematics that follow the distinctive-shape style of IEEE Std 91, an AND gate is drawn with a flat input side and a rounded, D-shaped output side. The rectangular style of IEC 60617 draws a box with an ampersand inside. Both mean the same function.

The classic part is the 7408 from the 7400 logic family, which packs four independent two-input AND gates into a 14-pin package. In CMOS, an AND gate is usually built as a NAND gate followed by an inverter, six transistors in total, because NAND is the cheaper structure to make directly.

Where AND logic is used

The same rule appears at every level of a digital system, from single wires to whole words in software.

  • Enable signals: a data line ANDed with an enable line passes data only while enable is 1.
  • Masking: ANDing a value with a mask keeps the bits where the mask is 1 and clears the rest.
  • Half adders: the carry output of a one-bit adder is A AND B.
  • Address decoding: a chip select goes active only when a set of address lines all match.

AND gate simulator versus the Bitwise AND Calculator

This page works on one bit per input, which suits learning truth tables and checking a single logic condition. To AND whole binary words such as 1100 and 1010, use the Bitwise AND Calculator, which applies the same rule to every bit position. The NAND Gate Simulator shows the inverted output.

Frequently asked questions

What is the output of an AND gate when one input is 0?

The output is 0. An AND gate outputs 1 only when all of its inputs are 1, so a single 0 on either input forces the result to 0 regardless of the other input.

Can this simulator handle three or more inputs?

No. The form has two inputs, Input A and Input B. To evaluate a three-input AND, run it twice: AND the first two values, then AND that result with the third. The order does not matter because AND is associative.

How is an AND gate different from a NAND gate?

A NAND gate is an AND gate with the output inverted. Where AND gives 0, 0, 0, 1 for the four input rows, NAND gives 1, 1, 1, 0. NAND is called universal because any other gate can be built from NAND gates alone.

Does the simulator send my inputs anywhere?

No. The gate is evaluated by JavaScript running in your browser. The two selected values are not sent over the network.

Related tools