
Comparator Circuit: Definition, Op-Amp vs Comparator, Hysteresis, Interfaces (MOSFET/PLC/Optocoupler), Multi-Bit & Flash ADC, IC Selection
Global electronic component supplier ERSAELECTRONICS: Rich inventory for one-stop shopping. Inquire easily, and receive fast, customized solutions and quotes.
What is a Comparator Circuit?
A comparator circuit compares two input voltages and forces its output to a logic-like high or low state. You can improvise one with an op-amp without feedback (comparator op amp circuit), but a dedicated comparator integrated circuit is preferred for speed, input common-mode control, and clean recovery. If you wonder “is a comparator an amplifier” or “analog or digital?”, the short answer is: analog comparison at the input, digital-style output at OUT.
Terminals at a glance
- +IN / −IN — non-inverting / inverting inputs (the device compares V+ − V−).
- V+ / V− — supply rails.
- OUT — logic-like output (see I/O Rules).
- Some ICs add LATCH (output storage) or REF (built-in reference).
Output levels — what voltage does a comparator output?
- If V+ > V− ⇒ OUT ≈ VOH (near the high rail or the pull-up level).
- If V+ < V− ⇒ OUT ≈ VOL (near ground/low rail).
- This is not linear amplification—the stage saturates toward the rails to create a clean high/low edge.
- Output stage matters: open-drain/open-collector needs a pull-up; push-pull can drive logic directly (details in I/O Rules).
Feedback model
Comparators operate without negative feedback by default (open-loop). Adding a small positive feedback path creates hysteresis—two thresholds that suppress chatter on slow/noisy inputs. Learn how to size that network in Hysteresis & References.
Analog or digital?
Input behavior is analog; the result at OUT is digital-like (high/low). Don’t confuse this with digital magnitude comparators (1–4-bit), which compare binary numbers, not voltages.
What to read next
See how the three-step mechanism creates those rail-to-rail edges in How It Works, why op-amps are risky substitutes in Comparator vs Op-Amp, and how input common-mode and output stages affect real-world interfacing in I/O Rules.

How It Works
This section explains the working principle of a comparator—in short, how does a comparator work? A basic comparator converts a tiny input voltage difference into a clean, rail-to-rail transition at its output.
Three-step mechanism
- Sense the differential input: the device monitors V+ − V−.
- Amplify with very high open-loop gain so an internal node rushes toward one rail.
- Switch the output to a logic-like level: near VOH (high rail or pull-up level) or near VOL (low rail).
Default operation uses no negative feedback. When inputs change slowly or are noisy, add a small positive feedback path to create hysteresis (two thresholds). Learn sizing in Hysteresis & References.

Overdrive and propagation delay
- More input overdrive (ΔV) → less propagation delay and lower output jitter.
- Near the switching threshold (tiny ΔV) the edge becomes slower and more noise-sensitive (possible chatter).
- Practical fixes: increase ΔV with signal conditioning, or add hysteresis.

Saturation & recovery: why some op-amps fail as comparators
- Linear op-amps can enter deep saturation when used open-loop; recovery is slow and edges become rounded or may bounce.
- Input common-mode and output stage may not match MCU/logic levels.
- See Comparator vs Op-Amp and Speed & Noise for limits and specs.
Why do we need a comparator?
Threshold detection, zero-crossing, window detection, level conversion, fast edge generation, and as the front end of ADC schemes. See integration examples in Interfacing & Systems.
IC hooks (what to look for next)
- High-speed / low-delay comparators with specified tPD(ΔV) curves.
- Low-jitter or latched comparators for precise timing edges.
- Built-in hysteresis for slow/noisy signals; push-pull outputs for direct logic drive.
Continue: Comparator vs Op-Amp · Hysteresis & References · Speed & Noise· Submit your Request Quote
Comparator vs Op-Amp
Can you build an op-amp comparator circuit? Yes—an op amp as comparator works for slow, non-critical tasks when limits are respected. But for reliable edges, logic-level compatibility, and clean recovery, a dedicated comparator IC is the right tool. This section sets the boundaries so you know when to improvise and when to select a comparator.
When it’s acceptable (rare, low-speed cases)
- Very slow indicators, panel LEDs, or threshold flags (hundreds of hertz or below).
- Input common-mode stays comfortably inside the op-amp’s allowed range; output only drives a light load.
- µs–ms level delay is acceptable and you add external hysteresis.
- Example for study: an LM358 comparator circuit diagram for a slow battery-OK LED (still not recommended for production).
Do not do this (hard no-go boundaries)
- Need fast edges, low delay, or low jitter (PWM, zero-crossing, kHz–MHz timing) → use a comparator IC.
- Require defined output stage: open-drain for flexible pull-up or push-pull for direct logic drive (see I/O Rules).
- Operate near single-supply limits or need rail-to-rail input/output windows (see I/O Rules).
- Cannot tolerate deep-saturation recovery time and edge bounce (see Speed & Noise).
- Need built-in hysteresis, latching, window detection, or compliance (AEC-Q/industrial).
Input common-mode & output stage: the real differences
- Op-amp: designed for linear region; often limited common-mode range, output may not reach rails, and logic levels may be marginal.
- Comparator: specified common-mode window for threshold crossings; output offered as open-drain/open-collector or push-pull for MCU/logic compatibility (3.3 V/5 V via pull-up).
Saturation & recovery: why edges get ugly on op-amps
- Open-loop op-amps can fall into deep saturation; internal compensation makes recovery slow.
- Results: rounded edges, possible output bounce, and extra delay versus a dedicated comparator.
Quick Q&A
Is LM741 a comparator? No. It’s an old dual-supply op-amp; common-mode and output swing don’t suit modern 5 V single-supply logic—avoid.
Can you use an op-amp as a comparator? Only for slow, non-critical tasks within input/output limits, preferably with external hysteresis. Otherwise use a comparator.
LM358 vs comparator? An LM358 can demo a threshold LED, but for production choose a comparator (e.g., LM393-class) for speed and defined outputs.
Which is better, TL072 or NE5532? Both are audio op-amps (JFET vs bipolar low-noise). Neither is appropriate as a comparator; choose a dedicated comparator instead.
Decision guide: op-amp or comparator?
- Need fast edges / TTL-CMOS safe / low jitter? → Use a comparator IC.
- Slow, tolerant, light load, within input/output limits? → An op-amp comparator circuit can work; add hysteresis.
IC hooks (what to pick instead)
- Dedicated comparators with open-drain or push-pull outputs.
- Rail-to-rail input for single-supply, low-voltage designs.
- Fast propagation / quick recovery; options with built-in hysteresis or latching.

Continue: I/O Rules: Common-Mode & Output Levels · Speed & Noise · Selection & Replacements· Submit your Request Quote
I/O Rules: Common-Mode & Output Levels
This section answers “what voltage does a comparator output?” and how supply, input common-mode, and output stage determine the real comparator output high low levels. It also covers the minimum voltage for a comparator in low-voltage/battery systems and how to size pull-ups for open drain vs push pull outputs.
What voltage does a comparator output?
- If V+ > V− ⇒ OUT ≈ VOH (near the high rail, or the pull-up level for open-drain).
- If V+ < V− ⇒ OUT ≈ VOL (near the low rail/ground).
- Exact levels depend on the output stage: open-drain/open-collector (needs a pull-up) or push-pull (drives high/low actively).
Common-mode window vs your threshold
The input common-mode range (VCM) must include the entire voltage swing present at the comparator’s inputs, especially the threshold crossing.
- Read the datasheet’s VCM limits for your supply and temperature.
- Compute the actual voltage ranges at +IN/−IN (including dividers, biasing, tolerances, drift).
- Verify the whole swing and the threshold sit inside VCM. If not, use rail-to-rail input (RRI) parts or shift the bias network.
Slow/noisy crossings? Add a small positive feedback network (hysteresis). See Hysteresis & References.

Minimum supply & RRI/RRO for low-voltage systems
- Minimum operating voltage (VMIN) sets the floor for correct behavior—watch cold-start and brownout in battery-powered designs.
- RRI (rail-to-rail input) and RRO (rail-to-rail output) are often not perfectly to the rails—there’s a small headroom near each rail.
- For tight headroom (≤1.8/2.5/3.3 V), prefer RRI inputs and push-pull outputs to guarantee logic thresholds.
Open-drain vs push-pull: choose the right output stage
- Open-drain/open-collector: needs a pull-up; easy level-shifting (e.g., pull up to 5 V for a 3.3 V system); enables wired-OR. Rise time depends on pull-up and load.
- Push-pull: actively drives high/low for faster edges; best when directly interfacing MCUs/logic at a fixed I/O rail.
- Interface examples: see Interfacing & Systems.

How to size the pull-up resistor (practical)
- Estimate total load capacitance CLOAD (pin + trace + input + parasitics).
- Set a target rise time tr, then start with
RPU ≲ tr / (2.2 · CLOAD)
. - Check low-level sink current:
IOL = VPU / RPU
must be within the comparator’s rating (leave margin).
Typical ranges: 1–10 kΩ for speed; 10–100 kΩ for lower power (but slower edges and weaker noise immunity). If edges are still slow, reduce RPU or choose a push-pull output.
Quick recipes
- Direct to MCU: prefer push-pull. If open-drain, pull up to the MCU I/O rail and verify IOL/tr.
- Level-shift to 5 V: use open-drain with a 5 V pull-up.
- Noisy/slow inputs: add hysteresis and consider a smaller pull-up.
IC hooks (what to look for)
- Rail-to-rail input (RRI) to keep your threshold inside VCM.
- Push-pull outputs for fast, direct logic drive.
- Low-voltage operation options (≤1.8/2.5/3.3 V) for battery systems.
Continue: Hysteresis & References · Interfacing & Systems · Selection & Replacements· Submit your Request Quote
Hysteresis & References
A hysteresis comparator adds two clean thresholds to prevent chatter when inputs move slowly or are noisy. This section shows when to add hysteresis, how to size the network, and how to choose a reference for a robust voltage comparator circuit—from simple dividers to a comparator with a Zener diode or a precision reference IC.
Why add hysteresis? (when it’s mandatory)
- Slow-ramping inputs, ripple/EMI, supply ground bounce, or sensor noise cause repeated crossings near the threshold.
- Hysteresis creates upper and lower thresholds so the output toggles once per excursion.
- Verify input common-mode and output stage constraints first: see I/O Rules.
Schmitt comparator in practice: formulas you can use
For the common inverting Schmitt: the signal goes into −IN; +IN receives a reference plus positive feedback via R1 (from OUT to +IN) and R2 (from VREF to +IN).
- Define the feedback ratio:
α = R1 / (R1 + R2)
. - Upper threshold:
VTH+ = (1 − α)·VREF + α·VOH
- Lower threshold:
VTH− = (1 − α)·VREF + α·VOL
- Hysteresis width:
ΔV = VTH+ − VTH− = α·(VOH − VOL)
- Midpoint:
VM = (VTH+ + VTH−)/2 = (1 − α)·VREF + α·(VOH + VOL)/2
Two-step synthesis for production design:
- Pick the desired hysteresis width ΔV →
α = ΔV / (VOH − VOL)
. - Pick the desired midpoint VM →
VREF = [ VM − α·(VOH+VOL)/2 ] / (1 − α)
.
Use the actual VOH and VOL of your output stage (open-drain + pull-up makes VOH = pull-up rail; VOL depends on sink current). See I/O Rules.
Voltage comparator circuit with a Zener reference
A comparator with a Zener diode is attractive for low cost when drift isn’t critical.
- Select VZ and an operating current IZ in the diode’s recommended region.
- Series resistor:
RS = (VIN,max − VZ) / (IZ + ILOAD)
(often ILOAD ≈ 0 for comparator inputs). - Account for dynamic resistance rz and Zener noise; add a small RC (10–100 nF) for filtering.
- Limitations: relatively large tempco and poorer line/load regulation; threshold drifts with ΔT and ΔI.
Precision references: when your threshold must not drift
- Choose when you need low tempco, tight tolerance, and strong line/load regulation across environments.
- Consider: temperature coefficient (ppm/°C), output noise, startup current, quiescent power.
- Types include low-noise series references and adjustable shunt references; ideal for window comparators or ADC front ends.
- Combine with the formulas above by substituting the reference’s VREF to hold ΔV and VM stable across temp and production spread.

Practical recipe: picking the hysteresis width
- Start with 5–10% of the valid input span; increase to 10–20% for very slow or noisy signals.
- Use measured VOH / VOL (not ideal rails). Compute α and VREF with the two-step method above.
- If low-voltage or rail-to-rail constraints apply, satisfy level compatibility first (see I/O Rules), then set ΔV.
Common mistakes (checklist)
- Wiring the feedback to the wrong input, yielding inverted or ineffective hysteresis.
- Using supply rails as VOH/VOL and ignoring headroom from the output stage and load.
- Choosing R values too small (wasted power, heavy loading) or too large (thermal noise, bias-current sensitivity).
- Running a Zener far from its recommended current, or omitting decoupling—both cause threshold wander.
- Forgetting the input common-mode window; thresholds end up outside VCM (see I/O Rules).
IC hooks (what to pick)
- Built-in hysteresis comparators for quick stabilization.
- Built-in reference or window comparators for tight thresholds.
- AEC-Q / Industrial-grade parts for robust, low-drift behavior.
Continue: Design Library · Speed & Noise · Selection & Replacements· Submit your Request Quote
Speed, Noise & Accuracy
This section explains key comparator characteristics that shape edges and thresholds: propagation delay vs overdrive, jitter/noise, and accuracy limits such as offset in comparator inputs and CMRR. It also covers practical testing tips and when to pick high-speed or push-pull devices. For background on saturation and recovery, see Comparator vs Op-Amp; for I/O-level constraints, see I/O Rules.
Propagation delay vs overdrive (tPD vs ΔV)
- Larger input overdrive (ΔV) produces smaller propagation delay tPD and cleaner edges.
- Datasheet numbers are taken at a stated ΔV and input slew—your real system may be slower near threshold.
- Near-threshold, tiny ΔV increases delay and jitter; increase ΔV or add hysteresis.
.png?x-oss-process=image/auto-orient,1/quality,q_70/format,webp)
Jitter and noise: the practical model
A useful approximation for timing jitter is: σt ≈ Vn,rms / (dV/dt|threshold)
. More noise or slower edges → more jitter.
- Reduce Vn (filtering, layout, low-noise references) or increase dV/dt (more ΔV, faster input slope, or add hysteresis).
- Open-drain with a large pull-up slows the rising edge (RPU·CLOAD), increasing jitter—see I/O Rules.
Saturation, recovery & output bounce
- Deep saturation and internal compensation can slow recovery, rounding edges and causing bounce.
- Heavy loads or long traces can add ringing; push-pull outputs typically deliver cleaner, faster transitions than open-drain.
- For fast edges/low jitter, pick high-speed comparators and consider push-pull outputs.
Background on op-amp misuse and recovery: Comparator vs Op-Amp.
Offset and bias: how thresholds drift
Input offset voltage VOS appears directly as threshold error; input bias currents flowing through source impedances add more error: VTH,effective ≈ VREF ± VOS ± IB·RSOURCE
.
- Choose low-offset/low-drift comparators; minimize RSOURCE.
- Account for temperature drift of VOS and any reference; prefer precision references for tight windows (see Hysteresis & References).
CMRR (and PSRR): reject what you don’t compare
- CMRR (common-mode rejection ratio) determines how much common-mode noise moves the threshold—higher is better.
- CMRR and PSRR often degrade at higher frequency; decouple supplies and route grounds tightly.
- For complete comparator characteristics, read frequency-dependent specs, not just DC numbers.
Measurement pitfalls (how to test it right)
- Use 10× probes or 50 Ω paths with a short ground spring; long ground leads create ringing.
- With open-drain outputs, rising edges are RPU·CLOAD-limited—state your pull-up and load when reporting tPD.
- State the overdrive and input slew used; align trigger level (e.g., 50%) and scope bandwidth with datasheet methods.
- Test power-up and recovery from saturation—edge “tails” are a common limitation.
When to choose high-speed / low-jitter / push-pull
- Zero-crossing, PWM/timing, encoder edges, ADC sample windows → high-speed, low-jitter comparators.
- Direct MCU interfacing → prefer push-pull outputs; open-drain adds R·C rise-time limits (a practical disadvantage).
- Battery/low-voltage → combine this section with I/O Rules to ensure logic thresholds are met.
IC hooks (what to pick)
- Nanosecond-class high-speed comparators with tPD(ΔV) curves.
- Low-offset / low-drift devices for accurate thresholds.
- Low-jitter “clock” comparators and push-pull outputs for crisp logic edges.
Continue: I/O Rules · Hysteresis & References · Selection & Replacements· Submit your Request Quote
Design Library: Comparator Circuit Diagrams
A one-page gallery of the most useful comparator circuit diagrams you can drop into designs. Each entry includes a circuit diagram of comparator plus three practical notes so you know exactly how to build a comparator and how to design a comparator that behaves in real hardware.
Basic Comparator (inverting & non-inverting)
- Connections: Non-inverting (signal → +IN, reference → −IN) flips high when signal > reference; inverting is the opposite (this is the canonical way to “reverse a comparator”).
- Threshold: equals the reference node; output is logic-like VOH/VOL set by output stage and pull-up (see I/O Rules).
- Notes: For a quick demo you can use an op-amp voltage comparator circuit, but production designs should prefer a dedicated comparator IC and add hysteresis for slow/noisy inputs.

Schmitt (Hysteresis) Comparator
- Why: A hysteresis comparator adds upper/lower thresholds to stop chatter on slow-ramping or noisy signals.
- Formulas: With feedback ratio α = R1/(R1+R2), thresholds are VTH+ = (1−α)·VREF + α·VOH, VTH− = (1−α)·VREF + α·VOL; width ΔV = α(VOH−VOL).
- Notes: Use measured VOH/VOL (open-drain + pull-up sets VOH). Details in Hysteresis & References.

Comparator with a Zener Reference
- Use case: Cost-sensitive thresholds; a comparator with a Zener diode sets VREF ≈ VZ.
- Sizing: Series resistor RS = (VIN,max − VZ)/(IZ + ILOAD); add a small RC to tame Zener noise and dynamic resistance.
- Notes: Tempco and regulation are mediocre; for precision, use a reference IC (see Hysteresis & References).

AC / Zero-Cross Comparator (bias & shaping)
- Use case: A comparator for AC voltage detects zero crossings or phase; first bias the AC signal into the allowed common-mode window.
- Shaping: Add input limiting/RC to prevent over-voltage; include a touch of hysteresis to suppress 50/60 Hz ripple chatter.
- Notes: Check common-mode and output stage choices (open-drain vs push-pull) per I/O Rules.

Window Comparator (upper & lower thresholds)
- Concept: Two comparators define an upper and lower threshold; detect “inside window” or “outside window”.
- Logic: Combine outputs (e.g., wired-OR with open-drain or gates) to flag in-range/under/over.
- Notes: Accuracy depends on reference and offset; consider temp drift and tolerances (see Hysteresis & References).

IC hooks (what to look for)
- Built-in hysteresis comparators for chatter-free edges.
- Dual/quad channels to implement window or multi-point thresholds compactly.
- Low-power / low-voltage (≤1.8/2.5/3.3 V) for battery designs.
- Push-pull or open-drain outputs to match logic needs and level shifting.
Learn more in: I/O Rules · Hysteresis & References · Selection & Replacements· Submit your Request Quote
Interfacing & Systems
This section shows how a comparator connects to real systems: driving MOSFETs, serving as the decision element in ADC architectures, and interfacing through optocouplers to PLC inputs. You’ll find quick rules, back-of-the-envelope sizing, and when to switch from “can I?” to “I should use the right driver/part.”
Driving a MOSFET with a comparator
Can a comparator drive a MOSFET? Yes—if the MOSFET gate charge is small and edges are not critical. For large Qg, high frequency, or hard switching, use a dedicated gate driver.
- Prefer push-pull outputs for fast edges; open-drain outputs rely on the pull-up and are R·C limited.
- Back-of-the-envelope:
- Push-pull rise/fall:
tr/f ≈ Qg / Isource/sink
. - Open-drain rise (10–90%):
tr ≈ 2.2 · RPU · (Cgate + Cstray)
; sink currentIOL = VPU/RPU
must meet the device rating.
- Push-pull rise/fall:
- Insert a small series gate resistor (5–100 Ω) to tame ringing; check logic compatibility per I/O Rules.
Hard no-go: large Qg, >10–20 kHz power switching, or gate voltages > logic rails (e.g., 10–12 V for power MOSFETs). Use a gate driver that sources/sinks hundreds of mA to amps. See edge-quality notes in Speed & Noise.

Comparators in ADCs
A comparator is not an ADC, but it’s the ADC’s decision engine. In a comparator ADC circuit, different architectures use the comparator differently:
- Flash ADC: a resistor ladder feeds 2N−1 comparators to generate a thermometer code, then an encoder compresses it. How many comparators for a 4-bit flash ADC? 15. Tradeoffs: steep power/area growth, bubble errors, careful matching.
- SAR ADC: one high-quality comparator iteratively compares DAC outputs; offset/jitter directly set ENOB.
- Integrating/dual-slope: comparator detects zero crossings for timing integration.
Need high speed and low jitter? Choose a fast, low-noise comparator; for SAR/integrators, prioritize low offset and drift. See Selection & Replacements.

Optocoupler & PLC Interfacing
Interfacing a comparator to a PLC typically uses an optocoupler for isolation. Yes, an optocoupler can act as a switch: the LED current modulates a phototransistor or logic receiver.
- Basic hookup (open-drain): OUT → pull-up → series resistor → opto LED → GND (sinking). Push-pull can drive through a series resistor.
- LED resistor:
RLED = (VSUP − VF,LED − Vsat/swing)/ILED
; choose ILED=2–10 mA to cover CTR spread and temperature. - Bandwidth & leakage: typical analog optos are 10–100 kHz; leakage/dark current can cause false trips—add pull-downs or Schmitt inputs.
- PLC modules: 24 V DC inputs often require a few mA; AC modules add rectifiers/zero-cross detection, limiting response speed. Add surge/ESD protection and respect creepage/clearance.
For level and edge-shape constraints, see I/O Rules. For noise and jitter budgeting, see Speed & Noise.

Quick Q&A
Can a comparator drive a MOSFET? Yes for small Qg and modest speed; otherwise use a gate driver.
How many comparators for a 4-bit flash ADC? 15 (24−1).
Is a comparator an ADC? No. It’s the threshold detector inside many ADCs.
Can an optocoupler act as a switch? Yes—LED current controls a transistor or logic output; mind CTR, leakage, and bandwidth.
IC hooks (what to pick for systems)
- High-speed, push-pull comparators for crisp edges and low jitter.
- Latched comparators for sampled decisions in timing/ADC front ends.
- Comparator families matched to ADC front ends (low offset, stable thresholds, multi-channel/window options).
- Industrial/AEC-Q grades for wide temp, robust ESD/surge, and isolation-friendly I/O.
Continue: I/O Rules · Speed & Noise · Design Library · Selection & Replacements· Submit your Request Quote
Digital Magnitude Comparators (1–4-bit)
This sidebar clarifies what a 1-/2-/3-/4-bit comparator is and how a 4-bit comparator circuit works—so you don’t mix it up with an analog voltage comparator. Digital magnitude comparators take two binary words and assert three outputs: A>B, A=B, or A<B.
What is a digital magnitude comparator?
- Inputs: two N-bit binary numbers A[N−1:0], B[N−1:0].
- Outputs: three lines—A>B, A=B, A<B (exactly one is true for valid binary inputs).
- Not an analog comparator: the analog device compares voltages and outputs one logic-like level. If you’re after voltage thresholds, see What is a Comparator Circuit? and Design Library.
1-bit comparator: truth & logic
A 1-bit comparator compares A,B ∈ {0,1}. Boolean equations: A>B = A · ¬B A=B = ¬(A ⊕ B) A<B = ¬A · B

From 2-bit to 3-bit: hierarchical compare
- A 2-bit comparator (often called a 2 magnitude comparator) first compares MSBs; if equal, it compares LSBs.
- Extend to 3-bit with the same hierarchy: check A[2] vs B[2], then A[1] vs B[1], then A[0] vs B[0].
- Logic can be written as “greater if higher bit greater, or equal-so-far and next bit greater”.

4-bit comparator circuit: A>B / A=B / A<B
- A typical 4-bit comparator circuit exposes inputs A[3:0], B[3:0] and three outputs: GT, EQ, LT.
- Many logic ICs also include cascade pins (e.g., GTin, EQin, LTin) to chain multiple 4-bit blocks into 8/12/16-bit comparators.
- In HDL (Verilog/VHDL),
assign GT = (A > B);
EQ = (A == B);
LT = (A < B);
synthesizes to the same structure.

“Phase comparator circuit”? That’s a PLL topic
A phase comparator circuit (phase/frequency detector) compares signal phase in a PLL—different goal and implementation from magnitude comparators. See our PLL page for XOR/PFD variants (link: PLL · Phase Comparator).
Where to learn/build next
- Digital logic (gates, Karnaugh maps), HDL (Verilog/VHDL), and FPGA/CPLD projects.
- If you meant voltage threshold detection, return to What is a Comparator Circuit? and the Design Library.
Continue: Analog Comparator Basics · Comparator Circuit Diagram Library· Submit your Request Quote
Selection & Replacements
A practical guide to how to choose a comparator and swap parts without surprises. Follow the five-step checklist below—supply & common-mode → speed → output stage → hysteresis/accuracy → compliance—then see replacements and vendor buckets. If you’re unsure whether you need an op-amp or a comparator integrated circuit, skim Comparator vs Op-Amp first.
Quickstart: how to choose a comparator

Step 1 — Supply & Common-Mode Window
- Fix VCC and the full input swing at +IN/−IN (including divider/bias/tolerances).
- Check datasheet VCM limits; if crossings touch the rails, pick RRI (rail-to-rail input).
- Low-voltage systems (≤1.8/2.5/3.3 V): verify logic-safe VOH/VOL (see I/O Rules).
Step 2 — Speed, Overdrive & Edge Quality
- Use tPD(ΔV) curves; more overdrive → less delay/jitter.
- For clean fast edges, favor high-speed devices and push-pull outputs.
- Battery/low-power? Trade speed for quiescent current; open-drain may suffice. See Speed & Noise.
Step 3 — Output Stage & Interface
- Open-drain/open-collector: flexible level shifting and wired-OR; requires a pull-up (rise time = RPU·CLOAD).
- Push-pull: direct MCU/logic drive with fast edges; fixed to the output rail.
- For MOSFET/PLC/opto coupling, see Interfacing & Systems.
Step 4 — Hysteresis & Accuracy Budget
- Pick built-in hysteresis or add external feedback; target ΔV (e.g., 5–10% of signal span).
- Account for offset, bias current·source resistance, CMRR/PSRR, and reference drift.
- Precision thresholds → low-offset/low-drift comparator + precision reference (see Hysteresis & References).
Step 5 — Reliability & Compliance
- Input protection (series resistors/clamps), ESD/EMI layout, startup/brownout behavior.
- Temperature range, AEC-Q / industrial grades, latching/sampled inputs if needed.
LM358 vs LM393 (and friends)
- LM358: an op-amp. Can demo a slow threshold but suffers from saturation recovery, undefined logic levels, and limited common-mode.
- LM393: a comparator integrated circuit (commonly open-drain) with defined VCM, faster decision edges, and cleaner recovery.
- FAQ — Is LM393 a comparator? Yes. Is IC 741 analog or digital? Analog op-amp (not a comparator, not a digital IC).
More on misuse boundaries: Comparator vs Op-Amp. For I/O levels and pull-ups, see I/O Rules.
Recommended reading: LM393 Comparator IC: Pinout, Datasheet, and Small-Batch Alternatives .
Replacements: pin-to-pin without surprises
- Package & pinout: same package; OUT, +IN, −IN, V+, V− at identical pins. Output stage type (open-drain vs push-pull) must match system intent.
- Electrical: VCC range, VCM window, VOH/VOL at load, tPD(ΔV), IOL, built-in hysteresis, input clamps/abs max.
- Behavior: latching/window features, startup/brownout behavior, power sequencing, temperature/grade.
Non-compatibility red lines (don’t cross):
- Swapping open-drain for push-pull while keeping a pull-up to a higher rail → over-voltage risk.
- RRI → non-RRI so thresholds fall outside VCM.
- tPD doubles and breaks timing; VOH no longer meets MCU VIH; hysteresis changes cause chatter.
Vendor buckets (directional, no fixed PNs)
- TI · ST · NXP · Renesas · onsemi · Microchip · Melexis: look for families grouped as low-power rail-to-rail, high-speed/low-jitter, open-drain/push-pull, built-in reference/window, and AEC-Q.
Submit Your BOM (48h)
Paste your requirements/BOM and we’ll run a pin-to-pin risk scan, compliance check, and sample suggestions.
Continue: I/O Rules · Speed & Noise · Hysteresis & References · Design Library · Interfacing & Systems· Submit your Request Quote
FAQ
A) Basics
What are comparator circuits?
What is the function of the comparator?
What are the terminals of a comparator?
What voltage does a comparator output?
Is a comparator an amplifier? Analog or digital?
Working principle of a comparator?
B) Design
Simplest comparator circuit?
How to build/design a comparator?
Inverting vs non-inverting decision?
What is hysteresis?
Comparator with a Zener diode?
Comparator for AC voltage?
Minimum voltage for a comparator?
Limitations / disadvantages?
C) Selection
Is LM741 a comparator?
Is LM393 a comparator?
Can you use an op-amp as a comparator?
LM358 vs LM393?
TL072 or NE5532 “better”?
How to choose a comparator?
What is a “comparator integrated circuit”?
Is IC 741 analog or digital?
D) Integrate
Can a comparator drive a MOSFET?
Is a comparator an ADC?
How many comparators for a 4-bit flash ADC?
PLC & optocoupler basics (AC or DC? opto as a switch?)
E) Digital
What is a 1-bit comparator?
What is a “2 magnitude” comparator?
What is a 3-bit number comparator?
What is a 4-bit comparator circuit?
Phase comparator circuit?
F) Terms
What is CMRR?
What is offset in a comparator?
Why is “741” called 741?
Comparator rule / law / single-comparator requirement?
Submit Your BOM (48h)
Send us your parts list and within 48 hours you’ll receive: lead-time comparison, pin-to-pin alternatives, a compliance check (AEC-Q/Industrial), and a sample-kit suggestion. We’ll also include cross-brand options and practical configuration advice such as forced PWM / Auto-PFM where relevant to your power stages.

48-Hour BOM Review — What you’ll get
- Lead-time comparison across authorized channels with nearest substitutes if any line is constrained.
- Pin-to-pin alternatives filtered by package/pinout, I/O stage (open-drain/push-pull), VCC/VCM, tPD(ΔV), VOH/VOL, and hysteresis.
- Compliance check (AEC-Q/Industrial), temp range, ESD/EMI notes, startup/behavior deltas.
- Sample-kit suggestion (2–3 cross-brand options) plus power-stage tips (e.g., forced PWM / Auto-PFM) where applicable.
How it works (3 steps)
Fill the form or attach a CSV/XLSX. Tell us your time window and constraints.
We grid-match electricals, check compliance, and rank alternatives.
You receive the report + 2–3 cross-brand options and risk flags.
BOM Form (or Submit your Request Quote)
Deliverable examples (2–3 cross-brand options)
- I/O stage: open-drain → open-drain (pull-up unchanged)
- VCC/VCM: compatible; VOH/VOL meets MCU
- tPD(ΔV): within ±10%; built-in 10 mV hysteresis
- Switch to push-pull (remove external pull-up)
- Lower jitter; better for encoder/ADC window
- Check VOL at load & start-up behavior
- Rail-to-rail input at 1.8–3.3 V
- Quiescent current < 70 µA (battery)
- Add 5–10% hysteresis window for slow ramps
Red-line risks: swapping open-drain ↔ push-pull without re-checking pull-ups, losing RRI so thresholds exit VCM, tPD doubling, VOH not meeting MCU VIH, or hysteresis changes causing chatter. See Selection & Replacements.
Compliance & risks
- AEC-Q / Industrial screening, temperature range, ESD/EMI, derating and traceability notes.
- I/O compatibility: logic thresholds, RPU sizing, and edge shape (see I/O Rules).
- System tie-ins: MOSFET gate drive, optocouplers/PLC, ADC front ends (see Interfacing & Systems).
Related categories
LM393 / LM358 · MOSFET · Optocoupler · ADC · Logic (Digital Comparators)
Privacy & SLA
We use your BOM only for selection and lead-time analysis. We reply within 48 working hours. NDA available on request.
Submit BOM → Need guidance first? See Selection & Replacements or Design Library.