PWM Duty Cycle Calculator
Duty, ton, toff for a PWM signal.
How to Use
- Enter any two of ton, T, duty.
- Duty = ton / T · 100%.
Show Work
Formulas
History of Pulse-Width Modulation
PWM as a power control technique originated in the 1920s with thyratron-based DC motor drives but remained exotic until the MOSFET revolution of the late 1970s. Early PWM schemes used analog comparators with triangle-wave carriers (Bob Pease's LM311 circuits at National Semiconductor), producing servo and motor drives that outperformed linear regulators on efficiency.
The Intel 8048 (1976) and Motorola 6805 (1979) microcontrollers introduced hardware PWM as a first-class MCU feature — a timer/counter plus compare register that toggled an output pin without CPU involvement. This freed the CPU for control algorithms while the hardware generated precise waveforms at tens of kHz. Arduino's analogWrite() is a direct descendant: a single function call configures the AVR's 8-bit Timer for 8-bit PWM.
Modern high-resolution PWM reaches 12-16 bits (STM32's MCPWM, TI's HRPWM) with subharmonic positioning accuracy down to 150 ps per edge. This enables digitally-controlled switched-mode supplies with tight loop bandwidth and programmable dead-time — the core of modern GaN/SiC power electronics.
About This Calculator
Enter any two of on-time (ton), period (T), or duty cycle. The tool computes the third plus frequency (1/T). Duty = ton/T (either 0-1 ratio or 0-100%). toff = T − ton. Average voltage after a low-pass filter is Vcc × D, which is why PWM is used as a poor-man's DAC.
MCU resolution: 8-bit PWM gives 256 duty-cycle steps (0.39% resolution); 16-bit gives 65,536 steps (0.0015%). For PID control, 12 bits is usually plenty; for audio-quality PWM DACs you want 16-bit with sufficient over-sampling. Everything runs client-side; no values leave your browser.
About the PWM Duty Cycle Calculator
The PWM Duty Cycle Calculator is a free tool for electronics and circuit design. It runs right in your web browser, so there is nothing to download. Duty, ton, toff for a PWM signal.
How it works
Type your numbers into the boxes. The answer shows up right away — you do not have to press a button. If you change a number, the answer changes too. So you can try different numbers and watch what happens, or check an answer you worked out yourself. Just make sure each box has the right kind of number in it.
Want the deeper story? The Knowledge Base explains the ideas behind the tools in more detail.
Frequently Asked Questions
Why PWM?
Efficient analog output from digital (switch fully on/off).
MCU resolution?
8-bit = 256 steps. 16-bit = 65,536.
How do I use the PWM Duty Cycle Calculator?
Simply type your numbers and read the result, which refreshes the instant you change something. There is nothing to submit and nothing to wait for.
Is it free? Does it work without internet?
Yes to both. It is free with no sign-up, and once the page has loaded it keeps working even with no internet.
Where does my data go?
Nowhere — every calculation runs on your own device. Nothing you enter is uploaded, logged, or stored.
Common Use Cases
LED Dim
Avg brightness ∝ duty.
Motor Speed
PWM drives H-bridge.
Last updated: