Logic Gate Simulator

Interactive digital logic circuit builder with live truth table.

How to use

  1. Start from a built-in preset (Half Adder, SR Latch, 2:1 MUX) or add Input, Clock, Output, and logic gates from the toolbar.
  2. Click an output pin (right side of a node) and then an input pin (left side) to connect a wire; click any wire to remove it.
  3. Click Input switches to toggle 0 and 1 and watch signals and the Live Truth Table update instantly.

Questions

Which logic gates are included?
All 7 standard gates: AND, OR, NOT, NAND, NOR, XOR, and XNOR, plus toggle Input switches, an auto-toggling Clock pulse, and Output LEDs.
Does it generate a truth table automatically?
Yes. Whenever your circuit has 1 to 4 Inputs and at least 1 Output, the Live Truth Table updates automatically and highlights the active row.
Can I build memory circuits like an SR Latch?
Yes. The simulator supports feedback loops and includes a ready-to-run SR Latch preset using cross-coupled NOR gates.

Logic Gates Reference Guide & Truth Tables

Explore how each digital logic gate processes binary inputs (0 = LOW / OFF, 1 = HIGH / ON), its Boolean algebra expression, real-world role, and complete truth table.

AND Gate

Y = A · B

An AND gate outputs HIGH (1) only when all of its inputs are HIGH (1). If any input is LOW (0), the output stays 0. It performs logical multiplication and is commonly used for signal enabling, masking, and Carry calculation in binary adders.

ABY (A · B)
000
010
100
111

OR Gate

Y = A + B

An OR gate outputs HIGH (1) whenever at least one of its inputs is HIGH (1), and outputs 0 only when every input is 0. It performs logical addition and is widely used in alarm triggers, interrupt lines, and combining active conditions.

ABY (A + B)
000
011
101
111

NOT Gate (Inverter)

Y = A'

A NOT gate—also called an inverter—has a single input and outputs the exact opposite logic state: 0 becomes 1, and 1 becomes 0. Inverters are essential for generating active-low control signals, building oscillators, and implementing De Morgan’s transformations.

AY (A')
01
10

NAND Gate

Y = (A · B)'

A NAND (NOT-AND) gate outputs 0 only when both inputs are 1, and outputs 1 in all other cases. Because any Boolean function (AND, OR, NOT, XOR) can be constructed using only NAND gates, NAND is known as a universal gate and forms the foundation of modern flash memory.

ABY (A · B)'
001
011
101
110

NOR Gate

Y = (A + B)'

A NOR (NOT-OR) gate outputs HIGH (1) only when all inputs are LOW (0). Like NAND, NOR is a universal gate capable of implementing any digital logic circuit. Cross-coupling two NOR gates creates a classic SR Latch capable of storing 1 bit of memory.

ABY (A + B)'
001
010
100
110

XOR Gate (Exclusive-OR)

Y = A ⊕ B

An XOR gate outputs HIGH (1) when its two inputs are different (one is 1 and the other is 0) and outputs 0 when both inputs are identical. XOR is the core gate for binary addition (computing the Sum bit in Half and Full Adders), parity checking, and bit toggling.

ABY (A ⊕ B)
000
011
101
110

XNOR Gate (Equivalence)

Y = (A ⊕ B)'

An XNOR (Exclusive-NOR) gate is the inverse of XOR and outputs HIGH (1) whenever both inputs are equal (either both 0 or both 1). Because of this behavior, XNOR is used as a 1-bit equality comparator in arithmetic logic units (ALUs) and error-detection circuits.

ABY (A ⊕ B)'
001
010
100
111

About Logic Gate Simulator

PlainTool Logic Gate Simulator is a free, interactive digital electronics and Boolean logic sandbox that runs 100% locally in your browser with zero signup. Build circuits by placing toggle Input switches (0 or 1), a configurable Clock pulse generator, Output LEDs, and standard IEEE/ANSI logic gates, then wire them together to watch high (1) and low (0) signals propagate in real time.

All seven fundamental digital logic gates are included: AND (outputs 1 only when both inputs are 1), OR (outputs 1 when at least one input is 1), NOT / Inverter (flips 0 to 1 and 1 to 0), NAND (universal gate outputting 0 only when both inputs are 1), NOR (universal gate outputting 1 only when both inputs are 0), XOR / Exclusive-OR (outputs 1 when the two inputs differ—essential for binary addition), and XNOR / Equivalence (outputs 1 when both inputs match).

Whenever your circuit has 1 to 4 Input switches and at least one Output LED, the simulator automatically computes a Live Truth Table and highlights the active row matching your current switch positions. You can also double-click any Input, Clock, or Output label directly on the canvas to rename it (such as A, B, SUM, or CARRY), duplicate selected gates from the canvas toolbar, and undo or redo changes freely.

To help you learn faster, built-in example circuits are included out of the box: a Half Adder (combining XOR and AND gates to add two bits), a 2-to-1 Multiplexer (MUX) using NOT, AND, and OR gates to select between two data lines, and a cross-coupled NOR SR Latch demonstrating sequential feedback and 1-bit memory storage.

Common use cases

  • Computer science, engineering, and physics students studying Boolean algebra, De Morgan’s laws, truth tables, and combinational logic.
  • Building and verifying classic digital circuits such as Half Adders, Multiplexers, comparators, and SR Latches interactively.
  • Teaching and demonstrating digital logic gates and live signal flow in classrooms or online tutorials with no software installation.

Practical tips

  • Click any Input switch without dragging to toggle between 0 and 1, or double-click its label on the canvas to rename it.
  • Select any gate on the canvas and use the top-left floating toolbar to Copy (Ctrl+D), Undo (Ctrl+Z), Redo (Ctrl+Y), or Delete (Del).
  • Load the SR Latch preset to experiment with Set/Reset feedback loops, or the Half Adder preset to see binary Sum and Carry bits in action.

Limits & compatibility: Simulates idealized zero-delay digital logic (0/1) in the browser; live truth tables are generated automatically for circuits with 1 to 4 Input nodes.