PWM Duty Cycle Calculator
Pulse-width modulation duty cycle from on/off times or frequency and pulse width — average voltage, RMS voltage, timer compare values for 8/10/12/16-bit MCUs, and LED dimming perception.
How it works
Duty = t_on ÷ (t_on + t_off); V_avg = V_high × duty; V_rms = V_high × √duty; compare = duty × (2^bits − 1)
Pulse-width modulation controls power by switching fully on and fully off very quickly, varying only the fraction of each cycle spent on — the duty cycle. A load that responds slowly, such as a motor, a heater or the eye watching an LED, sees the average: 35% duty from 5 V looks and acts like 1.75 V without the losses of a resistor. Microcontrollers generate PWM with a counter that resets each period and a compare register that decides when the output flips, so the resolution is 256 steps for an 8-bit timer and 4,096 for a 12-bit one. Frequency choice is a trade-off: high enough to avoid flicker or audible whine, low enough to keep switching losses and EMI down.
Worked example
1 kHz at 35% duty: 350 µs on, 650 µs off, 1.75 V average from 5 V, RMS 2.96 V; Arduino analogWrite value 89 of 255.
Frequently asked questions
Why does 50% duty look brighter than half?
Human brightness perception is roughly logarithmic; 50% duty appears about 73% as bright. Gamma-correct your dimming curve for smooth fades.
What frequency for a servo?
Hobby servos use 50 Hz (20 ms period) with a 1–2 ms pulse — that is a 5–10% duty cycle where the pulse width, not the duty, carries the position.
Related calculators
This calculator is for educational purposes. Double-check important results before acting on them.