PWM Calculator (Duty Cycle, Frequency, Average Voltage)

Work out PWM settings for LEDs, motors and servos.

Use the tool

Why this tool exists

Enter frequency, duty cycle, supply voltage and optionally the timer clock and resolution. The page gives the period, on and off times, average voltage and RMS voltage, and a prescaler table showing the counts per period and the compare value for each prescaler, marking which fit in the counter.

Average voltage is what a filtered or resistive load sees; LEDs follow average current and motors follow the average. Audible-frequency PWM may produce noise.

No data is sent anywhere: the work happens in your browser, so you can use it offline once the page has loaded.

How to use it

  1. Enter frequency and duty cycle.
  2. Enter the timer clock and bit width if you want register values.
  3. Pick a prescaler that fits.
  4. Set the compare register to the shown value.

Frequently asked questions

What is duty cycle?

The percentage of each period that the signal is high.

Why does a prescaler matter?

It slows the timer so low frequencies fit into the counter width.

Is RMS different from average?

Yes: RMS matters for heating (resistive loads), average for DC-like loads.

Is my data sent anywhere?

No. Everything is processed in your browser, and the page makes no network requests with your input.