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.
Frequently Asked Questions
Why PWM?
Efficient analog output from digital (switch fully on/off).
MCU resolution?
8-bit = 256 steps. 16-bit = 65,536.
Common Use Cases
LED Dim
Avg brightness ∝ duty.
Motor Speed
PWM drives H-bridge.
Last updated: