EMBEDDED TOOL
PWM Duty Cycle Calculator
Convert between PWM frequency/duty cycle and raw on-time/off-time pulse widths.
Hover the chart to read exact timing.
Period
—
On-time / Off-time
—
Frequency / Duty cycle
—
About this tool
Convert between PWM frequency/duty cycle and the raw high/low pulse widths, in either direction — useful for setting up motor speed control, LED dimming, or servo signals where a datasheet or library gives you one form and your project needs the other.
Frequently asked questions
- What's the difference between frequency and duty cycle?
- Frequency is how many on/off cycles happen per second (Hz); duty cycle is the percentage of each cycle spent "on" — together they fully describe a PWM signal, and either can be derived from on-time and off-time directly.
- Why would I calculate from on-time and off-time instead?
- Many timer peripherals (like an MCU's compare/capture registers) are configured directly in time ticks rather than frequency and percentage, so it's often more natural to start from the raw pulse widths you're setting in code.
- Does duty cycle affect the average voltage of a PWM signal?
- Yes — for a signal switching between 0V and V, the average (DC-equivalent) voltage is roughly V × duty cycle, which is the whole principle behind using PWM for dimming and analog-like output from a digital pin.