ToolSphere

Logic Gate Simulator

Computer science

Flip the inputs of AND, OR, NOT, XOR, NAND and NOR gates and watch the output change instantly. Free, for digital logic students and hobbyists.

Interactive logic gate simulator

Toggle logic inputs and instantly simulate boolean gate operations in real-time.

Input A
Input B
0 AND 0
Simulated output0

On this browser only

Give feedback

Did this tool help?

Tell us what worked, what didn’t, or what you’d like next.

Opens Google Forms in a new tab with this tool’s name filled in. No sign-in or email required. Feedback is optional.

How to use Logic Gate Simulator

  1. 1Choose AND, OR, NOT, XOR, NAND or NOR from the gate buttons.
  2. 2Toggle Input A between 0 and 1, then toggle Input B for a two-input gate.
  3. 3Read the displayed expression and Simulated Output for that combination.
  4. 4Try every input combination and compare the results with the truth table below; NOT uses only Input A.
  5. 5Use the linked truth-table or Karnaugh-map tools when you need to evaluate a larger Boolean expression.

About Logic Gate Simulator

Explore the behavior of a single logic gate

This logic gate simulator lets you choose AND, OR, NOT, XOR, NAND or NOR and toggle the inputs between low and high. It shows the current operation and its binary output. Use it to check a gate definition, learn the difference between inclusive OR and XOR, or verify one small step while solving a Boolean logic exercise.

The page evaluates one selected gate at a time. It does not provide a circuit canvas, connected wires, flip-flops, clocked state or an exportable schematic. That makes it a focused place to inspect a gate without setting up a larger digital circuit. For a full expression with several operators, use the truth table generator.

What AND, OR and NOT mean

For Boolean inputs, AND is written Y = A ∧ B and is high only when both inputs are high. OR is Y = A ∨ B and is high when either input is high, including the case where both are high. NOT is Y = ¬A and reverses the value of its single input.

These are logical states rather than simulated voltages. A zero on this page means false or low, and a one means true or high. Real hardware defines valid voltage ranges and noise margins in its datasheet; the simulator does not infer an IC family, supply voltage or electrical threshold from the selected gate.

When you choose NOT, Input B disappears because the operation depends only on A. A previously selected B value has no effect on the output in this mode. Change A and check that the output always becomes its opposite before moving on to the two-input operations.

XOR, NAND and NOR formulas

XOR is Y = A ⊕ B. For the two-input gate here, it is high when the inputs differ and low when they match. This differs from OR only when both inputs are high: OR remains high, while XOR becomes low. Toggling that particular combination is a useful way to remember the distinction.

NAND is Y = ¬(A ∧ B), which means it inverts the AND result. NOR is Y = ¬(A ∨ B), which inverts the OR result. The negation applies to the complete expression inside the parentheses, not just one input. Read the gate name before predicting the output; otherwise it is easy to answer the underlying AND or OR question and forget the inversion.

Worked truth table for the supported gates

The rows below were evaluated with the simulator's own gate expressions. Select a gate, set A and B to match a row, then compare the displayed output with that column.

A B AND OR XOR NAND NOR
0 0 0 0 0 1 1
0 1 0 1 1 1 0
1 0 0 1 1 1 0
1 1 1 1 0 0 0

For NOT, A = 0 gives Y = 1, and A = 1 gives Y = 0. No second input is needed. For a worked comparison, set A = 1 and B = 1, then switch between AND, XOR and NAND. Their results are respectively 1, 0 and 0, showing how changing the operation changes the answer without changing either input.

The logic gates guide develops these truth tables and their interpretation. The table on this page is a reference for checking combinations; the interactive panel displays the selected combination rather than automatically listing every row.

Building intuition without confusing operations

Think of AND as requiring simultaneous conditions and OR as accepting alternatives. XOR answers a different question: do the inputs disagree? For a larger set of bits, repeated XOR can describe parity, but this page has only the two-input XOR operation and does not generate a parity bit for an entire message.

NAND and NOR are each functionally complete: suitably connected gates of either type can express other Boolean functions. You can illustrate inversion by considering a NAND with identical inputs, or a NOR with identical inputs. This simulator lets you check those input cases individually; it does not wire multiple gates together to construct the complete replacement circuit.

For operations across corresponding positions in binary words, use the binary calculator. A bitwise AND applies the same gate rule independently to each aligned bit position, while arithmetic addition also needs carries. The single-gate view is a useful foundation, but it is not itself a binary adder.

Common mistakes and where to go next

Do not interpret the word OR as excluding the both-high case; that exclusion belongs to XOR. Do not treat NAND as AND with a permanently inverted input; its output is the complement of the complete AND operation. Finally, check the truth table of a proposed expression rather than assuming a similar-looking symbol means the same function.

The model has no propagation delay, transient glitches, unknown state or floating input. Its inputs are explicitly chosen Boolean values, and changing one does not model the analog transition between voltage levels. Hardware timing and electrical compatibility require device data and an appropriate circuit analysis.

When the next task is simplifying a Boolean function instead of checking one gate, use the Karnaugh map solver. First establish which input combinations should produce a high output, then simplify that function. Correct truth-table rows are the starting point for a useful simplified expression.

Guides and tutorials

Frequently asked questions

How do I use a logic gate simulator?

Choose a gate, toggle its inputs and read the output. Compare each input combination with the truth table to check that you understand the selected operation.

Which logic gates are available?

The simulator includes AND, OR, NOT, XOR, NAND and NOR. NOT uses one input; the other available gates use two.

What is the difference between OR and XOR?

OR is high when either or both inputs are high. The two-input XOR is high only when the inputs differ, so both-high produces a low output.

Why does NOT have no Input B?

NOT inverts only Input A, so a second input is not part of the operation. The panel hides B in this mode and ignores its stored value.

How are NAND and NOR different?

NAND complements the AND result and is low only when both inputs are high. NOR complements the OR result and is high only when both inputs are low.

Can I draw a complete logic circuit here?

This page evaluates one selected gate and input combination at a time. It has no wiring canvas, connected gate network or schematic export.

Can the simulator generate a full truth table?

The interactive panel displays the current combination, while the page guidance includes a reference table. Use the linked truth table generator to evaluate every combination of a larger Boolean expression.

Does a displayed 1 mean a specific voltage?

No, it represents a Boolean high state. The actual voltage ranges depend on the device family and supply conditions, which this simulator does not model.

Why are NAND and NOR called universal gates?

Either gate type can be combined to express other Boolean functions. This is a statement about constructing networks, while this page checks individual gate behavior.

Does this include propagation delay or flip-flops?

No, it evaluates ideal combinational gate rules without timing or stored state. Use a different circuit model for clocks, latches, glitches or electrical behavior.

Have a suggestion for Logic Gate Simulator?Share your feedback ↗