PWM Frequency Calculator (timers)
PWM frequency, resolution bits and compare value from clock, prescaler and TOP — AVR, STM32 and ESP32 LEDC alike.
Frequency and resolution fight over the same equation: at 16 MHz you can have 8-bit PWM at 62.5 kHz OR 16-bit at 244 Hz, not both. Pick by load: motors above audible (>20 kHz) or well below (~500 Hz), LEDs anything >200 Hz (no flicker), servos exactly 50 Hz with 1–2 ms pulses, buck converters as high as switching losses allow.
PWM Frequency Calculator computes timer-PWM frequency, resolution and compare value from clock, prescaler and TOP — free, instant and private in your browser. Embedded developers driving motors, LEDs, servos and converters off hardware timers use it to skip the datasheet algebra: type your numbers, read the answer with the substituted formula shown step by step, and share an exact permalink of the calculation.
About PWM Frequency Calculator (timers)
PWM Frequency Calculator computes timer-PWM frequency, resolution and compare value from clock, prescaler and TOP using the standard engineering relation: f = f(clk)/(N·(TOP+1)); resolution = log₂(TOP+1) bits. Worked live: 16 MHz ÷ 8 ÷ 256 = 7.8 kHz at 8-bit resolution; 75 % duty = compare value 191. The result recalculates on every keystroke, the worked-example panel shows your numbers substituted into the formula, and the Copy permalink button encodes the inputs in the URL so a colleague opens exactly your calculation. Everything runs client-side — nothing you type leaves your device.
How to use PWM Frequency Calculator (timers)
- 1Enter your values — the tool starts with realistic defaults for this exact use case, so the worked example is meaningful immediately.
- 2Read the live result and the worked-example panel, which substitutes your numbers into the formula step by step.
- 3Adjust any input to compare scenarios, then use Copy result or Copy permalink to share the calculation.
Why use PWM Frequency Calculator (timers)?
- ✓Implements the real formula — f = f(clk)/(N·(TOP+1)) — with the substitution shown, not a black box
- ✓Built for embedded developers driving motors, LEDs, servos and converters off hardware timers
- ✓Copy result and permalink buttons — share the exact calculation in a README, forum answer or design review
- ✓100% free, no sign-up, runs entirely in your browser (works offline once loaded)
Frequently asked questions
How do you calculate pwm frequency?+
Timer-PWM frequency, resolution and compare value from clock, prescaler and TOP follows f = f(clk)/(N·(TOP+1)); resolution = log₂(TOP+1) bits. For example, 16 MHz ÷ 8 ÷ 256 = 7.8 kHz at 8-bit resolution; 75 % duty = compare value 191. The calculator applies the same relation and shows the substituted arithmetic so you can verify every step.
What PWM frequency suits each kind of load?+
LEDs: anything over ~200 Hz kills visible flicker (1 kHz+ for cameras). Motors: above 20 kHz to silence whine, or low hundreds of Hz with a chunky driver. Servos: exactly 50 Hz frames with 1–2 ms pulses. Converters: as high as switching losses allow, typically 100 kHz–2 MHz.
Why can't I have both high frequency and high resolution?+
They share one budget: f × steps = f(clk)/N. A 16 MHz timer offers 8-bit resolution at 62.5 kHz OR 16-bit at 244 Hz — never both. When the combination matters (LED dimming without whine), pick MCUs with high-frequency peripheral clocks or dedicated LED PWM blocks.
Is the PWM Frequency Calculator free and private?+
Yes — completely free with no sign-up or usage limits, and it runs entirely in your browser: the values you enter are never uploaded or stored on a server.
Related Electronics tools
PCB Trace Width Calculator (IPC-2221)
Minimum trace width for your current and temperature rise — IPC-2221 formula with copper weight, layer choice and a step-by-step worked example.
● LiveMicrostrip Impedance Calculator
Z₀ of a surface microstrip from width, height and εr (IPC-2141A), plus effective dielectric constant and propagation delay.
● LiveStripline Impedance Calculator
Characteristic impedance of an embedded stripline trace from geometry and εr — the inner-layer companion to the microstrip tool.
● Live