Digital Logic Gate Simulator
Build circuits from AND, OR, NOT, NAND, NOR, XOR and XNOR gates, wire toggleable inputs to outputs and watch every signal propagate live, with an auto-generated truth table, Boolean expression, Karnaugh map and a NAND/NOR-only challenge mode for whatever you build.
Quick learn: one gate at a time
Click A or B to flip it between 0 and 1 and watch Y update instantly.
Add gates, input pins and outputs with the palette on the right. Click a gate's output dot (right side) then click an input dot (left side) to wire them. Click a red/green input pin to flip it, click a wired input dot to unwire it, and click a gate body to select it for deleting. Drag any shape by its body to move it.
Live truth table for your circuit
Every combination of your circuit's input pins, evaluated automatically against every output.
About the Digital Logic Gate Simulator
Free digital logic gate simulator. Build circuits from AND, OR, NOT, NAND, NOR, XOR and XNOR gates, wire toggleable inputs to outputs and watch every signal propagate live, with an auto-generated truth table, Boolean expression, Karnaugh map and a NAND/NOR-only challenge mode for whatever you build. Drag, change the sliders and see the result live. No sign-up, works on phone and computer. Built for engineering, the digital logic gate simulator runs instantly in your browser: change a setting or drag an object and the result updates at once, so you learn by trying things out rather than only reading about them.
Build circuits from AND, OR, NOT, NAND, NOR, XOR and XNOR gates, wire toggleable inputs to outputs and watch every signal propagate live, with an auto-generated truth table, Boolean expression, Karnaugh map and a NAND/NOR-only challenge mode for whatever you build. Use it to explore engineering ideas at your own pace, then check what you found against the key ideas further down this page.
How to use the Digital Logic Gate Simulator
- Press "All gates", "NAND-only challenge", "NOR-only challenge", "+ AND" to start, reset or change what is happening.
- Where you see a glowing handle, object, weight or atom, drag it with your mouse or finger. Everything responds in real time.
- Watch the readouts and graphs update as you experiment, and compare what you see with the key ideas below.
Things to try
- Load the Half Adder preset, then flip A and B and check the Sum and Carry against the live truth table and the Boolean expression shown above it.
- Load the Full Adder preset and verify that A=1, B=1, Cin=1 gives Sum=1 and Cout=1, the same as 1+1+1=11 in binary.
- Load the 2-to-1 Multiplexer preset, flip the select line S, and see how it switches which of I0 or I1 reaches the output Y.
- Turn on the NAND-only challenge and build a NOT gate from a single NAND (tie both its inputs to the same input pin), then build an AND gate from two NAND gates.
- With 2 or 3 input pins wired to one output, open the Karnaugh map under the truth table and compare its grid to the Boolean expression readout.
- In the quick-learn panel at the top, switch between AND, XOR and XNOR with the same A and B values and notice which ones agree and which ones disagree.
Key ideas you can learn
- Every logic gate is just a rule for turning one or two 0/1 inputs into a single 0/1 output, and those simple rules are the building blocks of every digital computer.
- AND is 1 only when both inputs are 1; OR is 1 when either input is 1; NOT simply flips its input.
- NAND and NOR are AND and OR with the output inverted, and either one by itself is a universal gate: any Boolean circuit, including AND, OR and NOT, can be rebuilt using only NAND gates (or only NOR gates).
- XOR outputs 1 only when its two inputs differ, which is exactly the rule for adding two binary digits without carrying, and XNOR is 1 only when its inputs match, which is how circuits test two bits for equality.
- A truth table lists the output for every possible combination of inputs, and for n inputs there are always 2^n rows, so a circuit with 3 inputs has 8 rows and one with 4 inputs has 16.
- Combinational circuits like the ones you build here have no memory: the outputs depend only on the current inputs, not on what happened before, which is what makes it safe to recompute the whole circuit from scratch every time an input changes.
- Every circuit you wire also has a Boolean algebra expression, shown live above the truth table (for example Sum = A⊕B), and for circuits with 2 or 3 input pins a Karnaugh map groups the truth table into a grid that makes it easier to simplify the expression by eye.
Boolean algebra behind each gate: AND is written Y = A·B (1 only if both are 1). OR is Y = A+B (1 if either is 1). NOT is Y = A′ (flips the bit). NAND and NOR are AND and OR with the output flipped, and are called universal gates because any Boolean function, including AND, OR and NOT themselves, can be built from NAND alone (or NOR alone) — which is why real chips are mostly built from just one of them. XOR is Y = A⊕B (1 only if A and B differ, the basis of binary addition) and XNOR is its complement (1 only if they match, useful for comparing two bits for equality).
Where this is used in the real world
Every processor, memory chip and embedded controller is built from millions of gates like these; digital electronics engineers use exactly this kind of gate-level design, truth tables and adder circuits to build calculators, CPUs, traffic light controllers and the arithmetic units inside every computer and smartphone.
Who is this simulation for?
Engineering and technology students, makers, robotics clubs and teachers of design and technology. It gives a hands-on feel for how machines behave before you build a real one.
For teachers: project it on the board, let students predict what will happen, then run it together. For students: change one thing at a time and write down what changes.
Frequently asked questions
What is the difference between AND, OR and XOR?
AND needs both inputs to be 1 to give a 1. OR needs at least one input to be 1. XOR (exclusive OR) needs the two inputs to be different from each other, so 1-0 or 0-1 gives 1, but 0-0 and 1-1 both give 0.
Why are NAND and NOR called universal gates?
Because you can wire NAND gates together (or NOR gates together) to reproduce the behaviour of AND, OR and NOT, so a whole computer chip can be manufactured from just one repeated type of gate, which is cheaper and simpler to fabricate.
How does the Half Adder become a Full Adder?
A Half Adder only adds two bits and produces a Sum and a Carry. A Full Adder adds a third input, the carry-in from a previous column, so it can be chained with other Full Adders to add numbers with many bits, one column at a time, exactly like adding by hand on paper.
What is the NAND-only or NOR-only challenge?
It hides every gate button except NAND (or except NOR) in the palette and challenges you to rebuild AND, OR, NOT and XOR using only that one gate. Since NAND (and separately NOR) is functionally complete, it is always possible, and the simulator tells you when your circuit's truth table matches a known gate.
Is the Digital Logic Gate Simulator free to use?
Yes. It is completely free, with no signup, no download and no ads inside the simulation. It runs in your web browser.
Does the Digital Logic Gate Simulator work on a phone or tablet?
Yes. It uses touch as well as the mouse, so you can drag objects with your finger. A larger screen makes the controls easier to see.