Skip to content

Duty Cycle Calculator for Pulses and PWM

Duty cycle of a pulse or PWM signal from pulse width and period, frequency or on/off times, with average voltage.

Your details

Known values
Time unit

Time the signal stays at its high (active) level in each cycle.

Supply voltage switched by the PWM, e.g. 5 V, 12 V or 24 V. Leave blank if you only need the duty cycle.

V

Usually 0 V.

V

Results update as you type

Duty cycle

25%

Duty factor (fraction)
0.25
Period
1 ms
Frequency
1 kHz
Off time
750 µs
Average voltage
3 V
RMS voltage
6 V

Average and RMS assume an ideal rectangular wave (instant edges) between the low and high levels. A motor or LED driven by PWM responds to the average; a heater to the RMS value.

Step-by-step solution
  1. D = t_on ÷ T × 100 = 250 µs ÷ 1 ms × 100 = 25 %
  2. V_avg = 0 + 0.25 × (12 − 0) = 3 V
  3. V_rms = √(D·V_high² + (1 − D)·V_low²) = 6 V

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

  1. Choose what you know: pulse width and period, pulse width and frequency, or on and off times.
  2. Pick the time unit used for the pulse width, period or off time.
  3. Enter the values. In frequency mode, choose Hz, kHz or MHz.
  4. Optionally enter the high level (e.g. 12 V) and the low level (usually 0 V).
  5. Read the duty cycle, the period, frequency and off time, and the average and RMS voltage.

The formula

With a pulse width (on time) tont_\text{on}, an off time tofft_\text{off}, a period TT and a frequency ff:

D=tonT×100 %T=1f=ton+toffD = \frac{t_\text{on}}{T} \times 100\,\% \qquad T = \frac{1}{f} = t_\text{on} + t_\text{off}

For a rectangular wave switching between VlowV_\text{low} and VhighV_\text{high}, with d=D/100d = D/100:

Vavg=Vlow+d (Vhigh−Vlow)Vrms=d Vhigh2+(1−d) Vlow2V_\text{avg} = V_\text{low} + d\,(V_\text{high} - V_\text{low}) \qquad V_\text{rms} = \sqrt{d\,V_\text{high}^2 + (1 - d)\,V_\text{low}^2}

With a 0 V low level these become Vavg=d VhighV_\text{avg} = d\,V_\text{high} and Vrms=d VhighV_\text{rms} = \sqrt{d}\,V_\text{high}. The ratio dd 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: T=1/20 000=50T = 1 / 20\,000 = 50 µs, so the off time is 20 µs
  • Duty cycle: D=30/50×100=60D = 30 / 50 \times 100 = 60 %
  • Average voltage: 0.6×12=7.20.6 \times 12 = 7.2 V; RMS voltage: 0.6×12=9.3\sqrt{0.6} \times 12 = 9.3 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 D=50 %D = 50\,\%.

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

Last updated:

More Physics calculators

People also use