The duty cycle tells you what fraction of each cycle a signal spends in its active (high) state. It is the key number of pulse-width modulation (PWM), the technique microcontrollers use to dim LEDs, set the speed of DC motors, drive servo-like actuators and regulate switch-mode power supplies, and it also describes how hard pumps, relays, welders or heaters are worked over time.
This calculator gives the duty cycle from the values you actually have on hand: pulse width and period (read off an oscilloscope), pulse width and frequency (from a datasheet or timer settings), or on time and off time (from a relay or thermostat cycle). It also returns the period, frequency and off time, and, if you enter the switched voltage, the average voltage and the RMS voltage of the waveform.
Times can be entered in seconds, milliseconds, microseconds or nanoseconds; frequency in Hz, kHz or MHz. For general conversions between period, frequency and wavelength, see the frequency calculator.
How to use this calculator
- Choose what you know: pulse width and period, pulse width and frequency, or on and off times.
- Pick the time unit used for the pulse width, period or off time.
- Enter the values. In frequency mode, choose Hz, kHz or MHz.
- Optionally enter the high level (e.g. 12 V) and the low level (usually 0 V).
- Read the duty cycle, the period, frequency and off time, and the average and RMS voltage.
The formula
With a pulse width (on time) , an off time , a period and a frequency :
For a rectangular wave switching between and , with :
With a 0 V low level these become and . The ratio itself (between 0 and 1) is often called the duty factor.
Worked example
A motor driver runs at 20 kHz with 30 µs pulses from a 12 V supply.
- Period: µs, so the off time is 20 µs
- Duty cycle: %
- Average voltage: V; RMS voltage: V
A relay that is on for 3 s and off for 1 s has a duty cycle of 75%.
Typical duty cycles and PWM frequencies
| Application | Typical frequency | Notes |
|---|---|---|
| LED dimming | 200 Hz – 20 kHz | Above about 200 Hz flicker is no longer visible; brightness tracks the average current. |
| DC motor speed | 1 – 25 kHz | 20 kHz and above is inaudible; speed follows the average voltage. |
| Hobby servo signal | 50 Hz | Pulses of 1–2 ms in a 20 ms period: a duty cycle of 5–10%. |
| Switch-mode buck converter | 100 kHz – 2 MHz | Output ≈ D × input voltage in continuous conduction. |
| Arduino analogWrite() | about 490 Hz or 980 Hz | Values 0–255 map to duty cycles 0–100%. |
A square wave is the special case .
Duty cycle outside electronics
The same ratio describes intermittent machines. A welding power source rated "60% at 200 A" may weld 6 minutes out of every 10 at that current before it must cool. A pump that runs 15 minutes per hour works at a 25% duty cycle, and a heater cycled by a thermostat 2 minutes on, 3 minutes off runs at 40%. Use the on/off mode for these cases, with times in seconds.
Frequently asked questions
What is a 50% duty cycle?
The signal is high for half of each period and low for the other half: a square wave. A 5 V square wave has an average of 2.5 V and an RMS value of about 3.54 V.
How do I calculate the duty cycle from frequency?
Convert the frequency to a period with T = 1/f, then divide the pulse width by it. At 1 kHz the period is 1 ms, so a 250 µs pulse gives a 25% duty cycle.
Why is the RMS voltage higher than the average?
RMS weights the high level by its square, which reflects the heating power delivered to a resistor. For a 0 V low level, RMS = √d × V_high, which is always at least d × V_high.
What is the difference between duty cycle and duty factor?
They express the same ratio. The duty cycle is usually given as a percentage (25%), the duty factor as a fraction (0.25).
Can the duty cycle be 0% or 100%?
Yes. At 0% the output never switches on and at 100% it stays on continuously; neither is really a pulse train any more. The pulse width can never exceed the period.
Sources
- Horowitz & Hill — The Art of Electronics, 3rd ed. (Cambridge University Press, 2015)
- IEEE Std 181-2011 — Standard for Transitions, Pulses, and Related Waveforms (pulse duration, duty factor)
- OpenStax University Physics Vol. 2 — 15.1 AC sources (average and RMS values)
Last updated: