Truth Table

AND, OR, NOT, XOR logic

About This Calculator

Truth tables enumerate all possible input combinations and their corresponding outputs for logical operations. They are essential tools in digital electronics, computer science, formal logic, and circuit design.

Formula

AND: true only when both inputs are true
OR: true when at least one input is true
XOR: true when exactly one input is true; NOT: inverts the input
NAND = NOT AND; NOR = NOT OR

Example Calculation

A = true, B = false

  1. AND = true AND false = false
  2. OR = true OR false = true
  3. XOR = true XOR false = true
AND=false, OR=true, XOR=true, NAND=true, NOR=false

Full Truth Table for Two Inputs

ABANDORXORNANDNOR
TTTTFFF
TFFTTTF
FTFTTTF
FFFFFTT

Frequently Asked Questions

What is the difference between OR and XOR?
OR (inclusive or) is true when one or both inputs are true. XOR (exclusive or) is true only when exactly one input is true — it is false when both are true.
How are logic gates used in computers?
All computer operations are built from combinations of logic gates (AND, OR, NOT, XOR, etc.). Adders, memory cells, multiplexers, and CPUs are all constructed from millions of these basic gates.
What is De Morgan's law?
De Morgan's laws state: NOT(A AND B) = (NOT A) OR (NOT B), and NOT(A OR B) = (NOT A) AND (NOT B). These are used to simplify logic circuits and boolean expressions.