PWM Duty Cycle Calculator
Compute the on-time, off-time and period for a PWM signal.
Formula
T = 1 / f, Ton = T × duty%
Inputs
- PWM frequency (Hz)
- Duty cycle (%)
What it does
Gives the period, on-time and off-time of a PWM signal from its frequency and duty cycle.
Where it's used
Motor speed control, LED dimming, servo signals and switching regulators.
How to use it
- Enter the PWM frequency.
- Enter the duty cycle in %.
- Read the period, on-time and off-time.
The formula explained
- T
- 1 / f — period
- T_on
- T × duty
- T_off
- T − T_on
Worked example
A 20 kHz motor drive at 25 % duty.
Inputs:
- PWM frequency: 20k Hz
- Duty cycle: 25 %
The calculator gives:
- Result: 25%
- Period: 50 µs
- On time: 12.5 µs
Tips and common mistakes
- Above 20 kHz motors and coils stop whining audibly.
- LED dimming above a few hundred hertz avoids visible flicker.
- The average voltage on a resistive load is duty × supply voltage.
Questions people ask
What average voltage does PWM give?
On a resistive load, duty × supply voltage: 25 % of 12 V is 3 V on average. Motors and LEDs respond to that average, which is how PWM controls speed and brightness.
How many duty-cycle steps can I get?
Timer clock ÷ PWM frequency. A 72 MHz timer at 20 kHz counts 3 600 steps per period, about 11.8 bits. A higher PWM frequency means fewer steps.
What signal does a hobby servo need?
A 50 Hz signal (20 ms period) with a pulse of about 1–2 ms — 5–10 % duty. 1.5 ms is the centre position. The exact range varies a little between servos.
Related Embedded & Comms calculators
Enter your values to get the result with the formula, substituted values and an explanation of each step.