Logic Gate Simulator screenshot

Logic Gate Simulator

Toggle the inputs of AND, OR, NOT, NAND, NOR, XOR or XNOR and read the output lamp beside the gate’s full truth table.

Privacy First
0 Runs
Updated 2026-11-22
Runs in your browser
No sign-up, no upload
Exact boolean evaluation

Logic Gate Simulator

Toggle the inputs of AND, OR, NOT, NAND, NOR, XOR or XNOR and read the output lamp beside the gate’s full truth table.

What the page does

The gate is chosen from the seven two-input forms plus NOT. Toggling an input evaluates the gate with that helper and lights the lamp; the table prints every input row and its output for the chosen gate.

NOT is shown with one input, because it has one. The table is rebuilt from the same evaluation function as the lamp, so the two cannot disagree.

The page runs entirely in this browser tab; nothing is uploaded.

Choose a gate, toggle A and B, and watch the lamp. The panel prints the gate, its output and the full truth table, with NOT shown as a one-input gate.

Every table row is evaluated by the same function that lights the lamp, so a row cannot say something the lamp contradicts. The page computes the gate; it does not simulate a circuit of several gates.

How to use Logic Gate Simulator

Choose a gate from the list. Its truth table appears and the inputs reset for the new gate.

Press an input button to switch it between 0 and 1. The lamp and the output line update immediately, and the matching row of the table is the one being shown.

Why the table and the lamp share one function

A truth table written by hand beside a live gate is a second source of truth, and the two eventually disagree. Here both are produced by logicEval, so a change to a gate changes the lamp and the table together.

NOT is the one case where the input count differs. The page drops the B input rather than leaving a dead control, and the table drops the B column, because a one-input gate with a two-input table would be a lie about its arity.

What to Expect

Best for

  • Learning the seven common gates
  • Checking a truth table by hand
  • Seeing NAND and NOR beside AND and OR

Not ideal for

  • Simulating a multi-gate circuit
  • Timing diagrams or sequential logic
  • Boolean algebra simplification

What this tool keeps

  • Nothing: the page reads no input beyond the toggles

What may need cleanup

  • Nothing: switching gates resets the inputs

Common errors

  • NOT shows one input, not two
  • A gate change resets B to zero so the lamp always matches a visible table row

Example use cases

  • Compare AND with NAND
  • Check the XOR table
  • Show that NOR is the negation of OR

Sample input

XOR with A set to 1 and B set to 1

Sample output

The output is 0, matching the last row of the XOR table

Who this is for

  • Students learning logic gates
  • Anyone checking a truth table

Frequently asked questions

Why does NOT have only one input?

Because a NOT gate has one input. Showing a second toggle that the gate ignores would suggest an arity it does not have, so the input and the table both drop B.

Can I build a circuit from several gates?

No. This page evaluates one gate at a time. A multi-gate circuit needs wired connections and a different model, and the page does not pretend a single gate is one.

Is the truth table computed or typed in?

Computed. Each row is evaluated by the same function that lights the lamp, so the table cannot drift from the gate.

Developer program

Build custom tools for your store

Join the SDK program to create useful ecommerce utilities for your store.