Stax

PWM Servo Calculator

Calculate PWM pulse width, duty cycle, and servo angle.

Servo range
Angle
90.0°
Pulse width
1500.0 µs
Duty cycle
7.500%
16-bit timer count
4,915
Pulse = minPulse + (angle − minAngle) / (maxAngle − minAngle) × (maxPulse − minPulse)
Period = 20000 µs (1/50 Hz)

Calculate servo PWM values for any microcontroller

Convert between angle, pulse width, and duty cycle for standard RC servos. The 16-bit timer count output is ready to use with STM32, Arduino, and ESP32 timers.

Frequently asked questions

What PWM frequency do servos use?
Standard RC servos use 50 Hz (20ms period) PWM. The pulse width from 500µs–2500µs maps to 0°–180°. Some digital servos support up to 333 Hz for faster response.
What is the standard servo pulse range?
Most hobby servos use 1000µs–2000µs (1ms–2ms) as the working range, with 1500µs as center (90°). Many servos actually accept 500µs–2500µs for extended range.
How do I calculate the 16-bit timer compare value?
For a 16-bit timer at 50 Hz: compare value = (pulse_µs / period_µs) × 65535. For example, 1500µs at 50 Hz = (1500/20000) × 65535 = 4915.

Related tools