Servo PWM Pulse Width to Angle Calculator
Convert any servo PWM pulse width (ms or µs) to exact rotation angle. Standard RC: 1 ms = 0°, 1.5 ms = 90°, 2 ms = 180°. Includes reference table for 90°, 180°, and 270° servos.
- Data verified · July 2026
- Edited by Martín Rodríguez
- Formula verified by automated tests
- Private — runs on your device
See step-by-step calculation
See this calculation step by step
See period-by-period detail
How to use this calculator
Follow this tool’s steps, then review its formula, assumptions, and limits below.
When to use this calculator
- Writing Arduino/Raspberry Pi firmware: converting a joystick ADC reading (0–1023) to a PWM pulse width and verifying the expected servo angle before deploying to hardware.
- Robotics arm calibration: confirming that each joint servo receives the correct pulse to reach a target angle (e.g., elbow at 45° requires 1.25 ms on a standard 180° servo).
- RC aircraft/drone setup: mapping aileron, elevator, and rudder trim values (expressed in μs) to exact control surface deflection angles to prevent over-travel damage.
- Pan-tilt camera gimbal programming: calculating pulse widths for both axes so the camera sweeps from −90° to +90° smoothly without hitting mechanical stops.
- Servo ESC calibration: verifying endpoint pulses (1.0 ms = full reverse, 1.5 ms = neutral, 2.0 ms = full forward) on a brushless motor electronic speed controller.
- 3D printer / CNC filament cutter: converting a G-code angle parameter into a servo pulse duration to cut filament at a precise angle.
- Educational electronics labs: teaching students the relationship between duty cycle, pulse width, and mechanical output in PWM-controlled actuators.
Real Servo Models — Pulse Width Range & Travel (from datasheets)
Actual PWM pulse ranges and mechanical travel for popular hobby/industrial servos.
| Servo | Type | Pulse range (µs) | Neutral (µs) | Rated travel | Notes |
|---|---|---|---|---|---|
| TowerPro SG90 | Analog micro 9g | 500–2400 | 1500 | ~180° | Native range is 500–2400 µs; 1000–2000 µs covers ~180° and is the safe RC convention |
| TowerPro MG90S | Analog metal-gear 13g | 1000–2000 | 1500 | ~180° | Same protocol as SG90, metal gears |
| TowerPro MG996R | Digital metal-gear | 1000–2000 | 1500 | ~120° actual | Often labeled 180° but mech travel is ~120° (60° each direction) per datasheet |
| Hitec HS-422 | Analog standard | 900–2100 | 1500 | ~180° | Classic 1.0–2.0 ms ≈ 90° usable |
| Hitec HS-785HB | Analog winch (multi-turn) | 900–2100 | 1500 | ±2.625 turns (~1890°) | Drum/sail winch — NOT a 0–180° servo |
| Savöx SV-0320 | HV digital standard | 800–2200 | 1500 | 120° (1000–2000) | Extended ends 800/2200 reach full travel |
| Savöx SH-1290MG | Digital high-speed | 800–2200 | 1520 | 100° (1000–2000) | Neutral is 1520 µs, not 1500 |
Verified against manufacturer datasheets. The TowerPro SG90 native pulse range is 500–2400 µs per its datasheet; the 1000–2000 µs RC convention is safe but does not represent the servo's full rated range. The MG996R mechanical travel is ~120° (60° each direction) per the official datasheet, despite being commonly marketed as 180°. Real travel for a given 1000–2000 µs sweep varies by model (100°–180°+) and some servos accept extended ranges. Always confirm the rated pulse range before sending pulses outside 1.0–2.0 ms — out-of-range pulses stall the motor against its end-stop and can strip gears within seconds. Sources: TowerPro MG996R / SG90 datasheets; Hitec HS-785HB spec sheet; Savöx SV-0320 / SH-1290MG product specs.
How it works
How to Convert Servo PWM Pulse Width to Angle
The standard RC servo protocol (defined by the original Futaba/JR convention and adopted universally) uses a fixed 50 Hz refresh rate (20 ms frame). The servo horn position is determined solely by the high-pulse duration within that frame.
// Core formula (ms)
Angle (°) = (Pulse_ms - 1.0) × Range°
// Equivalent in microseconds (used in Arduino's writeMicroseconds)
Angle (°) = ((Pulse_µs - 1000) / 1000) × Range°
// Inverse — angle to pulse width
Pulse_ms = 1.0 + (Angle / Range°)
Pulse_µs = 1000 + (Angle / Range°) × 1000
// Standard endpoints:
// Pulse_min = 1.0 ms (1000 µs) → 0°
// Pulse_mid = 1.5 ms (1500 µs) → Range° / 2 (center)
// Pulse_max = 2.0 ms (2000 µs) → Range°Duty cycle (derived value):
Duty_cycle (%) = (Pulse_ms / 20 ms) × 100
// At 1.5 ms: (1.5 / 20) × 100 = 7.5%---
Reference Table: PWM Pulse to Servo Angle
Standard pulse-to-angle mapping for 90°, 180°, and 270° servos (endpoints 1.0–2.0 ms):
| Pulse (ms) | Pulse (µs) | 90° Servo | 180° Servo | 270° Servo | Duty Cycle |
|---|---|---|---|---|---|
| 1.000 | 1000 | 0° | 0° | 0° | 5.00% |
| 1.125 | 1125 | 11.25° | 22.5° | 33.75° | 5.63% |
| 1.250 | 1250 | 22.5° | 45° | 67.5° | 6.25% |
| 1.375 | 1375 | 33.75° | 67.5° | 101.25° | 6.88% |
| 1.500 | 1500 | 45° | 90° | 135° | 7.50% |
| 1.625 | 1625 | 56.25° | 112.5° | 168.75° | 8.13% |
| 1.750 | 1750 | 67.5° | 135° | 202.5° | 8.75% |
| 1.875 | 1875 | 78.75° | 157.5° | 236.25° | 9.38% |
| 2.000 | 2000 | 90° | 180° | 270° | 10.00% |
> Note: Many digital premium servos (Hitec, Savöx) accept extended ranges of 0.5–2.5 ms. Sending pulses outside the rated range forces the servo against its mechanical stop — this can strip gears or burn the driver IC within seconds.
---
Typical Use Cases
Case 1 — Standard 180° servo at center (1.5 ms)
A Tower Pro MG996R commanded with servo.writeMicroseconds(1500) on Arduino:
Case 2 — Extended-range servo (0.5–2.5 ms, 270° travel)
A Hitec HS-785HB winch servo with extended endpoints:
Case 3 — Arduino servo.write(angle) vs writeMicroseconds(µs)
The Arduino Servo library maps write(45) on a 180° servo to ≈ 1250 µs:
servo.attach(pin, 1000, 2000) + writeMicroseconds() instead of write().---
Common Errors When Programming Servos
1. Confusing duty cycle % with pulse width ms — A 7.5% duty cycle at 50 Hz is 1.5 ms, but if someone programs a 7.5 ms pulse (37.5% duty), the servo receives a signal far outside its valid range.
2. Using the wrong frame period — RC servos operate at 50 Hz (20 ms frames). Some digital servos accept up to 333 Hz (3 ms frames). Mixing these periods causes the effective pulse width to be wrong.
3. Ignoring datasheet endpoint variations — Not all servos use 1.0–2.0 ms. Budget servos often clip at 1.1–1.9 ms, giving only 160° of a labeled "180°" servo.
4. Integer truncation in microcontroller code — int pulse = (angle / 180) * 1000 + 1000 with angle = 45 yields 0 in integer math → 1000 µs → 0° instead of 45°. Always cast to float first.
5. Forgetting the horn offset — Even at the mathematically correct pulse, a horn mounted off-center by one spline tooth introduces ±9–18° error (24-spline = 15° increments). The formula gives electrical angle, not mechanical angle.
---
Related Calculators
Worked example
Frequently asked questions
What is the formula to convert servo PWM pulse width to angle?
What is the standard PWM pulse range for RC servos?
Why does the Arduino Servo library sometimes not reach the full 180°?
Servo.write(angle) function maps 0–180° to approximately 544–2400 µs by default — not the strict 1000–2000 µs range. Fix this by using servo.attach(pin, 1000, 2000) to explicitly set min/max microseconds, or use servo.writeMicroseconds() directly with your calculated pulse for exact control.How do I calculate the pulse width for a specific angle?
int us = 1000 + (float(angle) / 180.0) * 1000; then servo.writeMicroseconds(us);What is the difference between an analog and a digital servo for PWM control?
What happens if I send a pulse wider than 2.0 ms to a standard servo?
Can I use this formula for continuous rotation servos?
How accurate is the linear PWM-to-angle relationship in practice?
What oscilloscope settings should I use to verify my servo PWM signal?
Sources & references
Methodology & trust
Electronics calculator with its formula verified automatically against Wikipedia – Servo control (RC servo PWM protocol), per our editorial policy and methodology.
Updated: July 2026. Parameters are verified periodically against the cited sources.
Calculations run 100% in your browser. We do not store or transmit your data.
Indicative results. For critical decisions, consult a professional.
Rodríguez, M. (2026). Servo PWM Pulse Width to Angle Calculator. Hacé Cuentas. https://hacecuentas.com/en/servo-pwm-angle
Content licensed under CC-BY 4.0 — reuse it citing the source with a link to Hacé Cuentas.