Simplify Your Workflow: Search MiniWebtool.
Add Extension
Home Page > Miscellaneous > Electronics Tools > Logic Gate Simulator

Logic Gate Simulator

Build and simulate digital logic circuits online with AND, OR, NOT, NAND, NOR, XOR and XNOR gates. Get instant truth tables, animated circuit diagrams, canonical Boolean forms and step-by-step evaluation.

Logic Gate Simulator
Syntax: Variables AZ, constants 0/1, operators AND & *, OR | +, NOT ! ~, XOR ^, plus NAND, NOR, XNOR. Parentheses ( ) group sub-expressions. Maximum 5 variables.

Embed Logic Gate Simulator Widget

About Logic Gate Simulator

The Logic Gate Simulator is a free online sandbox for digital-logic circuits. Type any Boolean expression using AND, OR, NOT, NAND, NOR, XOR and XNOR gates and the simulator immediately parses it into a gate-level circuit, draws the diagram on canvas, fills in the full truth table for up to 5 inputs, and lets you flip each input with a tap to watch the signal propagate in real time. It is designed for students learning digital electronics, engineers prototyping combinational circuits, and anyone who wants to test a Boolean expression before committing it to breadboard, schematic or HDL code.

What is a logic gate?

A logic gate is the fundamental building block of a digital circuit: an electronic element that takes one or more binary inputs (each either 0 or 1, often called LOW and HIGH) and produces a single binary output determined by a fixed Boolean function. Logic gates are implemented in silicon as transistor networks — typically CMOS — and are the physical realisation of Boolean algebra. Every computer, smartphone, and digital controller is ultimately a billion-scale composition of these seven basic gates.

Why simulate first? Before soldering 74-series chips or synthesising a VHDL/Verilog module, a quick simulation verifies that your Boolean expression produces the intended truth table. Catching a mistake here takes seconds; catching it in silicon can cost hours of re-work.

The seven basic gates at a glance

↔ Swipe sideways on mobile to compare every output state.

Gate Symbol Equation A=0B=0 A=0B=1 A=1B=0 A=1B=1
ANDA · BY = A · B0001
ORA + BY = A + B0111
NOT¬AY = ¬AA=0 → Y=1A=1 → Y=0
NAND¬(A · B)Y = ¬(A · B)1110
NOR¬(A + B)Y = ¬(A + B)1000
XORA ⊕ BY = A ⊕ B0110
XNOR¬(A ⊕ B)Y = ¬(A ⊕ B)1001

AND gate

The output is 1 only when all inputs are 1 — think of it as a series connection of switches. Used to enforce multiple conditions, mask bits, and implement logical conjunction. Industry part: 7408 (quad 2-input AND).

OR gate

The output is 1 when at least one input is 1 — think of it as a parallel connection of switches. Used for alarm circuits, bit setting, and logical disjunction. Industry part: 7432.

NOT gate (inverter)

A single-input gate that simply flips 0 to 1 and 1 to 0. Used to negate signals, generate complement lines, and as the active element of CMOS. Industry part: 7404.

NAND gate

The negation of AND — outputs 0 only when all inputs are 1. NAND is a universal gate: any Boolean function can be built using NAND gates alone, which is why NAND dominates mass-produced CMOS. Industry part: 7400.

NOR gate

The negation of OR — outputs 1 only when every input is 0. Also a universal gate. Famously the core gate of the Apollo Guidance Computer, built entirely from 3-input NOR gates. Industry part: 7402.

XOR gate

Exclusive OR outputs 1 when an odd number of inputs are 1. Critical in binary adders (the sum bit), parity generators, comparators, and the AES round function. Industry part: 7486.

XNOR gate

The negation of XOR — outputs 1 when the inputs are equal. Often called an equivalence gate and used as a one-bit comparator. Industry part: 74266.

How to use this simulator

  1. Type or build your expression in the input box at the top. You can type directly or tap the keypad buttons for variables and operators. Both word syntax (AND, OR, NOT) and symbolic syntax (&, |, !, ^) are accepted.
  2. Click Simulate. The simulator parses your expression, verifies the syntax, extracts the variables, and computes the output for every combination (up to 32 rows for 5 inputs).
  3. Flip the input toggles above the circuit diagram. Each toggle is a clickable button cycling between 0 and 1; the circuit updates in real time, highlighting active wires in red and lighting the green output LED when Y = 1.
  4. Read the truth table. Every possible input combination is listed alongside its output; the row matching the current toggle state is highlighted.
  5. Check the canonical forms. The simulator writes out the Sum-of-Products and Product-of-Sums equivalents — the starting point for Karnaugh-map minimization or Quine–McCluskey reduction.
  6. Walk through the evaluation. The step-by-step panel shows how the expression reduces gate by gate for one sample input, which is especially useful for debugging nested expressions.

Accepted expression syntax

Why these presets are worth exploring

Majority function (3-input)

(A AND B) OR (A AND C) OR (B AND C) — the output is 1 whenever at least two of the three inputs are 1. This is the heart of triple-modular-redundant (TMR) voting circuits used in aerospace and fault-tolerant computing.

2-to-1 multiplexer

(A AND NOT S) OR (B AND S) — when the select line S is 0 the output forwards A; when S is 1 it forwards B. Multiplexers are the routing fabric of data-paths and the FPGA look-up table is literally a cascade of multiplexers.

3-bit parity

A XOR B XOR C — outputs 1 when an odd number of inputs are 1. Parity checkers are used in RAM error detection, UART communication and RAID storage.

Half-adder

The sum bit of a 1-bit adder is A XOR B; the carry bit is A AND B. Chaining these produces the ripple-carry adder at the arithmetic heart of every CPU.

Boolean algebra essentials

Core identities

Sum-of-Products (SOP)

Take every row where the output is 1, write each as a product of variables (uncomplemented for 1, complemented for 0), and OR them together. Every Boolean function has a unique SOP — the simulator prints yours automatically.

Product-of-Sums (POS)

The dual of SOP: take each row where the output is 0, write it as a sum with complemented 1-inputs and plain 0-inputs, then AND all the factors. Useful when the function has more 1s than 0s.

Real-world applications of logic gates

Tips for reading the circuit diagram

Frequently asked questions

What operators can I use in the Boolean expression?

The simulator accepts both word operators (AND, OR, NOT, NAND, NOR, XOR, XNOR) and symbolic operators. Use & or * for AND, | or + for OR, ! or ~ for NOT, and ^ for XOR. Variables are single letters A through Z (case-insensitive), and 0 and 1 are accepted as constants. Parentheses may be nested freely to control evaluation order.

What is the difference between NAND and NOR gates?

NAND (NOT AND) outputs 1 whenever the AND of its inputs is 0 — that is, in every case except when all inputs are 1. NOR (NOT OR) outputs 1 only when every input is 0. Both are called universal gates because any Boolean function can be built using only NAND gates, or only NOR gates, which is why they are the building blocks of CMOS integrated circuits.

Why does XOR produce 1 for odd numbers of 1-inputs?

XOR (exclusive OR) outputs 1 when its two inputs differ. Chained XORs act as a parity checker: the output is 1 when the total number of 1 inputs is odd, and 0 when it is even. This is why XOR gates are used in parity generators, error detection circuits and in the sum output of binary adders.

How many variables can the simulator handle?

The simulator supports up to 5 distinct variables, giving a maximum of 32 truth-table rows. This limit keeps the full truth table readable and the circuit diagram legible. If you paste an expression with more than 5 variables, the tool will ask you to reduce it.

What is the Sum-of-Products form?

Sum-of-Products (SOP) is a canonical Boolean form where the expression is written as an OR of AND terms. Each AND term corresponds to a truth-table row whose output is 1. SOP is the direct way to translate a truth table back into a Boolean expression and is the starting point for Karnaugh-map and Quine–McCluskey minimization.

Can I use the tool to design real hardware?

Yes — the simulator is useful for learning digital logic, homework problems, breadboard prototyping with 74-series ICs, and early design exploration for FPGA or ASIC projects. The circuit diagram shows gate counts and structure, which helps you estimate chip count or look-up-table utilization before committing to a schematic editor.

Further Reading

Reference this content, page, or tool as:

"Logic Gate Simulator" at https://MiniWebtool.com/logic-gate-simulator/ from MiniWebtool, https://MiniWebtool.com/

by miniwebtool team. Updated: Apr 20, 2026

Related MiniWebtools:

Electronics Tools:

Top & Updated:

Random PickerRandom Name PickerLine CounterBatting Average CalculatorRelative Standard Deviation CalculatorFPS ConverterSort NumbersInstagram User ID LookupERA CalculatorMAC Address GeneratorRemove SpacesWord to Phone Number ConverterJob FinderMAC Address LookupFacebook User ID LookupSum CalculatorFeet and Inches to Cm ConverterOPS CalculatorRandom Truth or Dare GeneratorPercent Off CalculatorSHA256 Hash GeneratorRandom Quote GeneratorLog Base 10 CalculatorSquare Root (√) CalculatorDoubling Time CalculatorBitwise CalculatorNumber of Digits CalculatorVertical Jump CalculatorMP3 LooperAudio SplitterSlugging Percentage CalculatorRoman Numerals ConverterSlope and Grade CalculatorSalary Conversion CalculatorOn Base Percentage CalculatorPhone Number ExtractorRandom Poker Hand GeneratorRandom IMEI GeneratorSaturn Return CalculatorNumber to Word ConverterAI Text HumanizerSun, Moon & Rising Sign Calculator 🌞🌙✨Merge VideosCaffeine Overdose CalculatorImage ResizerCompound Growth CalculatorRandom Birthday GeneratorFirst n Digits of PiBinary to Gray Code ConverterDecimal to BCD ConverterGrade CalculatorCm to Feet and Inches ConverterCompare Two StringsWHIP CalculatorBCD to Decimal ConverterRandom Fake Address GeneratorRandom Movie PickerOctal CalculatorRandom Activity GeneratorAdd Prefix and Suffix to TextVideo to Image ExtractorRandom Writing Prompt GeneratorOne Rep Max (1RM) CalculatorRandom Superpower GeneratorFile Size ConverterBingo Card GeneratorText FormatterRandom Object GeneratorInvisible Text GeneratorRemove AccentYouTube Channel StatisticsWAR CalculatorPercent Growth Rate CalculatorLove Compatibility CalculatorRandom Integer GeneratorOutlier CalculatorCM to Inches ConverterClothing Size ConverterStair CalculatorQuotient and Remainder CalculatorTime Duration CalculatorWord Ladder GeneratorGray Code to Binary ConverterImage SplitterRandom Number PickerDay of Year CalendarList of Prime NumbersCryptogram GeneratorExponential Decay CalculatorLeap Years ListRandom Credit Card GeneratorRemove Leading Trailing SpacesRandom Loadout GeneratorArc Length CalculatorUnit Rate CalculatorDay of the Year Calculator - What Day of the Year Is It Today?Modulo CalculatorConnect the Dots GeneratorAI Punctuation AdderEmail ExtractorURL ExtractorAI ParaphraserSHA512 Hash GeneratorVideo CompressorBinary to BCD ConverterIP Address to Hex ConverterSort Lines AlphabeticallyHex to BCD ConverterBCD to Binary ConverterLottery Number GeneratorBCD to Hex ConverterMedian CalculatorStandard Error CalculatorList RandomizerBreak Line by CharactersAverage CalculatorPVIFA CalculatorReverse VideoHypotenuse CalculatorRemove Audio from VideoActual Cash Value CalculatorScientific Notation to Decimal ConverterNumber ExtractorAngel Number CalculatorLog Base 2 CalculatorRoot Mean Square CalculatorSum of Positive Integers CalculatorSHA3-256 Hash GeneratorAI Sentence Expander📅 Date CalculatorLbs to Kg ConverterHex to Decimal ConverterRandom Group GeneratorConvolution CalculatorMAC Address AnalyzerRandom String GeneratorAmortization CalculatorMarkup CalculatorPVIF CalculatorName Number CalculatorDecimal to Hex ConverterInstagram Font GeneratorSocial Media Image Size GuideTikTok Money CalculatorTwitter/X Character CounterTwitter/X Timestamp ConverterYouTube Watch Time CalculatorTwitch Earnings CalculatorYouTube Shorts Monetization CalculatorFacebook Ad Cost CalculatorSocial Media ROI CalculatorSocial Media Post Time OptimizerSocial Media Username CheckerCTR CalculatorROAS CalculatorInfluencer ROI CalculatorForce CalculatorAcceleration CalculatorVelocity CalculatorMomentum CalculatorProjectile Motion CalculatorKinetic Energy CalculatorPotential Energy CalculatorWork and Power CalculatorDensity CalculatorPressure CalculatorIdeal Gas Law CalculatorFree Fall CalculatorTorque CalculatorHorsepower CalculatorDilution CalculatorChemical Equation BalancerStoichiometry CalculatorPercent Yield CalculatorEmpirical Formula CalculatorBoiling Point CalculatorTitration CalculatorMole/Gram/Particle ConverterIrregular Polygon Area CalculatorFrustum CalculatorTorus Calculator3D Distance CalculatorGreat Circle Distance CalculatorCircumscribed Circle (Circumcircle) CalculatorInscribed Circle (Incircle) CalculatorAngle Bisector CalculatorTangent Line to Circle CalculatorHeron's Formula CalculatorCoordinate Geometry Distance CalculatorVolume of Revolution CalculatorSurface of Revolution CalculatorParametric Curve GrapherRiemann Sum CalculatorTrapezoidal Rule CalculatorSimpson's Rule CalculatorImproper Integral CalculatorL'Hôpital's Rule CalculatorMaclaurin Series CalculatorPower Series CalculatorSeries Convergence Test CalculatorInfinite Series Sum CalculatorAverage Rate of Change CalculatorInstantaneous Rate of Change CalculatorRelated Rates SolverOptimization Calculator (Calculus)Gradient Calculator (Multivariable)Divergence CalculatorCurl CalculatorLine Integral CalculatorSurface Integral CalculatorJacobian Matrix CalculatorNewton's Method CalculatorRREF Calculator (Row Echelon Form)Matrix Inverse CalculatorMatrix Multiplication CalculatorDot Product CalculatorCross Product CalculatorVector Magnitude CalculatorUnit Vector CalculatorAngle Between Vectors CalculatorNull Space CalculatorColumn Space CalculatorCramer's Rule CalculatorMatrix Diagonalization CalculatorQR Decomposition CalculatorCholesky Decomposition CalculatorMatrix Power CalculatorCharacteristic Polynomial CalculatorBayes' Theorem CalculatorF-Test / F-Distribution CalculatorHypergeometric Distribution CalculatorNegative Binomial Distribution CalculatorGeometric Distribution CalculatorExponential Distribution CalculatorWeibull Distribution CalculatorBeta Distribution CalculatorSpearman Rank Correlation CalculatorFisher's Exact Test CalculatorContingency Table CalculatorOdds Ratio CalculatorRelative Risk CalculatorEffect Size CalculatorPermutations with Repetition CalculatorModular Exponentiation CalculatorPrimitive Root CalculatorPerfect Number CheckerAmicable Number CheckerTwin Prime FinderMersenne Prime CheckerGoldbach Conjecture VerifierMöbius Function CalculatorEgyptian Fraction CalculatorFibonacci Number CheckerDigital Root CalculatorPartition Function CalculatorBoolean Algebra SimplifierKarnaugh Map (K-Map) SolverLogic Gate SimulatorGraph Coloring CalculatorTopological Sort CalculatorAdjacency Matrix CalculatorRecurrence Relation SolverInclusion-Exclusion CalculatorLinear Programming SolverTraveling Salesman Solver (TSP)Hamiltonian Path CheckerPlanar Graph CheckerNetwork Flow Calculator (Max Flow)Stable Marriage Problem SolverFirst-Order ODE SolverSecond-Order ODE SolverDirection Field / Slope Field PlotterEuler's Method CalculatorBernoulli ODE SolverSystem of ODEs SolverGroup Theory Order CalculatorRing and Field CalculatorJordan Normal Form CalculatorMatrix Exponential CalculatorTensor Product CalculatorFast Fourier Transform (FFT) CalculatorZ-Transform CalculatorNumerical Integration CalculatorTOML to JSON ConverterJSON to CSV ConverterXML to JSON ConverterSQL to MongoDB Query ConverterCSS Flexbox PlaygroundCSS Grid GeneratorJWT GeneratorBcrypt Hash Generator / CheckerColor Code Converter (All Formats)Git Command Generator.env File GeneratorLorem Picsum / Placeholder Image GeneratorText to Binary/Hex/ASCII ConverterSyllable CounterSentence CounterParagraph CounterSpeaking Time CalculatorReading Time CalculatorWhitespace VisualizerStrikethrough Text GeneratorTorque Converter (Nm, ft-lb, kgf-cm)Data Transfer Rate ConverterFuel Efficiency ConverterAstronomical Unit ConverterRing Size ConverterPaper Size ReferenceGas Mileage CalculatorEV Range CalculatorEV Charging Time Calculator0–60 / Quarter Mile CalculatorCar Lease CalculatorVehicle Towing Capacity CalculatorExposure Triangle CalculatorCrop Factor CalculatorMegapixel to Print Size CalculatorPhoto File Size EstimatorMusic BPM TapperMusic Key TransposerVideo Bitrate CalculatorSeed Germination Rate CalculatorFertilizer Calculator (NPK)Raised Bed Soil CalculatorFrost Date CalculatorLawn Fertilizer CalculatorCompost Calculator (C:N Ratio)Solar Panel CalculatorSolar ROI CalculatorHome Energy Audit CalculatorAppliance Energy Cost CalculatorWater Usage CalculatorElectricity Generation Cost CalculatorHeat Loss CalculatorFlight Distance CalculatorTravel Budget CalculatorJet Lag CalculatorPacking List GeneratorTip Splitter (Advanced)Lease vs Buy CalculatorHourly Rate Calculator (Freelancer)Invoice Late Fee CalculatorESPP CalculatorStock Split CalculatorOptions Probability CalculatorDollar to Gold ConverterBeam Load CalculatorPipe Flow CalculatorBolt Torque CalculatorSteel Weight CalculatorGravel, Sand & Topsoil CalculatorRandom Sentence GeneratorRandom Paragraph GeneratorRandom Math Problem GeneratorRandom Bible Verse GeneratorRandom Cat/Dog Name GeneratorRandom Debate Topic GeneratorBody Recomposition CalculatorAlcohol Calorie CalculatorMedication Dosage CalculatorPace to Calories CalculatorHydration CalculatorTrain Meeting Problem SolverAge Word Problem SolverMixture Problem SolverWork Rate Problem SolverDistance-Speed-Time Triangle CalculatorCoin Word Problem SolverNumber Bonds GeneratorCarry and Borrow VisualizerTimes Tables QuizMental Math TrainerRoman Numeral Math SolverEgyptian Multiplication CalculatorVedic Math Tricks CalculatorRussian Peasant MultiplicationSoroban Abacus Simulator