Calculate the R1/R2 resistor ratio and key hysteresis-comparator parameters, including the reference voltage (VR), high threshold (VTH), and low threshold (VTL). Enter the positive and negative supply voltages with the threshold inputs to design and analyze a stable, noise-immune comparator circuit.
Input:(Note: Use minus sign "-" for negative voltages.)

Introduction
The Comparator with Hysteresis Calculator is an essential electronic design tool for electrical engineers. It allows you to calculate the precise resistor values required to set the High Threshold Voltage () and Low Threshold Voltage () for a comparator circuit.
By determining the correct Reference Voltage () and the resistor ratio (), you can design stable, noise-immune circuits. Below, we explore the fundamental theory behind comparators, the importance of hysteresis, and the mathematical formulas used in this calculator.
A Comparator is an integrated circuit (IC) that compares two input voltages and outputs a digital signal indicating which is larger.
Comparators are widely used in level detection, window detectors, and Analog-to-Digital converters. Common comparator ICs include the LM339, LM393, and TL331.
In a standard comparator, if the input signal moves slowly or contains noise, the output may flicker rapidly (bounce) between high and low states when the input voltage is near the reference threshold. This oscillation is often called "chatter."
Hysteresis eliminates this noise by introducing two distinct threshold voltages instead of one:
By adding a feedback resistor to the circuit (Positive Feedback), the comparator "remembers" its current state and resists changing until the input significantly crosses the new threshold. This configuration is often called a Schmitt Trigger.
An inverting comparator with hysteresis uses a positive feedback network.
When the output is High, the feedback resistor pulls the voltage at the non-inverting input slightly higher (creating ). When the output is Low, the feedback resistor pulls the non-inverting input slightly lower (creating ). This separation creates the "Hysteresis Window."
The calculator uses the following equations to determine the relationship between the threshold voltages and the resistor network for an Inverting Comparator with Hysteresis.
First, we define the ratio of the feedback resistors:
The ratio is determined by the difference between the supply voltages and the desired hysteresis window width:
Once the ratio and reference voltage are known, the thresholds are defined as:
High Threshold Voltage ():
Low Threshold Voltage ():
Where:
Can you use a standard Operational Amplifier (Op-Amp) like an LM741 or LM358 as a comparator?
This calculator determines the essential parameters for a hysteresis comparator circuit, including the high threshold voltage (VTH), low threshold voltage (VTL), resistor ratio (R2/R1), and reference voltage (VR). Enter your positive and negative supply voltages, and the tool outputs these values to help you design stable switching behavior in applications where noise is a concern.
Type a minus sign ("-") before the numeric value for any negative rail, such as "-5V". The calculator accepts both positive and negative supply voltages to match common split-supply configurations. For valid results, the positive voltage must be greater than the negative voltage.
Hysteresis introduces two distinct threshold voltages, VTH and VTL, which prevents the output from oscillating when the input signal is noisy or changes slowly. This ensures a clean, single transition between states, which is especially useful in applications like temperature monitoring, level detection, and switch debouncing.
Typical applications include filtering electrical noise from sensor signals, debouncing mechanical switches, generating square waves in relaxation oscillators, and performing threshold detection in temperature or voltage monitoring systems.
Resistor Color Code Calculator
Glofell’s Resistor Color Code Calculator decodes 4-band, 5-band, and 6-band resistors. Select each band to identify resistance, tolerance, and power rating for circuit work, repairs, or lab sorting.
Ohms Law Calculator
Glofell’s Ohm’s Law Calculator helps engineers and students quickly solve for voltage, current, resistance, and power. Provide any two known values to calculate the remaining parameters, making it a practical reference for circuit design, troubleshooting, and electronics learning.
Op-Amp Voltage and Gain Calculator
Calculate output voltage together with inverting and non-inverting gain for operational-amplifier circuits. Enter V1, V2, Vp, Vn, and resistor values R1 through R4 to obtain accurate results for circuit design, troubleshooting, and op-amp learning.
Inverting Op-Amp Resistor Calculator
Analyze an inverting operational-amplifier circuit by entering the desired gain, output voltage (Vout), R1 resistance, and input voltages V1, V2, Vp, and Vn. The calculator automatically determines the required R2, R3, and R4 resistor values, helping you design and verify inverting op-amp configurations.









