PWM Duty Cycle Calculator
Calculate PWM frequency, period, duty cycle percentage, and on/off times. Works for Arduino analogWrite (8-bit), ESP32 LEDC (up to 16-bit), and servo pulse width calculations.
PWM Frequency & Duty Cycle
PWM (Pulse Width Modulation) rapidly switches an output on and off. The ratio of on-time to total period is the duty cycle. Higher frequency reduces flicker (LEDs) or ripple (power supplies). Higher duty cycle means brighter LED or higher motor speed. Calculate frequencies, periods, and PWM register values for Arduino, ESP32, and STM32.
Duty Cycle = (On-time / Period) × 100%
LED: 1 kHz–10 kHz · Motor: 5 kHz–20 kHz
0% = always off · 50% = half power · 100% = always on
Arduino: 8-bit · ESP32: up to 16-bit
Period
1000.00 μs
- On-time
- 500.00 μs
- Off-time
- 500.00 μs
- PWM value
- 128 / 255
More MCUs