Logic Gate Calculator

Output, truth table and IEC symbol for AND, OR, NOT, NAND, NOR, XOR, XNOR gates.

What it does

Shows the output, symbol and full truth table of AND, OR, NOT, NAND, NOR, XOR, XNOR and buffer gates for the inputs you choose.

Where it's used

Learning digital logic, checking a circuit by hand and preparing for exams.

How to use it

  1. Choose the gate.
  2. Choose 2, 3 or 4 inputs.
  3. Set each input to 0 or 1.
  4. Read the output; the matching truth-table row is highlighted.

The formula explained

AND
1 only if all inputs are 1
OR
1 if any input is 1
XOR
1 if an odd number of inputs are 1
NAND / NOR
inverted AND / OR — each can build any logic

Worked example

Inputs:

The calculator gives:

Tips and common mistakes

Questions people ask

What is the difference between OR and XOR?

OR gives 1 when at least one input is 1. XOR (exclusive OR) gives 1 only when the inputs differ, so 1 XOR 1 is 0. XOR is the heart of binary adders and parity checks.

How do I build other gates from NAND?

NOT: a NAND with its inputs tied together. AND: a NAND followed by a NOT. OR: invert both inputs, then NAND them (De Morgan’s law). That is why NAND is called universal.

Which chips contain these gates?

In the common 74HC family: 74HC00 (NAND), 74HC02 (NOR), 74HC04 (NOT), 74HC08 (AND), 74HC32 (OR) and 74HC86 (XOR), each with several gates per chip.

Related Digital Logic calculators

Enter your values to get the result with the formula, substituted values and an explanation of each step.

All engineering calculators