Skip to main content
L
Loopaloo
Buy Us a Coffee
All ToolsImage ProcessingAudio ProcessingVideo ProcessingDocument & TextPDF ToolsCSV & Data AnalysisConverters & EncodersWeb ToolsMath & ScienceGames
Guides & BlogAboutContact
Buy Us a Coffee
L
Loopaloo

Free online tools for developers, designers, and content creators. Your files are processed in your browser and are never uploaded - no accounts required. A few network utilities (like What's My IP and Currency Converter) call public APIs to do their job and say so on their pages.

support@loopaloo.com

Tool Categories

  • Image Tools
  • Audio Tools
  • Video Tools
  • Document & Text
  • PDF Tools
  • CSV & Data
  • Converters
  • Web Tools
  • Math & Science
  • Games

Company

  • About Us
  • Contact
  • Blog
  • FAQ

Legal

  • Privacy Policy
  • Terms of Service
  • Disclaimer

Support

Buy Us a Coffee

© 2026 Loopaloo. All rights reserved. Built with privacy in mind.

Privacy|Terms|Disclaimer
  1. Home
  2. Math & Science
  3. Truth Table Generator
Add to favorites

Truth Table Generator

Build the truth table for any logical expression, with working columns, normal forms, a tautology check and an equivalence test, and see exactly how it was grouped.

Calculated locally in your browserMore math & scienceJump to full guide

Initializing in your browser…

You might also like

Chord Diagram Generator

Find any chord on guitar, ukulele, bass, banjo, mandolin, Irish bouzouki or a tuning of your own, hear it, and export clean diagrams. Every playable voicing ranked easiest first, slash chords, a neck map and a chord sheet builder.

Image Color Palette Extractor

Extract the main colours of a photo as a palette with hex, RGB and HSL codes and their share of the picture, and export it as CSS, SCSS, Tailwind, JSON, CSV or GIMP.

Online Audio Recorder

Record from your microphone in the browser with a real level meter, then trim and download as WAV, MP3, OGG or WebM. Nothing is uploaded.

A worked calculation

You want to see the truth table for "if A then B" and check that it means the same as "not A, or B".

Expression

A -> B
Compare with: NOT A OR B
What Truth Table Generator produces

Result

A  B  A → B
T  T  T
T  F  F
F  T  T
F  F  T
Contingency, true in 3 of 4 rows
Equivalent. A → B and ¬A ∨ B agree on every row.

An implication is false in only one case: when A is true and B is false. That is the second row and the only F in the result column, so the expression is true in three of the four rows, which makes it a contingency rather than a tautology. NOT A OR B is false only when NOT A is false and B is false, which is the same row, so the two expressions agree everywhere and the compare box reports them as equivalent. Compare A -> B with B -> A instead and the page names the row where they part: A true and B false, where A → B is false and B → A is true.

Truth tables that show how they were read

Type a logical expression with words such as AND, OR and IMPLIES or symbols such as ∧ and →, and get its full truth table with a column for every step. The page prints the grouping it used, says whether the expression is a tautology, a contradiction or a contingency, and can test whether two expressions are equivalent.

How it works

Type it the way you write it. The generator accepts the words AND, OR, NOT, XOR, NAND, NOR, IMPLIES and IFF in upper or lower case, the symbols ¬ ∧ ∨ ⊕ → ↔, and programming forms such as &&, ||, !, -> and <->. A variable can be any name made of letters, digits and underscores, so p, q, rain and x1 all work, and T, F, 1 and 0 stand for true and false. On a phone, the row of operator buttons under the box types the symbols for you. The table updates as you type, and anything that cannot be read is explained in plain words, such as a bracket that is never closed or an operator with nothing after it.

The grouping is printed. A truth table is only unambiguous once the grouping is agreed, so the Read as line shows the expression with brackets wherever the grouping matters. NOT binds tightest, then AND, then OR and XOR, then implication, then the biconditional, the order used in standard logic textbooks. Implication groups from the right, so A → B → C means A → (B → C); that reading is true in seven of the eight rows, while (A → B) → C is true in only five. NAND and NOR are not associative, so a chain such as A NAND B NAND C is refused with both possible bracketings offered rather than quietly settled one way. The full list of operators, their spellings and their precedence is one click away.

Everything that comes off the table. With working columns on, every distinct sub-expression gets its own column, which is how truth tables are built by hand and makes each step easy to check. The result is classified as a tautology, a contradiction or a contingency, with the number of true rows. For up to eight variables the page also writes out the disjunctive normal form, one term per true row, and the conjunctive normal form, one clause per false row, ready to copy. The table can be shown with T and F or with 1 and 0, copied as tab separated text for a spreadsheet, or downloaded as a CSV file.

Test whether two expressions are equivalent. Type a second expression in the compare box and every combination of values for the variables in either one is checked. If they always agree, they are equivalent. If not, you get the exact assignment where they differ and which of the two is true there, which is the quickest way to find the mistake in a simplification. Tables are drawn for up to 12 variables, which is 4,096 rows.

Examples

  • A -> B -> C

    Read as A → (B → C), true in 7 of 8 rows. The other grouping, (A → B) → C, is true in 5, so the brackets matter.

  • De Morgan's law

    NOT (A AND B) IFF (NOT A OR NOT B) is true in all 4 rows, so it is a tautology.

  • A NAND B NAND C

    Refused, with (A NAND B) NAND C and A NAND (B NAND C) offered instead, because the two give different tables.

  • Implication as a disjunction

    A -> B and NOT A OR B are equivalent. A -> B and B -> A are not: they differ when A is true and B is false.

How to use

  1. 1Type an expression in the box, using words such as AND, OR and IMPLIES, symbols such as ∧ and →, or the operator buttons.
  2. 2Check the Read as line to see how the expression was grouped.
  3. 3Read the truth table, with a working column for each step, and the verdict above it.
  4. 4Switch between T / F and 1 / 0, or turn the working columns off for a compact table.
  5. 5Type a second expression under Compare with another expression to test whether the two are equivalent.
  6. 6Copy the table, download it as CSV, or press Share to send a link to the same expression.

Key features

  • Words, symbols and programming operators accepted, in upper or lower case
  • The grouping printed with brackets, so you can see exactly what the table computes
  • Implication grouped from the right, as in standard logic textbooks
  • Ambiguous NAND and NOR chains refused, with both bracketings offered
  • A working column for every sub-expression
  • Tautology, contradiction or contingency, with the count of true rows
  • Disjunctive and conjunctive normal forms for up to 8 variables
  • An equivalence test that shows a counterexample when two expressions differ
  • T / F or 1 / 0 display, copy as text and CSV download
  • Up to 12 variables, which is 4,096 rows

Tips & best practices

  • If a result surprises you, read the Read as line first: most surprises come from the grouping, not from the rows.
  • In a mix of OR and XOR, add your own brackets. Without them the expression is read from left to right.
  • Use ^ only for XOR. Many textbooks write ^ for AND, so type AND or ∧ when that is what you mean.
  • To check that an argument is valid, build the table for (premises) -> conclusion: the argument is valid exactly when that is a tautology.

When this is useful

  • Logic and discrete maths homework

    Build the table for a formula or an argument and check each column against your own working.

  • Checking a simplification

    Compare the original and the simplified expression; if they differ, the page shows the row that proves it.

  • Digital circuits

    Write a gate expression with AND, OR, NAND and NOR and read its output for every input, in 1 and 0 if you prefer.

  • Programming conditions

    Test a complicated condition written with &&, || and ! before trusting it in code.

Frequently asked questions

How do I write the operators?

Use the words AND, OR, NOT, XOR, NAND, NOR, IMPLIES and IFF in any case, the symbols ¬ ∧ ∨ ⊕ → ↔, or forms such as &&, ||, !, ~, ->, => and <->. The operator list on the page shows every accepted spelling.

In what order are the operators applied?

NOT first, then AND and NAND, then OR, XOR and NOR, then implication, then the biconditional. So NOT A AND B means (NOT A) AND B, and A AND B OR C means (A AND B) OR C. Brackets always override this order.

Why is A → B → C read as A → (B → C)?

Because implication is conventionally right associative, as in most logic textbooks. The two groupings are different functions: A → (B → C) is true in seven of the eight rows and (A → B) → C in five. The page prints the brackets so there is no doubt which one the table shows.

Why is A NAND B NAND C refused?

NAND is not associative: (A NAND B) NAND C and A NAND (B NAND C) give different tables, and there is no agreed convention for which is meant. Add brackets to choose one. The same applies to NOR.

What is the difference between a tautology, a contradiction and a contingency?

A tautology is true in every row, a contradiction is false in every row, and a contingency is true in some rows and false in others. The verdict and the number of true rows appear above the table.

What are the disjunctive and conjunctive normal forms?

The disjunctive normal form joins one AND term for each true row with OR; the conjunctive normal form joins one OR clause for each false row with AND. Both describe the same function as your expression. They are listed for up to eight variables.

How do I check whether two expressions are equivalent?

Type the second one under Compare with another expression. Every combination of true and false for the variables in either expression is tried. If any row differs, the page shows that row and which expression is true there.

How many variables can I use?

Up to 12 in one table, which is 4,096 rows. A name can be letters, digits and underscores, such as p, q or switch_1, and a name such as nota is read as one variable rather than NOT a.

Related tools and how they differ

  • Number Base Converter: Use it to turn the 1 and 0 rows of a table into binary, decimal or hexadecimal numbers.
  • CSV Viewer & Editor: Use it to open the CSV download of a large truth table and sort or filter its rows.
  • GCD & LCM Calculator: Use it for another part of discrete maths: common divisors and multiples with the working shown.

Private by design

Every calculation runs locally in your browser. Your numbers and expressions are not transmitted or stored.