PWM Duty Cycle & Frequency Calculator
NEWPWM duty cycle calculator: convert frequency, period, on-time and duty %, get average voltage and AVR / Arduino timer prescaler and TOP settings.
Runs 100% in your browser — your input is never uploaded or stored on our servers.
= 1 kHz
= 5 V
T = 1 / f = 1 ms D = t_on / T = 250 µs / 1 ms = 25 % Vavg = D × V = 0.25 × 5 V = 1.25 V Vrms = √D × V = 2.5 V
= 16 MHz
Quick Examples
Typical inputs and the results this tool produces.
Overview
Pulse-width modulation switches a pin fully on and off at a fixed frequency; the share of each period spent high is the duty cycle. Motors, LEDs and heaters respond to the average, so 25 % duty on a 5 V pin acts roughly like 1.25 V into a resistive load.
This PWM duty cycle calculator converts between frequency, period, on-time, off-time and duty percentage, and shows the average and RMS voltage with a waveform. A timer helper applies the ATmega328P formulas — fast PWM f = clk / (N·(1 + TOP)) and phase-correct f = clk / (2·N·TOP) — to give frequency, duty resolution in bits and the compare register value, and finds the prescaler and TOP that hit a target frequency on an 8- or 16-bit timer.
It runs entirely in your browser. Use it for Arduino analogWrite tuning, motor drivers, LED dimming or any microcontroller timer setup; check your chip's datasheet for its own timer modes.
Why use this tool?
- Convert frequency, period and duty in one place
- Know the real average voltage at the load
- Pick prescaler and TOP without trial and error
- See how many duty steps your timer really has
- Private, free and instant
Features
Two-way conversion
Enter frequency or period plus duty % or on-time; everything else is derived.
Average and RMS voltage
Vavg = D·V and Vrms = √D·V for the supply you enter.
Timer helper
Clock, prescaler, TOP and mode give frequency, tick, bits and duty step.
Prescaler finder
Finds the highest-resolution prescaler / TOP for your target frequency.
Compare value
OCR value for the current duty cycle in fast or phase-correct mode.
Waveform
SVG of three periods with the average level marked.
How to Use
Set timing
Choose Frequency or Period and type a value such as 1k or 50u.
Set pulse width
Choose Duty % or On-time and enter it, plus the supply voltage.
Tune the timer
In the timer helper enter the clock, timer width, mode, prescaler and TOP.
Copy the result
Copy the timing summary or note the suggested prescaler, TOP and OCR.