Duty Cycle Calculator

Duty Cycle Calculator

Calculate duty cycle percentage and frequency from pulse width and period.Both pulse width and period must be in milliseconds.Essential for PWM signals, servo control, and power electronics.

Last updated: March 2026 | By Patchworkr Team

PWM Signal Parameters

Time the signal is HIGH (in milliseconds)

Complete cycle time (HIGH + LOW)

What is Duty Cycle?

Duty cycle is the percentage of time that a signal is in the "on" or "high" state during one complete period. It's expressed as a percentage from 0% (always off) to 100% (always on). For example, a 25% duty cycle means the signal is HIGH for 25% of the time and LOW for 75% of the time.

Duty cycle is fundamental in Pulse Width Modulation (PWM), which is used extensively in electronics for motor speed control, LED dimming, servo positioning, power regulation, and digital-to-analog conversion. By varying the duty cycle, you can effectively control the average power delivered to a device.

The frequency (measured in Hertz) tells you how many complete on-off cycles occur per second. The relationship is: Frequency = 1 / Period. Higher frequencies are used for smoother motor control and reduced flicker in LED applications, while lower frequencies might be used for heating elements or other applications where switching speed is less critical.

The Formulas

Duty Cycle Calculation

Duty Cycle = (Pulse Width / Period) × 100
Where:
• Pulse Width = time signal is HIGH (ms)
• Period = total cycle time (ms)
• Result is expressed as a percentage (0-100%)

Frequency Calculation

Frequency = 1 / (Period in seconds)
Where:
• Period must be converted from ms to seconds
• Frequency is measured in Hertz (Hz)
• 1 Hz = 1 cycle per second

Example Calculation

PWM signal: 5ms pulse width, 20ms period:

Given:
Pulse Width: 5 ms
Period: 20 ms
Step 1:
Calculate duty cycle:
Duty Cycle = (5 / 20) × 100
= 0.25 × 100
= 25%
Step 2:
Calculate frequency:
Period in seconds = 20 ms / 1000 = 0.02 s
Frequency = 1 / 0.02
= 50 Hz
Result:
Duty Cycle: 25%
Frequency: 50 Hz
This is typical for hobby servo control (1-2ms pulse, 20ms period)

Frequently Asked Questions

What's the difference between duty cycle and frequency?

Duty cycle is the percentage of time the signal is HIGH (0-100%). Frequency is how many complete cycles occur per second (Hz). They're independent - you can have any duty cycle at any frequency.

What duty cycle is best for LED dimming?

50% duty cycle = 50% brightness. Higher frequency (>100 Hz) prevents visible flicker. Most LED controllers use 500 Hz to 20 kHz for smooth, flicker-free dimming across the full range.

How does duty cycle control motor speed?

Higher duty cycle = more average power = faster motor. 50% duty cycle delivers 50% of maximum power. PWM frequency should be above motor's mechanical response (typically 1-20 kHz) to avoid vibration.

What's the duty cycle range for servo control?

Standard servos use 1-2ms pulses in a 20ms period (5-10% duty cycle). 1ms = 0°, 1.5ms = 90°, 2ms = 180°. The 20ms period (50 Hz) is the standard servo refresh rate.

Can duty cycle be greater than 100%?

No, duty cycle cannot exceed 100% by definition. If pulse width equals or exceeds the period, the signal is constantly HIGH (100% duty cycle). Pulse width must be ≤ period.

What frequency should I use for PWM?

LEDs: 100-20,000 Hz. Motors: 1-20 kHz. Servos: 50 Hz. Heating: 1-10 Hz. Higher frequencies reduce audible noise and electromagnetic interference but may increase switching losses in power electronics.

Does duty cycle affect voltage?

Duty cycle affects average voltage. A 5V signal at 50% duty cycle delivers an average of 2.5V. However, the peak voltage remains 5V - only the time-averaged power changes.

What's the 'dead time' in PWM?

Dead time is a brief period when both high and low-side switches are off to prevent shoot-through in H-bridges and inverters. It's separate from duty cycle calculations but reduces effective duty cycle slightly.

Related Tools