# Servo pulse width and PWM duty calculator

> Convert a servo angle to pulse width in microseconds and PWM duty cycle at 50 Hz, with a worked example.

Canonical: https://roboticsengineering.in/servo-pulse-width-pwm-calculator/ | Published: 2026-11-03 | Updated: 2026-11-03

**A hobby servo reads a 50 Hz pulse; the pulse width sets the angle.** Enter the pulse range of your servo and the angle you want.

Pulse at minimum angle (us)Pulse at maximum angle (us)Angle range (degrees)Target angle (degrees)PWM frequency (Hz)PWM resolution (bits)

Pulse width: **–** usDuty cycle: **–** %Duty count: **–**

Ranges differ between servos. Test the limits slowly, because a servo pushed past its stop draws high current.

## How it is calculated

Pulse width = minimum pulse + (maximum pulse − minimum pulse) × angle ÷ angle range. Period = 1,000,000 ÷ frequency in microseconds. Duty cycle = pulse width ÷ period. Duty count = duty cycle × (2 to the power of bits − 1).

## A worked example

With a 500 to 2400 us range over 180 degrees, 90 degrees gives 500 + 1900 × 90 ÷ 180 = 1,450 us. At 50 Hz the period is 20,000 us, so the duty cycle is 1,450 ÷ 20,000 = 7.25%. With 16 bits that is a count of about 4,751.

## Common mistakes

- Assuming every servo uses exactly 1000 to 2000 us.
- Using the 3.3 V pin to power the servo instead of a separate 5 V supply.
- Driving the servo to its mechanical limit and stalling it.

## Related

[servo torque calculator](https://roboticsengineering.in/servo-torque-calculator/), [servo not moving on ESP32](https://roboticsengineering.in/fix/servo-does-not-move-esp32/), [servo jitter](https://roboticsengineering.in/fix/arduino-servo-jitter-twitching/).

Last reviewed: November 2026. The calculator runs in your browser and sends nothing anywhere. Results are ideal-case figures; add margin before you order parts.
