KKC Tools
All tools →

Boolean Algebra Calculator: Truth Tables, Simplification and Binary Maths

Free boolean algebra calculator. Type any boolean expression to compute its full truth table, discover its minimal Sum of Products (SOP) via Quine-McCluskey reduction, verify symbolic equivalence, and calculate multi-base binary math with two's complement.

LOGIC & BITWISE PIPELINEExpression Simplification & Truth Table Flow
1Inputs / Variables
AB
→
2Logic Gates (AST)
(A AND B) OR (A AND NOT B)
→
3Outputs
Minimal SOPTruth Table (2ⁿ)
Syntax Legend:
AND: &, *, ANDOR: |, +, ORNOT: !, ~, NOTXOR: ^, ⊕, XORPrecedence: NOT > AND > XOR > OR
Minimal Sum of Products (Quine-McCluskey)
A

(A AND B) OR (A AND NOT B) simplifies to A. Independent inputs have been minimized.

Minterms (SOP)Σm(2, 3)
Maxterms (POS)ΠM(0, 1)
Truth Table (4 Rows • 22 Combinations)
#ABOutput (F)
0000 (F)
1010 (F)
2101 (T)
3111 (T)
  • Truth tables & K-maps
  • Minimal SOP & POS
  • Equivalence check
  • Binary, hex & two's complement

100% free · No sign-up · Runs in your browser, nothing is uploaded

How to Use the Boolean Algebra Calculator

This digital logic calculator operates across three specialized tabs designed for students, electrical engineers, and computer scientists:

  • Tab 1: Expression Simplification & Truth Tables: Enter a boolean formula such as (A AND B) OR (A AND NOT B). The engine parses the syntax tree, computes all 2n truth table states, and extracts the minimal Sum of Products (SOP) along with canonical minterm/maxterm notations.
  • Tab 2: Equivalence Check: Enter two distinct expressions (such as NOT(A AND B) vs NOT A OR NOT B) to rigorously test whether they evaluate identically across all permutations. If they differ, the engine reports the exact counterexample variable assignment.
  • Tab 3: Binary & Bitwise Arithmetic: Enter two binary numbers to perform addition, subtraction, multiplication, integer division, and bitwise logic with configurable 8-bit, 16-bit, 32-bit, or 64-bit registers and two's complement representation.

Boolean Operators and Truth Tables

Digital circuits and computer systems process information using binary states: 1 (True, high voltage) and 0 (False, ground). The fundamental logical connectives operate as follows:

  • AND (Conjunction • &, *, ·): True only when both inputs are True.
  • OR (Disjunction • |, +): True when at least one input is True.
  • NOT (Negation • !, ~, ¬): Unary inverter changing 0 to 1 and 1 to 0.
  • XOR (Exclusive OR • ^, ⊕): True when inputs differ (odd parity detector).

How to Simplify a Boolean Expression

Minimizing boolean logic reduces the physical gate count, silicon area, and power dissipation required in hardware implementations. Simplification relies on established axioms:

  • Distributive Law: A · (B + C) = (A · B) + (A · C)
  • Complement Law: B + NOT B = 1 and B · NOT B = 0
  • Absorption Law: A + (A · B) = A and A · (A + B) = A
  • Identity Law: A · 1 = A and A + 0 = A

In our worked example, (A AND B) OR (A AND NOT B) factors out A to yield A AND (B OR NOT B). Because B OR NOT B is universally 1, the formula simplifies to A AND 1 = A.

SOP vs POS and Canonical Forms

Every boolean function can be uniquely described in canonical algebraic notation:

  • Sum of Products (SOP / DNF): Formed by gathering all minterms (rows where the output is 1), represented as Σm(m1, m2, …).
  • Product of Sums (POS / CNF): Formed by gathering all maxterms (rows where the output is 0), represented as ΠM(M1, M2, …).

NAND and NOR: Universal Gates

NAND and NOR gates are classified as universal gates because any combinational logic function (AND, OR, NOT, XOR) can be constructed solely using networks of NAND or NOR gates. In modern CMOS semiconductor fabrication, NAND gates are preferred due to their compact area and lower transistor parasitic capacitance.

Checking If Two Expressions Are Equivalent

When optimizing hardware or validating compiler transformations, verifying equivalence guarantees that replacement circuitry behaves identically under all operating conditions. For example, De Morgan's equivalence NOT(A AND B) ≡ NOT A OR NOT B is proven by evaluating all four truth states: in each row (00, 01, 10, 11), both expressions evaluate to 1, 1, 1, 0 respectively.

Binary Math: Add, Subtract and Convert

Binary arithmetic forms the foundation of Arithmetic Logic Units (ALUs). Adding 1011 (decimal 11) and 0110 (decimal 6) yields 10001 (decimal 17). The addition ripples carries from right to left:

  • Column 0: 1 + 0 = 1 (carry 0)
  • Column 1: 1 + 1 = 0 (carry 1)
  • Column 2: 0 + 1 + 1 (carry) = 0 (carry 1)
  • Column 3: 1 + 0 + 1 (carry) = 0 (carry 1)
  • Column 4: 0 + 0 + 1 (carry) = 1

Bitwise Operations and Two's Complement

Computers represent signed integers using two's complement encoding. In an 8-bit register, the most significant bit (bit 7) serves as the sign bit. Positive integers range from 0 to 127, while negative integers range from -1 to -128. For example, to encode -5 in an 8-bit register:

  1. Start with positive 5: 00000101
  2. Invert all bits (one's complement): 11111010
  3. Add 1: 11111011 (hexadecimal 0xFB)

How We Calculate (Digital Logic Methodology)

All logic parsing in this calculator is performed entirely client-side using a deterministic precedence-climbing Abstract Syntax Tree (AST) parser without any external network calls. Boolean minimization uses the Quine-McCluskey method to find the prime implicants, then searches every combination to pick the smallest cover (for up to 18 candidate terms; larger cases fall back to a greedy choice). Multi-base arithmetic and two's complement conversions utilize JavaScript native arbitrary-precision BigInt arithmetic.

Explore our related computational tools including the Ratio Calculator for proportional scaling and the upcoming Metric Conversion Calculator for scientific unit conversions.

Frequently Asked Questions

Frequently Asked Questions

How do you simplify a boolean expression?

Boolean expressions can be simplified using classical boolean theorems (such as De Morgan’s laws, distributive laws, and absorption rules) or algorithmic approaches like the Quine-McCluskey method and Karnaugh maps (K-maps). These identify redundant literal terms and group adjacent minterms to produce the minimal Sum of Products (SOP).

What are De Morgan’s laws?

De Morgan’s laws state that the negation of a conjunction is the disjunction of the negations: NOT (A AND B) ≡ (NOT A) OR (NOT B), and the negation of a disjunction is the conjunction of the negations: NOT (A OR B) ≡ (NOT A) AND (NOT B).

What are SOP (DNF) and POS (CNF) forms?

SOP (Sum of Products, or Disjunctive Normal Form) is an OR expression composed of AND terms (e.g. (A AND B) OR (C AND D)). POS (Product of Sums, or Conjunctive Normal Form) is an AND expression composed of OR clauses (e.g. (A OR B) AND (C OR D)).

How do I make a truth table?

A truth table tabulates all possible boolean values (0 and 1) for n variables, yielding 2ⁿ distinct input combinations. For each row, substitute the input values into the logic expression to determine whether the output evaluates to True (1) or False (0).

How do I prove two expressions are equivalent?

Two boolean expressions are logically equivalent if and only if they produce identical output values across all 2ⁿ rows of their combined truth table. If any input state produces differing outputs, that row serves as a counterexample disproving equivalence.

What is a Karnaugh map (K-map)?

A Karnaugh map is a visual two-dimensional grid of minterms organized according to Gray code ordering (where adjacent cells differ by exactly one binary digit). Grouping adjacent 1s in powers of two (1, 2, 4, 8, 16) allows immediate visual reduction of boolean expressions.

What is the order of operations in boolean algebra?

In formal digital logic and boolean algebra, the standard operator precedence from highest to lowest is: Parentheses (), Unary NOT (¬, !), Conjunction AND (&, ·), Exclusive OR XOR (⊕, ^), Disjunction OR (+, |), Implication (→), and Biconditional Equivalence (↔).

How do you add and subtract binary numbers?

Binary addition follows base-2 arithmetic rules: 0+0=0, 0+1=1, 1+0=1, and 1+1=10 (0 with a carry bit of 1 to the next column). For subtraction, the standard computing architecture converts the subtrahend into its two’s complement representation and adds it to the minuend.

What is two’s complement?

Two’s complement is the mathematical standard used by microprocessors to represent signed integers in binary. To form the two’s complement of a negative number in an N-bit system, invert all bits (one’s complement) and add 1. For example, in an 8-bit byte, −5 is represented as 11111011.

How do bitwise AND, OR and XOR work?

Bitwise operators execute boolean logic independently across corresponding bit positions of two binary words. Bitwise AND outputs 1 only when both bits are 1. Bitwise OR outputs 1 when at least one bit is 1. Bitwise XOR outputs 1 when the bits differ.

How This Calculator Works: Formula, Defaults & Sources

Formula

  • Canonical Minterm Expansion: F = Σm(m₀, m₁, …, mₖ) where each minterm produces a 1 in the truth table
  • Canonical Maxterm Expansion: F = ΠM(M₀, M₁, …, Mⱼ) where each maxterm produces a 0 in the truth table
  • Prime Implicant Reduction: Group minterms differing by 1 bit iteratively via Quine-McCluskey algorithm
  • Petrick / Greedy Cover: Select minimal set of essential and secondary prime implicants to cover all minterms
  • Two's Complement Signed Binary: Negative value −X in N-bit width = ((~X) + 1) & ((1 << N) − 1)

Default values (you can change them)

  • SOP simplification baseline: (A AND B) OR (A AND NOT B) reduces to A (B is irrelevant)
  • De Morgan equivalence baseline: NOT(A AND B) is logically equivalent to NOT A OR NOT B across all states
  • Absorption law baseline: A AND (A OR B) reduces to A
  • Binary addition baseline: 1011₂ (11) + 0110₂ (6) = 10001₂ (17)
  • Two's complement baseline: −5 in 8-bit two's complement binary = 11111011₂ (0xFB)

Sources

  • W. V. Quine (1952) — The Problem of Simplifying Truth Functions, The American Mathematical Monthly, Vol. 59, No. 8
  • E. J. McCluskey (1956) — Minimization of Boolean Functions, Bell System Technical Journal, Vol. 35, No. 6, pp. 1417–1444

Results are planning estimates, not engineering advice. Confirm quantities with your supplier and follow your plans and local building code. Last updated: November 24, 2026. Spotted a wrong number? Email us or use the contact page.

💡Suggest a Tool