Logic Circuit Simulator: Build & Test Digital Circuits Online

A free online logic gate simulator. Build a circuit with AND, OR, NOT, NAND, NOR, XOR and XNOR gates, or type a Boolean expression and turn it into a circuit. See the expression, truth table and Karnaugh map, convert to NAND-only or NOR-only, and watch latches, flip-flops and counters on a timing diagram. No sign-up and nothing to install.

Circuit Simulator
Build a circuitClick or drag a part from the list, or type an expression above. Drag from a part’s right dot to another part’s left dot to connect.

How to use the logic circuit simulator

  1. Add parts: click or drag gates, switches and bulbs from the list, or type an expression and press Build circuit.
  2. Connect them: drag from the dot on the right of one part to the dot on the left of another. Click a wire to remove it.
  3. Test it: click a switch to turn it on or off. Wires and bulbs light up when they carry a 1.
  4. Read it: the Expression line shows the Boolean expression, and Truth table gives the table, the minimal SOP/POS and a Karnaugh map.
  5. Improve it: use Design from table, NAND only, NOR only, or Timing to explore the circuit further.

Frequently asked questions

How do I convert a Boolean expression to a logic circuit?

Type the expression into the box at the top of the simulator, for example A AND (B OR NOT C), and press Build circuit. The tool draws the gates and wires for you. You can write AND, OR, NOT, NAND, NOR, XOR and XNOR as words, or use the shorthand A'B + AB'. To get several outputs at once, separate them with a semicolon, such as Sum = A XOR B; Carry = A AND B.

How do I find the Boolean expression of a logic circuit?

Build or load a circuit and look at the Expression line under the canvas. It updates as you add gates and wires, and shows one expression for each bulb. Name your switches and bulbs by double-clicking them so the expression uses your own variable names.

How do I make a truth table from a logic circuit?

Add one or more switches as inputs and a bulb (or a 7-segment display) as the output, then press Truth table. The tool tries every switch combination, lists the outputs, and highlights the row that matches your current switch positions. Circuits with a clock, flip-flops or a feedback loop depend on history, so they have no plain truth table. Use the Timing diagram for those.

How do I simplify a Boolean expression or circuit?

Open the Truth table and scroll to the simplifier. For each output it shows the minterms and maxterms, the minimal sum of products (SOP), the minimal product of sums (POS) and a Karnaugh map for 2 to 4 variables. The minimisation uses the Quine–McCluskey method and supports up to 6 switches. Use the Karnaugh Map Solver link to continue in the full K-map tool.

Can I design a circuit from a truth table?

Yes. Press Design from table, choose the number of inputs and outputs, and click the cells to set each output to 0, 1 or X (don't care). The tool shows the minimal expression as you click, and Build circuit turns it into gates. You can also start from a ready-made table such as a full adder or a BCD to 7-segment decoder.

How do I build a circuit using only NAND gates or only NOR gates?

Build the circuit any way you like, then press NAND only or NOR only. The simulator rewrites it with just that one gate type and keeps the same behaviour, so you can check it with the truth table. NAND and NOR are called universal gates because every other gate can be made from them.

How do I build an SR latch or a D flip-flop?

Open the Examples list and choose SR latch (NOR gates), SR latch (NAND gates) or Gated D latch. These are made from ordinary gates with feedback, so you can see how memory works. The Memory group in the parts list also has ready-made D, T and JK flip-flops and an SR latch. Use Pause, Step and the speed control to follow the clock one cycle at a time.

Which classic homework circuits are included?

The Examples list includes half and full adders, half and full subtractors, 1-bit and 2-bit comparators, multiplexers, a 2-to-4 decoder, a priority encoder, binary to Gray code and back, a BCD to 7-segment decoder, parity generators, a majority voter, NAND-only and NOR-only designs, SR and D latches, a shift register and ripple counters.

Is the simulator free, and do I need to sign up or install anything?

It is free and runs in your browser, with no account and no install. You can save a circuit as a file, open it again later, export an image, or copy a link that opens the same circuit for someone else.