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 PickerInstagram User ID LookupFPS ConverterLine CounterBatting Average CalculatorSort NumbersMAC Address GeneratorRelative Standard Deviation CalculatorERA CalculatorRemove SpacesFeet and Inches to Cm ConverterFacebook User ID LookupWord to Phone Number ConverterMAC Address LookupRandom Truth or Dare GeneratorSun, Moon & Rising Sign Calculator 🌞🌙✨Job FinderSum CalculatorImage ResizerPercent Off CalculatorSHA256 Hash GeneratorSlope and Grade CalculatorVertical Jump CalculatorSquare Root (√) CalculatorMP3 LooperRandom Credit Card GeneratorNumber of Digits CalculatorBitwise CalculatorAudio SplitterOPS CalculatorRoman Numerals ConverterSaturn Return CalculatorAI Text HumanizerLog Base 10 CalculatorInvisible Text GeneratorRandom Quote GeneratorRandom Activity GeneratorCm to Feet and Inches ConverterSlugging Percentage CalculatorRandom IMEI GeneratorPhone Number ExtractorMerge VideosRandom Loadout GeneratorRandom Movie PickerSalary Conversion Calculator⬛ Aspect Ratio CalculatorText FormatterRandom Fake Address GeneratorRandom Superpower GeneratorCM to Inches ConverterMaster Number CalculatorRandom Poker Hand GeneratorLove Compatibility CalculatorRandom Meal GeneratorCaffeine Overdose CalculatorFile Size ConverterOn Base Percentage CalculatorNumber to Word ConverterWHIP CalculatorWord Ladder GeneratorDecimal to BCD ConverterCompound Growth CalculatorRandom Writing Prompt GeneratorFirst n Digits of PiOctal CalculatorVideo to Image ExtractorPER CalculatorBinary to Gray Code ConverterCompare Two StringsYouTube Channel StatisticsConnect the Dots GeneratorStair CalculatorSteel Weight CalculatorSocial Media Username CheckerWAR Calculator📷 OCR / Image to TextTime Duration CalculatorPercent Growth Rate CalculatorBCD to Decimal ConverterPerfect Number CheckerBingo Card GeneratorRandom Birthday GeneratorQuotient and Remainder CalculatorProportion CalculatorGrade CalculatorGray Code to Binary ConverterLeap Years ListMartingale Strategy Calculator📅 Date CalculatorRemove Line BreaksClothing Size ConverterArc Length CalculatorRandom Object GeneratorOutlier CalculatorImage Splitter🔍 Plagiarism CheckerSHA512 Hash GeneratorDay of the Year Calculator - What Day of the Year Is It Today?Battery Life CalculatorDMS to Decimal Degrees ConverterIP Subnet CalculatorBinary to BCD ConverterWhat is my Lucky Number?Add Text to ImageLong Division CalculatorList of Prime NumbersRandom Chord GeneratorVideo CompressorAstrological Element Balance CalculatorAcreage CalculatorRemove AccentTrigonometric Equation SolverVideo SplitterAI Punctuation AdderRandom Chess Opening GeneratorMorse Code GeneratorSmall Text Generator ⁽ᶜᵒᵖʸ ⁿ ᵖᵃˢᵗᵉ⁾URL ExtractorBoiling Point CalculatorAI ParaphraserModulo CalculatorIP Address to Hex ConverterRandom Time GeneratorSum of Positive Integers CalculatorWhat is my Zodiac Sign?🖱️ Click CounterTaco Bar CalculatorImage CompressorLottery Number GeneratorRemove Leading Trailing SpacesSquare Numbers ListCone Flat Pattern (Template) GeneratorNumber ExtractorAngel Number CalculatorHappy Number CalculatorBirth Day of the Week CalculatorPVIF CalculatorBroken Link Checker🎰 Gacha Pity CalculatorDay of Year CalendarName Number CalculatorList RandomizerRandom Emoji GeneratorWeight Loss CalculatorRandom Tournament Bracket GeneratorBreak Line by CharactersAI Language DetectorAdd Prefix and Suffix to TextRandom Number PickerNonogram Generator (Picross)Hypotenuse CalculatorMolarity CalculatorMandelbrot Set ExplorerEmail ExtractorYouTube Tag ExtractorMercury Retrograde CalendarDice Roll Probability CalculatorConvolution CalculatorCryptogram GeneratorBcrypt Hash Generator / Checker🔊 Tone GeneratorBonus CalculatorAdjust Video SpeedBCD to Binary ConverterHex to BCD ConverterLbs to Kg ConverterRadical SimplifierRandom Line PickerYouTube Comment PickerWord Scramble GeneratorExponential Decay CalculatorInvisible Character RemoverPVIFA CalculatorRandom Playing Card GeneratorFlip VideoMAC Address AnalyzerMiter Angle CalculatorVideo CropperAPI TesterkPa to psi ConverterYouTube Earnings EstimatorRandom Sound Frequency GeneratorRoof Pitch CalculatorText to Speech ReaderNumber Pattern FinderRounding CalculatorMultiple Fraction CalculatorRatio CalculatorRatio to Percentage CalculatorCoin FlipperLog Base 2 CalculatorMaze GeneratorAge CalculatorColor InverterDecibel (dB) Calculator⏱️ Hours CalculatorHow Long Ago CalculatorSort Lines AlphabeticallyBCD to Hex ConverterMedian CalculatorStandard Error CalculatorAverage CalculatorReverse VideoRemove Audio from VideoActual Cash Value CalculatorScientific Notation to Decimal ConverterRoot Mean Square CalculatorSHA3-256 Hash GeneratorAI Sentence ExpanderHex to Decimal ConverterRandom Group GeneratorRandom String GeneratorAmortization CalculatorMarkup 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 OptimizerCTR 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 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 CalculatorTip 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 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 SimulatorAnnuity Payout CalculatorReverse Mortgage CalculatorVariable Annuity CalculatorFixed Indexed Annuity CalculatorBond Convexity CalculatorBond Duration Calculator (Macaulay & Modified)Forward Rate CalculatorMortgage Recast CalculatorTreasury Inflation-Protected Securities (TIPS) CalculatorStock Beta CalculatorTreynor Ratio CalculatorSortino Ratio CalculatorDoppler Effect CalculatorSpring Constant CalculatorPendulum Period CalculatorCentripetal Force CalculatorAngular Velocity CalculatorMoment of Inertia CalculatorSnell's Law CalculatorCoulomb's Law CalculatorElectric Field CalculatorMagnetic Field of Wire CalculatorLens Equation CalculatorA/B Test Significance CalculatorA/B Test Sample Size CalculatorConversion Rate CalculatorCustomer Lifetime Value (CLV) CalculatorCustomer Acquisition Cost (CAC) CalculatorChurn Rate CalculatorRetention Rate Cohort CalculatorNPS (Net Promoter Score) CalculatorPareto Chart GeneratorSix Sigma Process Capability CalculatorTessellation GeneratorSpirograph GeneratorVoronoi Diagram GeneratorDelaunay Triangulation GeneratorL-System Fractal GeneratorJulia Set GeneratorPolar Equation Plotter3D Surface PlotterSierpinski Triangle GeneratorcURL Command BuilderHTTP Status Code ReferenceUUID Validator/DecoderURL ParserQuery String BuilderSVG to React/JSX ConverterSCSS to CSS CompilerLess to CSS CompilerTypeScript PlaygroundJSON Schema GeneratorImage to ASCII Art ConverterImage to SVG TracerLipogram CheckerPangram CheckerAcronym GeneratorBackronym GeneratorPig Latin TranslatorEXIF Data Viewer/RemoverROT13 Encoder/DecoderAtbash Cipher ToolVigenère Cipher ToolPronunciation IPA ConverterHemingway-Style Readability EditorSentence Length Variance AnalyzerWord Frequency AnalyzerBusiness Days CalculatorAdd Business Days to DateHalfway Date CalculatorDate Pattern GeneratorHow Long Until CalculatorBirthday Across Cultures CalculatorLunar Calendar ConverterHijri Calendar ConverterHebrew Calendar ConverterInsulin Sensitivity Factor CalculatorCarb-to-Insulin Ratio CalculatorLean Body Mass to Strength CalculatorOne-Mile Walk Test (Rockport) CalculatorCooper 12-Minute Run CalculatorFFMI CalculatorAPGAR Score CalculatorGlasgow Coma Scale CalculatorWells Score Calculator (DVT/PE)Tennis Score TrackerSoccer xG (Expected Goals) CalculatorCricket Run Rate CalculatorRugby Points CalculatorBoxing Punch Power CalculatorRace Time PredictorSwimming SWOLF CalculatorYoga Pose Hold Timer