Comparator Hysteresis Calculator Overview
The Comparator Hysteresis Calculator helps calculate the high threshold voltage, low threshold voltage, reference voltage, and resistor ratio for a comparator circuit with hysteresis. By entering the positive supply voltage, negative supply voltage, and the required threshold conditions, users can estimate the values needed to build a stable comparator threshold circuit.
This calculator is useful for circuits that must convert a noisy, slow-moving, or analog input signal into a clean digital output. Hysteresis adds two switching thresholds instead of one, which helps prevent output chatter when the input signal is close to the switching point.
Use this tool as a first-pass design aid. Final values should be checked against the comparator datasheet, output type, input common-mode range, pull-up voltage, resistor tolerance, input bias current, propagation delay, and real noise level in the circuit.

What Is Comparator Hysteresis?
Comparator hysteresis is a method of adding positive feedback so that a comparator changes state at two different input voltages. One threshold is used when the input is rising, and another threshold is used when the input is falling.
Without hysteresis, a comparator may switch repeatedly if the input signal has noise near the reference voltage. With hysteresis, the input must move past a second threshold before the output changes back. This creates a noise margin and makes the output transition cleaner.
The difference between the high threshold voltage and the low threshold voltage is the hysteresis voltage:
VHYST = VTH - VTL
What This Calculator Can Calculate
VTH, the high threshold voltage where the comparator changes state for one input direction.
VTL, the low threshold voltage where the comparator changes state in the opposite direction.
VREF, the reference voltage used by the comparator threshold network.
R, the resistor ratio used by the hysteresis feedback network.
R2/R1, the practical resistor ratio used to set the hysteresis window.
The calculator is most useful when you know the supply rails and target switching thresholds, or when you want to estimate the threshold voltages produced by a selected reference voltage and resistor ratio.
Input Parameters Explained
| Input | Meaning |
|---|---|
| Vp | Positive supply voltage or high output level used by the comparator circuit. |
| Vn | Negative supply voltage or low output level used by the comparator circuit. |
| VTH | High threshold voltage. The input must cross this level in one direction to change the output state. |
| VTL | Low threshold voltage. The input must cross this lower level in the opposite direction to change the output state. |
| VREF | Reference voltage used by the threshold network. |
| R or R2/R1 | Resistor ratio that sets the amount of positive feedback and the width of the hysteresis window. |
Comparator Hysteresis Equations
For the calculator's comparator hysteresis model, the threshold equations can be written as:
VTH = VREF * (1 + R) / R - Vn / R
VTL = VREF * (1 + R) / R - Vp / R
The reference voltage can be calculated from a known high threshold:
VREF = Vn + (VTH - Vn) * R / (1 + R)
The resistor ratio can be calculated from the supply rails and hysteresis width:
R = (Vp - Vn) / (VTH - VTL)
Where:
VTH = high threshold voltage
VTL = low threshold voltage
VREF = reference voltage
Vp = positive supply or high output level
Vn = negative supply or low output level
R = resistor ratio, usually R2/R1 in the calculator model
Example Calculation
Suppose a comparator circuit uses:
Vp = 5 V
Vn = 0 V
Desired high threshold VTH = 3.0 V
Desired low threshold VTL = 2.0 V
The hysteresis width is:
VHYST = 3.0 V - 2.0 V = 1.0 V
The resistor ratio is:
R = (5 V - 0 V) / (3.0 V - 2.0 V) = 5
Using the reference voltage equation:
VREF = 0 V + (3.0 V - 0 V) * 5 / (1 + 5) = 2.5 V
This means a reference voltage of about 2.5 V and a resistor ratio of about 5 can create a 2.0 V to 3.0 V hysteresis window in this simplified model.
How to Use This Calculator
Decide whether the comparator will use a single supply or dual supplies.
Enter the high output level or positive supply voltage as Vp.
Enter the low output level or negative supply voltage as Vn.
Enter the desired high and low threshold voltages, or enter the reference voltage and resistor ratio if those are already known.
Calculate VTH, VTL, VREF, and the resistor ratio.
Select real resistor values that match the calculated ratio.
Check the circuit with the selected comparator datasheet and expected input signal range.
How to Read the Results
| Result | Meaning | Design Check |
|---|---|---|
| VTH | The upper trip point of the hysteresis window. | Make sure it is above the expected noise band and inside the valid input range. |
| VTL | The lower trip point of the hysteresis window. | Make sure it gives enough margin before the output switches back. |
| VHYST | The difference between VTH and VTL. | It should be larger than the expected input noise and ripple. |
| VREF | The reference level used by the threshold network. | Use a stable reference if threshold accuracy matters. |
| R2/R1 | The resistor ratio that sets the feedback strength. | Choose practical resistor values and check tolerance effects. |
How a Comparator Works
A comparator compares two input voltages and drives its output high or low depending on which input is greater. In a simple comparator, the output changes state when the input crosses a reference voltage. This makes comparators useful for level detection, zero-crossing detection, window detection, overvoltage protection, undervoltage lockout, and analog-to-digital interface circuits.
Many comparator outputs are open-drain or open-collector. These outputs require a pull-up resistor to create a high output level. The pull-up voltage may be different from the comparator supply voltage, so the real high output level should be checked before using it in threshold equations.

Why Hysteresis Is Important
If a slowly changing input signal contains noise, a comparator without hysteresis can switch rapidly when the signal is near the threshold. This unwanted switching is often called chatter. Hysteresis reduces chatter by creating a wider transition band.
For example, a temperature monitor, battery voltage detector, or sensor threshold circuit may have a noisy input. Instead of switching at exactly one voltage, a hysteresis comparator can switch on at one voltage and switch off at another. This makes the output more stable and easier for digital logic to read.
Comparator With Hysteresis vs. Comparator Without Hysteresis
| Feature | Without Hysteresis | With Hysteresis |
|---|---|---|
| Switching threshold | One threshold voltage. | Two threshold voltages. |
| Noise immunity | Lower; output can chatter near the threshold. | Higher; input must cross a second threshold to switch back. |
| Best for | Clean, fast-moving signals. | Noisy, slow-moving, or ripple-heavy signals. |
| Circuit complexity | Simpler. | Requires positive feedback or a comparator with built-in hysteresis. |
Choosing the Hysteresis Window
The hysteresis window should be wide enough to cover the expected input noise, ripple, and measurement uncertainty. If the hysteresis is too small, the output may still chatter. If the hysteresis is too large, the circuit may respond too late or require too much input change before switching back.
For precision designs, include resistor tolerance, reference tolerance, comparator input offset voltage, input bias current, output swing, and temperature drift in the threshold error budget.
Practical Design Notes
Use a dedicated comparator for fast or logic-level switching instead of a general-purpose op-amp when performance matters.
Check whether the comparator output is push-pull, open-drain, or open-collector.
Use a stable reference voltage if threshold accuracy is important.
Keep high-impedance threshold nodes away from noisy traces.
Add input filtering if the signal contains high-frequency noise that should not trigger the comparator.
Check propagation delay if the comparator is used in a time-critical circuit.
Verify the input common-mode range over all supply and signal conditions.
Use resistor values that are not so high that leakage and bias currents dominate the threshold accuracy.
Common Mistakes to Avoid
Assuming the comparator output reaches the exact supply rails.
Ignoring the pull-up resistor and pull-up voltage for open-drain outputs.
Using an op-amp as a comparator without checking recovery time and output behavior.
Choosing a hysteresis window smaller than the actual input noise.
Ignoring input offset voltage when threshold accuracy is important.
Using very large resistor values without checking input bias current and leakage effects.
Confusing high threshold and low threshold in an inverting comparator circuit.
When This Calculator Is Not Enough
This calculator is best for first-pass resistor-ratio and threshold estimates. More detailed analysis is needed for high-speed comparators, precision threshold detection, very low-power circuits, battery monitors, safety circuits, noisy industrial environments, and designs with open-drain outputs pulled to a different voltage rail.
For final designs, verify the thresholds with the comparator datasheet, tolerance analysis, simulation, and bench measurements across temperature, supply voltage, and input noise conditions.
Helpful Video Reference
Comparator Explained: Inverting Comparator, Non-Inverting Comparator and Window Comparator
Frequently Asked Questions
What is comparator hysteresis?
Comparator hysteresis is the use of two switching thresholds instead of one. It helps prevent unwanted output toggling when the input signal is noisy or slowly moving near the threshold.
What is the difference between VTH and VTL?
VTH is the high threshold voltage, and VTL is the low threshold voltage. Their difference is the hysteresis voltage.
Why does a comparator need positive feedback?
Positive feedback shifts the switching threshold depending on the current output state. This creates the two-threshold behavior needed for hysteresis.
Can an op-amp be used as a comparator?
Sometimes, but a dedicated comparator is usually better for switching applications. Op-amps can have slow recovery from saturation, limited output swing, and slower response when used as comparators.
How large should the hysteresis voltage be?
It should be larger than the expected input noise and ripple, while still allowing the circuit to switch at useful signal levels. Precision designs should include tolerance and temperature effects.
What if my comparator output is open-drain?
Use a pull-up resistor and include the pull-up voltage in the threshold analysis. The output high level is set by the pull-up rail, not necessarily by the comparator supply voltage.


Product
Brand
Articles
Tools










