PWM Duty Cycle Calculator

Compute the on-time, off-time and period for a PWM signal.

Formula

T = 1 / f, Ton = T × duty%

Inputs

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

  1. Enter the PWM frequency.
  2. Enter the duty cycle in %.
  3. 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:

The calculator gives:

Tips and common mistakes

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.

All engineering calculators