Logic Gates

Flip the inputs and watch every gate respond, build your own circuits from adders to memory, then test yourself with challenges and a quiz.

Tap the input switches, or tap any row of the truth table to set the inputs to match it.

Works on Windows, Mac, Linux, iPhone, iPad and Android, nothing to install.

What is Logic Gates?

Logic Gates is an interactive simulator of the building blocks inside every computer, phone and digital device. You can work with every standard gate, AND, NAND, OR, NOR, XOR (also called EOR), XNOR and NOT, set each input on or off, and watch the output change instantly. Each gate supports from one up to five inputs, and the app builds the full truth table for you, showing the output for every possible combination.

It turns an abstract topic from computer science and electronics into something you can click, test and see for yourself.

Why use it?

Logic gates are where digital technology begins. Each gate takes inputs that are either 1 (on, true) or 0 (off, false) and produces an output according to a simple rule:

  • AND outputs 1 only when every input is 1.
  • OR outputs 1 when at least one input is 1.
  • NOT flips a single input: 1 becomes 0 and 0 becomes 1.
  • NAND and NOR are AND and OR with the output flipped.
  • XOR (exclusive OR) outputs 1 when an odd number of inputs are 1; with two inputs, that means one or the other, but not both.
  • XNOR is XOR flipped, outputting 1 when an even number of inputs are 1.

Combine enough of these gates and you get circuits that add numbers, store memory and run software. Understanding them is the foundation for computer science, electronics, digital design and even programming logic.

Reading the rules is one thing; seeing them in action is another. Toggling inputs and watching outputs change makes the patterns stick. Working with three, four or five inputs shows how the rules scale. A truth table for n inputs has 2 to the power of n rows, so five inputs means 32 combinations, which is tedious to write out by hand but instant here.

How to use it

  1. In Gates, choose a gate type, such as AND or XOR, and set the number of inputs, from one to five.
  2. Tap each input switch to flip it between 0 and 1. Live wires glow, and the lamp lights when the output is 1.
  3. The truth table below shows the output for every combination at once, with the current one highlighted. Tap any row to set the switches to match it.
  4. Switch between US (distinctive-shape) and IEC (rectangle) symbols, and read the Boolean expression for each gate.
  5. In Builder, add switches, lamps, a clock and any gates, drag them into place, and wire an output dot to an input dot. Load ready-made circuits such as a half adder, a full adder, a multiplexer and an SR latch that remembers one bit.
  6. Try the ten build challenges, from making NOT out of NAND gates to building a full adder. Check my circuit tests every row of the truth table for you.
  7. Test yourself in the Quiz: predict outputs, name gates from their truth tables and read Boolean expressions.

A good learning exercise is to predict the output before you click. Try guessing the full truth table for a three-input NOR or XOR, then check it. Another is to compare pairs: notice how every NAND output is the opposite of AND, and how XOR and XNOR mirror each other.

You may also discover why NAND and NOR are called universal gates: any other gate can be built from combinations of either one alone.

When to use it

Use Logic Gates:

  • Studying computer science or electronics at school, college or university.
  • Revising for exams that include truth tables and Boolean logic.
  • Teaching, as a live demonstration on a classroom screen.
  • Designing or checking simple digital circuits.
  • Learning programming, where the same logic appears in and, or and not conditions.
  • Exploring how computers work out of pure curiosity.

Teachers can project it during lessons and ask students to call out predictions. Students can use it to check homework truth tables in seconds, and hobbyists building circuits can confirm gate behaviour before wiring anything up.