PWM Duty Cycle Calculator

Instantly compute duty cycle, frequency, t-on, t-off, period, average voltage, RMS voltage, and power for any PWM signal.

Ad placeholder (leaderboard)
Enjoying the tools? Go Pro for £4.99 (one-time) and remove all ads — forever, on this device. Remove ads — £4.99

Pulse Width Modulation (PWM) is the technique of switching a signal rapidly between fully ON and fully OFF to control the effective power delivered to a load. By varying the fraction of time the signal stays high — the duty cycle — you can dim LEDs, set motor speeds, regulate DC-DC converters, synthesize audio, and control servos, all without the losses that a linear regulator would introduce.

This calculator handles all three common starting-point scenarios: you know the frequency and duty cycle (typical when programming a microcontroller), you know the on-time and off-time (typical when reading a datasheet or oscilloscope), or you know the on-time and total period (typical in timer-register calculations). Switch between the three tabs, enter your numbers, and every derived quantity updates instantly.

How it works

Every PWM result flows from two fundamental quantities: the period T (the duration of one complete cycle) and t-on (how long the signal is high within that cycle).

Duty cycle: D = t-on / T

Frequency: f = 1 / T

t-off: T - t-on

For electrical quantities on a resistive load driven by a square wave switching between 0 and Vpeak:

  • Average voltage: Vavg = D * Vpeak
  • RMS voltage: Vrms = sqrt(D) * Vpeak
  • Average current: Iavg = D * Ipeak
  • RMS current: Irms = sqrt(D) * Ipeak
  • Average (and RMS) power: P = D * Vpeak * Ipeak

The distinction between average and RMS matters: average voltage is what a smoothing capacitor charges to; RMS voltage is what determines heat dissipation in a resistive element. For a pure square wave, average power and RMS power are identical for a resistive load — both equal D * Vpeak * Ipeak.

Worked example — Arduino LED dimming at 25%

An Arduino runs PWM at 980 Hz with a duty cycle of 25%. The LED forward voltage is 3.3 V and the series resistor limits peak current to 20 mA.

  1. Period: T = 1 / 980 = 1020.4 µs
  2. t-on: 0.25 * 1020.4 = 255.1 µs
  3. t-off: 0.75 * 1020.4 = 765.3 µs
  4. Average voltage across load: 0.25 * 3.3 = 0.825 V (but the LED itself is non-linear — use this as a guide)
  5. Average current (resistive model): 0.25 * 20 mA = 5 mA
  6. Average power: 0.25 * 3.3 * 0.02 = 16.5 mW

Enter 980 Hz + 25% in the calculator above to verify instantly.

Formula reference

QuantityFormula
Duty cycleD = t-on / T
PeriodT = t-on + t-off
Frequencyf = 1 / T
t-onD / f
t-off(1 - D) / f
Avg voltageD * Vpeak
RMS voltagesqrt(D) * Vpeak
Avg powerD * Vpeak * Ipeak

All calculations run entirely in your browser — no values are uploaded or stored anywhere.

Ad placeholder (rectangle)