Skip to content

PWM Duty Cycle Calculator

Calculate PWM duty cycle, frequency, average voltage, off-time, and RMS voltage from on-time and period parameters

Ideal rectangular pulse train · V_avg = D·V, V_rms = √D·VAPI slug pwm-duty-cycle

Sign in to saveSave

Inputs

Example
Duration the signal is high in each period

1 ns or more

Total period of the PWM signal

1 ns or more

High-level voltage of the PWM signal

100 mV or more

The clock the PWM timer counts, which sets the step of the on-time and the period

1 kHz to 1 GHz

The duty resolution the design needs: 8 bits is 256 steps
bits

1 to 32 bits

Duty ResolutionCHECK
7.32bits
at least 8 bits
Duty as Set
50.00%
Frequency as Set
100kHz
Period in Timer Ticks
160
On-Time in Timer Ticks
80

Three periods from the timer

PWMt_ont_offt_ont_offt_ont_offCNTt_on 5 µsT 10 µs0 s5 µs10 µs15 µs20 µs25 µs

Standard values of Period

Select a row to use it
PeriodFrequencyPeriod in Timer TicksDuty ResolutionStatus
1kHz16 00013.97bitsPASS
2kHz8 00012.97bitsPASS
5kHz3 20011.64bitsPASS
10kHz1 60010.64bitsPASS
20kHz8009.64bitsPASS
25kHz6409.32bitsPASS
50kHz3208.32bitsPASS
100kHz1607.32bitsCHECK
200kHz806.32bitsCHECK
Duty CycleD
50.0%PASS
Frequencyf
100kHz
Average VoltageVavg
1.65V
Off Timetoff
5µs
RMS VoltageVrms
2.333V

Formula

D=ton/T×100%,Vavg=Vcc×D,Vrms=Vcc×√DD = t_{on} / T × 100\%,\quad V_{avg} = V_{cc} × D,\quad V_{rms} = V_{cc} × √D
SymbolQuantityYour value
DDuty cycle (%)50.0 %
tonOn time (μs)5 µs
TPeriod (μs)10 µs
VccSupply voltage (V)3.3 V
VavgAverage voltage (V)1.65 V
VrmsRMS voltage (V)2.333 V

Assumptions

5 items
  1. 01The output is an ideal rectangular pulse train: D = t_on/T, V_avg = D·V and V_rms = √D·V; an on-time longer than the period is taken as the whole period.
  2. 02As a timer makes it: the period is N = T × f_tim whole ticks (the auto-reload value + 1) and the on-time M = t_on × f_tim ticks (the compare value), each rounded to the nearest, a half up; the duty as set is M/N and the frequency f_tim/N.
  3. 03The duty resolution is log2 N bits, the steps one period offers the duty; the page passes it at or above the resolution you require (8 bits by default).
  4. 04Edge-aligned counting is assumed; centre-aligned counting halves the frequency for the same N. Rise and fall times, dead time and the load are not modelled.
  5. 05The drawing is three periods of the output beside the timer's counter ramping from 0 to N − 1.

Worked example

A 500 kHz converter from a 64 MHz timer

A controller drives a 500 kHz switching stage at 33.0 % duty from a timer clocked at 64 MHz. What duty does the timer really set, and how fine is its step?

StepExpressionResult
Period in ticks2 µs × 64 MHz128
On-time in ticks660 ns × 64 MHz42.24
Rounded to whole ticksround(42.24)42
Duty as set, against the 33.0 % asked for42 / 12832.81 %
Duty resolution, short of the 8 bits requiredlog2(128)7.00 bits
Duty step1 / 1280.78 %

How it works

The PWM duty cycle calculator determines on-time percentage, average voltage, and power delivery for pulse-width modulated signals — essential for motor speed control, LED dimming, and switching power converters. Embedded developers, motor control engineers, and power electronics designers use this tool to configure timer peripherals and optimize drive circuits. According to TI application note SPRAA88, PWM achieves near-lossless power control by switching fully on/off rather than linear regulation — a 50% duty cycle motor drive dissipates <2% of power in the MOSFET versus 50% in a linear regulator. The fundamental relationship Vavg = Vpp × D (where D = ton/T) provides average voltage seen by the load's mechanical or thermal inertia. Per Microchip AN964, PWM frequency must exceed load time constant by 10× minimum: motor mechanical time constant τ = J×R/K² (typically 10-100 ms) requires fsw > 1 kHz, while LED thermal time constant (~100 ms) allows 100+ Hz for flicker-free dimming. Resolution depends on timer clock and period: an 8-bit timer provides 256 steps (0.4% resolution), while 16-bit timers achieve 65,536 steps (<0.002% resolution).

Practical tips

  • Per Infineon motor control application note, use center-aligned PWM for reduced EMI — symmetric switching creates 2× effective switching frequency with half the current ripple compared to edge-aligned
  • Implement soft-start ramp (100-500 ms) to prevent mechanical shock and inrush current — linearly increase duty cycle from 0% to target over 10-50 PWM cycles
  • Add RC low-pass filter (fc = fsw/100) after PWM for analog voltage output applications — 25 kHz PWM with 2.5 kHz filter and 10 µF capacitor creates <1% ripple DC voltage

Common mistakes

  • Using PWM frequency below load bandwidth — a 100 Hz PWM on a motor with 20 ms time constant causes 15-20% speed variation per cycle; increase to 1+ kHz for smooth operation
  • Ignoring deadband at low duty cycles — gate driver propagation delay (10-50 ns) sets minimum effective on-time; at 1 MHz PWM, 50 ns minimum on-time limits resolution to 5% minimum duty cycle
  • Selecting audible PWM frequency (500 Hz - 15 kHz) for motor drives — electromagnetic acoustic noise from motor windings creates annoying whine; use <500 Hz or >18 kHz

Frequently asked questions

5 questions
What is a typical duty cycle range?

Per motor and LED driver conventions: 0-100% theoretically possible, but 5-95% practical due to driver limitations. At D < 5%, minimum on-time constraints dominate. At D > 95%, bootstrap capacitor recharge fails in high-side drivers. LED drivers (TI TPS92515) specify 1-100% dimming range with dedicated <1% low-brightness mode. Motor drives typically limit to 10-90% to prevent stall and ensure reliable commutation.

How does duty cycle affect power delivery?

Average power Pavg = Ppeak × D for resistive loads. For inductive loads (motors): power relationship is nonlinear due to back-EMF. At 50% duty cycle, a 12 V/1 A motor draws approximately 0.6 A average (not 0.5 A) due to continuous current mode in the inductance. Per TI DRV8870 datasheet, actual power delivery is Pavg = (Vbus - Vbemf) × Iavg × D + Vbemf × Iavg.

Can PWM be used for analog-like control?

Yes — PWM combined with low-pass filtering creates pseudo-analog output. Per Analog Devices MT-015, an N-bit PWM with fc = fsw/2^N filter achieves N-bit analog resolution. Example: 16-bit PWM at 100 kHz with 1.5 Hz filter creates 16-bit DAC (0.0015% resolution). Limitations: response time inversely proportional to resolution, and noise floor set by filter component tolerance.

What PWM frequency is best for LED dimming?

Per IEEE 1789 (flicker safety standard): >3 kHz eliminates visible flicker at any duty cycle, >100 Hz acceptable for >10% duty cycle. Human eye detection threshold varies with brightness — at 1% duty cycle, flicker visible up to 2 kHz. Professional video lighting requires >25 kHz to avoid rolling shutter artifacts. Standard LED drivers (TI TPS92200) operate at 200-1000 Hz with proprietary flicker-reduction algorithms.

How does PWM resolution affect control precision?

Resolution = 1/2^N for N-bit timer. Per STM32 application note AN4013: 8-bit = 0.39% steps (256 levels), 10-bit = 0.1% steps (1024 levels), 16-bit = 0.0015% steps (65536 levels). For motor speed control, 8-10 bits sufficient (1% speed accuracy). For precision LED dimming (1000:1 ratio), 10+ bits required. For audio DAC, 16-bit minimum. Higher resolution requires longer timer period or faster clock: 16-bit at 20 kHz needs 1.3 GHz clock or prescaler adjustment.

Shop Components

As an Amazon Associate we earn from qualifying purchases.

  • DC-DC Buck Converter ModulesAdjustable step-down converter modules for bench and prototype useAmazon →
  • LDO Voltage Regulator KitAssorted low-dropout linear regulators for prototypingAmazon →
  • Electrolytic Capacitor KitAluminum electrolytic capacitor kit for power supply filteringAmazon →
  • Power Inductor KitAssorted shielded power inductors for switching supply designsAmazon →