Education / Logic

Logic Gate Simulator: Build and Test Digital Circuits

Drag AND, OR, NOT, NAND, NOR, XOR and XNOR gates onto a board. Connect switches, a clock and output LEDs, try example adders and an SR latch, and save your circuit as JSON.

Logic Gate Simulator: Build and Test Digital Circuits: Evaluates a circuit whenever its switches, clock or connections change. Unconnected pins show an unknown signal. The half adder and full adder demonstrate binary addition; the SR latch demonstrates feedback and memory. Feedback that does not settle is shown as unknown. The truth table treats each switch and clock as an independent input and starts each row from an all-low internal state. Runs 100% locally in your browser with zero server file uploads.

Runs
In your browser
Cost
Free · no sign-up
Availability
Ready to use
Logic gate simulatorLocal processing

Runs entirely in your browser

Drag a gate onto the board, or tap its button. Drag nodes to move them. Tap an output pin, then an input pin to draw a wire; dragging between pins also works. Tap an input switch to toggle it. Select a node to rename or remove it; arrow keys move a focused node.

Input switchA0Input switchB0XORXOR0ANDAND0Output LEDSum0Output LEDCarry0

Stable after 1 iterations. Unconnected pins show ?.

The SR latch uses two NOR gates. Set or reset establishes a state; both low retains the previous stable state. Both high is invalid. Releasing both together can oscillate in this simultaneous-update model. No analogue timing or propagation delay is simulated.

Wires: remove a connection
A → XOR, input 1
B → XOR, input 2
A → AND, input 1
B → AND, input 2
XOR → Sum, input 1
AND → Carry, input 1

Circuit truth table

Inputs and clocks are independent variables, up to eight. Each row starts from an all-low internal state; feedback circuits can depend on history and have no single combinational truth table. ? marks unresolved or oscillating output.

ABSumCarrySettled
0000Yes
0110Yes
1010Yes
1101Yes

Digital logic

Gate definitions and combinational and sequential logic: MIT OpenCourseWare, Computation Structures, units 4 and 5. https://ocw.mit.edu/courses/6-004-computation-structures-spring-2017/ . Examples and diagrams on this page are original.

Simulation model

Signals are high, low or unknown. Updates occur simultaneously until the circuit settles, repeats a state or reaches 64 updates. This is a teaching model; it does not model electrical voltage, propagation delay or metastability. Feedback truth-table rows can depend on the initial state.

How to use it

  1. Drag gates onto the board or tap their buttons. Move a node by dragging it.
  2. Tap an output pin and then an input pin to connect them. Toggle input switches or run the clock.
  3. Inspect the live signals and truth table, or save and load the circuit locally or as a JSON file.

Privacy & limitations

The circuit runs in your browser. Local saves stay on this device; JSON exports are downloaded without uploading your circuit.

Related tools

Frequently asked questions

Why does an output show a question mark?

A required pin may be unconnected, or feedback may oscillate or fail to settle. The simulator stops after 64 simultaneous updates and shows unknown derived outputs rather than claiming a stable result.

How does the SR latch behave?

The example uses two NOR gates. Set or reset establishes a state, and both inputs low retains the previous stable state. Both inputs high is invalid; releasing both together can oscillate in this model. Analogue timing and propagation delays are not simulated.

What can I save?

JSON saves the nodes, labels, positions, switch settings and connections. It does not save the clock's running state or a latch's previous internal state. A local save uses this browser's storage; export and import let you move a circuit between devices.

How big can a circuit be?

The board accepts up to 80 nodes and 160 wires. The generated truth table supports up to eight input switches and clocks, giving at most 256 rows.

Free tool · runs in your browser · no account required