Duty Cycle Calculator

Duty Cycle Calculator
D = ton/T × 100%
Vavg = D × Vpk
Vrms = Vpk × √D
Duty Cycle from Pulse Width & Period
ton ON Time (Pulse Width)
T Total Period
V Peak Voltage (optional)
Enter pulse width and period
Duty Cycle Results
Duty Cycle
%
Frequency
Hz
ton / toff
 
Vavg
V
Vrms
V
Pavg (into R)
 
PWM Duty Cycle Vavg ton T (period) Vpk

Figure 1: Duty cycle D = ton/T. The average voltage equals D × Vpeak. Higher duty cycle = higher average output. 50% duty gives half the peak voltage.

Table of Contents
Fundamentals
  1. What Is Duty Cycle?
  2. The Formulas
Mode Guides
  1. Mode 1 — Forward (Find Duty Cycle)
  2. Mode 2 — Reverse (Find Pulse Width)
Deep Dive
  1. Average Voltage vs RMS Voltage
  2. Common PWM Applications
Reference
  1. Frequently Asked Questions
  2. Related Calculators

What Is Duty Cycle?

Duty cycle is the percentage of one complete cycle that a signal is ON (high). A 50% duty cycle means the signal is high for half the period and low for the other half. It is the fundamental control parameter behind PWM (pulse width modulation) — changing the duty cycle changes the effective voltage and power delivered to a load without any analogue conversion.

The calculator above has two modes. Mode 1 (forward) finds the duty cycle from ON time and period. Mode 2 (reverse) finds the required pulse width from a target duty cycle and period. Both modes show a real-time canvas waveform of the PWM signal with an average voltage line. The PWM Frequency Calculator complements this by calculating period, resolution, and timer prescaler settings.

The Formulas

Duty cycle: D = (ton / T) × 100%
Frequency: f = 1 / T
OFF time: toff = T − ton
Average voltage: Vavg = D × Vpeak — DC equivalent
RMS voltage: Vrms = Vpeak × √D — heating equivalent
Average power: Pavg = D × Ppeak

Mode 1 — Forward: Find Duty Cycle

Enter ON time (ton) and period (T) in ms, µs, or seconds. Optionally enter peak voltage for Vavg and Vrms calculations. The canvas waveform draws 3 complete PWM cycles at the calculated duty cycle with a dashed average voltage line.

Example: LED Dimming (10% at 5 V)

Given: ton = 1 ms, T = 10 ms, Vpeak = 5 V

D = 1/10 × 100 = 10%

f = 1/0.01 = 100 Hz

toff = 10 − 1 = 9 ms

Vavg = 0.10 × 5 = 0.5 V

Vrms = 5 × √0.10 = 5 × 0.316 = 1.58 V

The LED sees 5 V for 1 ms then 0 V for 9 ms every cycle. The average voltage of 0.5 V produces roughly 10% perceived brightness. At 100 Hz the flicker is fast enough to be invisible to the eye.

Example: Motor at Half Speed (50% at 12 V)

Given: ton = 5 ms, T = 10 ms, Vpeak = 12 V

D = 5/10 × 100 = 50%

f = 1/0.01 = 100 Hz

Vavg = 0.50 × 12 = 6 V

Vrms = 12 × √0.50 = 12 × 0.707 = 8.49 V

The motor sees an average of 6 V from a 12 V supply — approximately half speed. Vrms is 8.49 V, which is higher than Vavg because the squared waveform concentrates more energy in the ON pulses.

Example: Motor Drive at 25 kHz (Above Audible)

Given: ton = 20 µs, T = 40 µs

D = 20/40 × 100 = 50%

f = 1/40µs = 25 kHz

25 kHz is above the audible range (20 kHz). Motor drive PWM at this frequency eliminates the audible whine that lower frequencies produce. The calculator works without a voltage input — duty cycle and frequency are still computed. The Bandwidth Calculator can determine if the system bandwidth is sufficient to pass the 25 kHz switching edges cleanly.

Mode 2 — Reverse: Find Pulse Width

Enter desired duty cycle (%) and period. The calculator returns the required ON time: ton = D × T. All other outputs (frequency, voltages, waveform) are computed identically to forward mode.

Example: 30% Duty at 1 kHz

Given: D = 30%, T = 1 ms (1 kHz)

ton = 0.30 × 1 ms = 300 µs

toff = 1 − 0.3 = 700 µs

Set your microcontroller timer compare register to produce a 300 µs pulse every 1 ms.

Example: Servo Control (50 Hz, Centre Position)

Given: D = 7.5%, T = 20 ms (50 Hz)

ton = 0.075 × 20 ms = 1.5 ms

Standard hobby servos expect a 50 Hz signal. The pulse width encodes position: 1.0 ms = 0° (5% duty), 1.5 ms = 90° (7.5%), 2.0 ms = 180° (10%). The servo reads the pulse width, not the duty cycle percentage. The Signal Attenuation Calculator can check whether long servo cable runs degrade the pulse edges enough to cause jitter.

Average Voltage vs RMS Voltage

Vavg = D × Vpeak — the DC equivalent. This is what a capacitor-filtered output produces and what determines motor speed and LED brightness. 50% duty at 12 V gives 6 V average.

Vrms = Vpeak × √D — the heating equivalent. This determines I²R power dissipation in resistive loads. At 50% duty: Vrms = 12 × 0.707 = 8.49 V. Higher than Vavg because the squared waveform concentrates energy in the ON pulses.

For motors and LED dimming, Vavg is the relevant number — it sets speed or brightness. For heater control and resistive loads, Vrms determines the actual power delivered. At 50% duty, Vrms delivers 50% of peak power (not 25%), because power is proportional to V². The Decibel Calculator can express this power ratio in dB: 50% power = −3 dB.

Common PWM Applications

LED Dimming

Duty cycle directly controls perceived brightness. 10% ≈ dim. 50% ≈ half brightness. 100% = full on. PWM frequency should be above 200 Hz to avoid visible flicker — 1 kHz or higher for video-compatible applications to avoid banding on camera.

Motor Speed Control

Vavg = D × Vsupply sets the effective voltage to the motor. 50% duty on a 12 V supply gives approximately 6 V and half speed. The relationship is not perfectly linear due to motor back-EMF, but duty cycle remains the primary speed control parameter. PWM frequency above 20 kHz avoids audible motor whine.

Switching Power Supplies

The converter adjusts duty cycle to regulate output voltage. In a buck converter: Vout = D × Vin. At 50% duty from 12 V input, Vout = 6 V. The feedback loop continuously adjusts D to hold Vout constant as the load changes.

Servo Control

50 Hz (20 ms period). Pulse width 1.0–2.0 ms encodes position. The duty cycle is only 5–10%, but the servo reads absolute pulse width, not duty cycle. The calculator’s reverse mode is useful here: enter 7.5% at 20 ms to confirm the pulse width is 1.5 ms (centre position).

Heating Control

Slow PWM (seconds to minutes period) switches heaters on and off. A 2 kW heater at 40% duty delivers 800 W average. Vrms and Pavg from the calculator tell you the effective heating power. The Gain Calculator can help size a driver amplifier if the control signal needs boosting before reaching the heater relay.

Frequently Asked Questions

What is duty cycle?
The percentage of one complete cycle that the signal is ON (high). D = ton / T × 100%. A 50% duty cycle means the signal is high for half the period and low for the other half.
How does duty cycle affect average voltage?
Linearly. Vavg = D × Vpeak. 25% duty at 12 V = 3 V average. 75% duty at 12 V = 9 V average. This is why PWM is used for voltage control — changing the duty cycle changes the effective voltage without any analogue conversion.
Why is Vrms different from Vavg?
Vavg is the simple time-weighted mean. Vrms accounts for the fact that power is proportional to V². A 50% duty square wave has Vavg = 0.5 × Vpeak but Vrms = 0.707 × Vpeak. Vrms determines heating in resistive loads; Vavg determines motor speed and LED brightness.
What duty cycles do servos use?
Standard hobby servos: 1.0 ms to 2.0 ms pulse at 50 Hz (20 ms period). That is 5% to 10% duty cycle. 1.5 ms (7.5%) is centre. The servo reads the absolute pulse width, not the duty cycle percentage — so the 50 Hz frequency matters too.
Can duty cycle be exactly 0% or 100%?
0% means permanently OFF — no pulse at all. 100% means permanently ON — no OFF time. Both are valid but they are not PWM — they are DC states. Most microcontroller PWM peripherals can produce both extremes, though some have minimum pulse width constraints at the very edges.
What PWM frequency should I use?
LEDs: above 200 Hz (1 kHz+ for video). Motors: above 20 kHz to avoid audible whine. Servos: exactly 50 Hz. Switching supplies: 50 kHz–2 MHz. Higher frequency gives smoother output but requires faster switching components. The Noise Figure Calculator can analyse the noise implications if your PWM frequency creates interference in sensitive receiver circuits.

Browse all Electronics Calculators →

Last updated: March 2026