Electronics

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
  • Formula verified by automated tests
  • Private — runs on your device
Suggest an improvement
Calculator Free · Private
Want to change something?Edit any field and calculate again.
Instant resultIt recalculates in your browser, no page reload.
Fast and transparent

How to use this calculator

Follow this tool’s steps, then review its formula, assumptions, and limits below.

Step by step
01
Enter your data
02
Tap the Calculate button
03
Check the result
A servo PWM angle calculator converts a PWM (Pulse Width Modulation) pulse width — measured in milliseconds — into a physical rotation angle for hobby and industrial servo motors. The standard RC servo protocol uses a 50 Hz signal (20 ms period) where a pulse between 1.0 ms and 2.0 ms commands the servo horn from 0° to its maximum range (typically 90°, 180°, or 270°). The core formula is: Angle = (Pulse_ms − 1.0) × Range°. Use this calculator when writing microcontroller code (Arduino, Raspberry Pi), calibrating ESCs, debugging servo jitter, or mapping analog inputs to servo positions in robotics and RC projects.

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.

ServoTypePulse range (µs)Neutral (µs)Rated travelNotes
TowerPro SG90Analog micro 9g500–24001500~180°Native range is 500–2400 µs; 1000–2000 µs covers ~180° and is the safe RC convention
TowerPro MG90SAnalog metal-gear 13g1000–20001500~180°Same protocol as SG90, metal gears
TowerPro MG996RDigital metal-gear1000–20001500~120° actualOften labeled 180° but mech travel is ~120° (60° each direction) per datasheet
Hitec HS-422Analog standard900–21001500~180°Classic 1.0–2.0 ms ≈ 90° usable
Hitec HS-785HBAnalog winch (multi-turn)900–21001500±2.625 turns (~1890°)Drum/sail winch — NOT a 0–180° servo
Savöx SV-0320HV digital standard800–22001500120° (1000–2000)Extended ends 800/2200 reach full travel
Savöx SH-1290MGDigital high-speed800–22001520100° (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° Servo180° Servo270° ServoDuty Cycle
1.00010005.00%
1.125112511.25°22.5°33.75°5.63%
1.250125022.5°45°67.5°6.25%
1.375137533.75°67.5°101.25°6.88%
1.500150045°90°135°7.50%
1.625162556.25°112.5°168.75°8.13%
1.750175067.5°135°202.5°8.75%
1.875187578.75°157.5°236.25°9.38%
2.000200090°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:

  • Angle = (1.5 − 1.0) × 180° = 90° — dead center.

  • Duty cycle = 1.5 / 20 = 7.5%.

  • This is the calibration reference point before mounting the horn.
  • Case 2 — Extended-range servo (0.5–2.5 ms, 270° travel)
    A Hitec HS-785HB winch servo with extended endpoints:

  • 1.5 ms → ((1.5 − 0.5) / 2.0) × 270° = 135° (center) — NOT 90°.

  • Using the default 1.0–2.0 ms range on this servo only uses 135° of its 270° travel.
  • Case 3 — Arduino servo.write(angle) vs writeMicroseconds(µs)
    The Arduino Servo library maps write(45) on a 180° servo to ≈ 1250 µs:

  • Verify: Angle = ((1250 − 1000) / 1000) × 180° = 0.25 × 180° = 45° ✓.

  • For precision, always use 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 codeint 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

  • Ohm's Law Calculator — Size the current-limiting resistor or power supply for your servo driver circuit.

  • LED Resistor Calculator — Calculate the series resistor for indicator LEDs on your servo controller board.

  • Voltage Divider Calculator — Design level-shifter circuits between 5V microcontrollers and 3.3V servo controllers.

  • Worked example

    Pulse = 1.5 ms, range = 180°
    Angle = (1.5 − 1.0) × 180 = 0.5 × 180 = 90°
    % of range = (1.5 − 1.0) / 1.0 × 100 = 50%
    Result: servo sits at dead center
    Pulse 1.5 ms → 90° (center of a 180° servo). In Arduino: servo.writeMicroseconds(1500)

    Frequently asked questions

    What is the formula to convert servo PWM pulse width to angle?
    The standard formula is: Angle (°) = (Pulse_ms − 1.0) × Range°. For a 180° servo at standard endpoints (1.0–2.0 ms): 1.0 ms = 0°, 1.5 ms = 90°, 2.0 ms = 180°. In microseconds: Angle = ((Pulse_µs − 1000) / 1000) × Range°. Inverse (angle to pulse): Pulse_ms = 1.0 + (Angle / Range°).
    What is the standard PWM pulse range for RC servos?
    The universally accepted standard is 1.0 ms to 2.0 ms at a 50 Hz refresh rate (20 ms frame period), with 1.5 ms as the center/neutral position. This convention originated with Futaba and JR RC radio systems. Some manufacturers use a wider range of 0.5–2.5 ms for extended travel — always verify in the datasheet before sending pulses outside 1.0–2.0 ms.
    Why does the Arduino Servo library sometimes not reach the full 180°?
    The Arduino 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?
    Use the inverse formula: Pulse_ms = 1.0 + (Angle / Range°). Example: to command 60° on a 180° servo — Pulse = 1.0 + (60/180) = 1.0 + 0.333 = 1.333 ms (1333 µs). In Arduino code: 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?
    Both receive the same 1.0–2.0 ms PWM command signal. The difference is internal: analog servos read the pulse once per 20 ms frame; digital servos use an internal processor at 300–400 Hz, delivering faster response, higher holding torque, and less jitter. Digital servos can also accept command updates at up to 333 Hz. The angle formula is identical for both types.
    What happens if I send a pulse wider than 2.0 ms to a standard servo?
    The servo will attempt to rotate beyond its mechanical end-stop, stalling its DC motor against the physical limit. A stalled hobby servo typically draws 500 mA to over 1 A (vs. ~5–10 mA at no load), which can overheat motor windings, strip plastic gears, and burn the H-bridge driver IC within seconds. Never command a pulse outside the servo's rated range.
    Can I use this formula for continuous rotation servos?
    No. Continuous rotation (CR) servos have their internal feedback pot removed or bypassed, so the PWM pulse maps to speed and direction instead of angle: 1.5 ms = stop, 1.0 ms = full speed one direction, 2.0 ms = full speed the other. The angle formula is physically meaningless for CR servos.
    How accurate is the linear PWM-to-angle relationship in practice?
    The relationship is approximately linear across the middle 60–70% of travel but can show up to ±3–5° of non-linearity near the endpoints due to the potentiometer taper curve inside the servo's feedback mechanism. High-quality servos (Savöx, Hitec Karbonite) use linear-taper pots or contactless magnetic encoders to achieve ±1° linearity. For precision applications, calibrate the actual angle at 5+ reference pulses and build a lookup table.
    What oscilloscope settings should I use to verify my servo PWM signal?
    Set the time base to 5 ms/div (so the full 20 ms frame fits in ~4 divisions), trigger on rising edge, vertical scale to 3.3 V/div or 5 V/div. Use the cursors to measure the pulse width directly in µs — divide by 1000 to get ms, then apply the formula. A 1.5 ms pulse should appear as 1500 µs wide at logic HIGH, followed by 18.5 ms at logic LOW.

    Methodology & trust

    Editorial

    Electronics calculator with its formula verified automatically against Wikipedia – Servo control (RC servo PWM protocol), per our editorial policy and methodology.

    Updates

    Updated: July 2026. Parameters are verified periodically against the cited sources.

    Privacy

    Calculations run 100% in your browser. We do not store or transmit your data.

    Limitations

    Indicative results. For critical decisions, consult a professional.

    📌 How to cite this calculator

    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.

    ✉️ Report an error in this calculator