Skip to main content

PWM Duty Cycle Calculator — Period, On-Time and Average Voltage

Frequency + duty cycle to period, on-time, off-time and average voltage — reverse-solve duty from a measured pulse width — browser-only

  • Runs locally
  • Category Calculator
  • Best for Getting a realistic range before a purchase, plan, workout, or schedule decision.

Enter the PWM frequency and duty cycle to get the period, high-level on-time, low-level off-time and average output voltage. Switch to reverse mode to find the duty cycle from a measured on-time.

Quick presets
Result
Period (T)
1 ms
On-time (high)
500 µs
Off-time (low)
500 µs
Average voltage
2.5 V

Common applications: LED dimming, brushed DC motor speed control, and hobby-servo pulse timing.

What this tool does

A PWM duty cycle calculator for firmware, motor and LED work. Type the switching frequency in Hz or kHz and the duty cycle in percent, and the tool returns the period T = 1 divided by f, the high-level on-time t_on = T times duty, the low-level off-time t_off = T minus t_on, and the average output voltage Vavg = Vcc times duty. A 1 kHz signal at 50 percent duty has a 1 ms period, 500 microseconds high and 500 microseconds low, and a 2.5 V average off a 5 V rail. There is a reverse mode too: feed a measured on-time from a scope or logic analyzer plus the frequency, and it back-solves the duty cycle so you can verify what a timer register is actually producing. Every number copies in one click, and the link in your address bar reproduces the exact calculation when shared. The math runs entirely in your browser, nothing is uploaded, and there is no account.

Tool details

Input
Numbers
The page exposes text boxes, numeric controls, file pickers, or structured inputs depending on the tool.
Output
Live result + Copy
The result area focuses on usable output, with copy, download, or preview actions when supported.
Privacy
Browser-side processing
The main tool logic does not call an external API, so inputs normally stay in the current tab.
Save / share
Shareable URL state
Key settings are encoded in the URL so another person can reopen the same setup.
Performance budget
Initial JS <= 9 KB
No WASM budget is declared, keeping the tool quick to open on mobile.
Best fit
Calculator · Developer
Category and role tags drive related tools, internal links, and quick fit checks.

How to use

  1. 1. Input

    Paste or drop your content into the tool panel.

  2. 2. Process

    Click the button. All processing is local in your browser.

  3. 3. Copy / Download

    Copy the result or download to disk in one click.

How PWM Duty Cycle Calculator fits into your work

Use it for fast estimates, comparisons, and planning numbers before you make the final call.

Calculation jobs

  • Getting a realistic range before a purchase, plan, workout, or schedule decision.
  • Comparing scenarios by changing one input at a time.
  • Turning rough assumptions into a number you can discuss.

Calculation checks

  • Double-check units, dates, rates, and rounding assumptions.
  • Treat health, finance, tax, and legal outputs as planning aids, not professional advice.
  • Save the inputs that produced an important result so you can reproduce it later.

Good next steps

These links move the current task into a more complete workflow.

  1. 1 Ohm's Law Calculator Enter any two of voltage, current, resistance, or power — get the other two plus the formula used — with mV/V/kV, µA/mA/A, Ω/kΩ/MΩ, mW/W/kW prefixes — browser-only. Open
  2. 2 LED Resistor Calculator R =(Vs − n·Vf)/ If, with nearest E12/E24 value, resistor wattage and a dark-LED check, browser-only Open
  3. 3 555 Timer Calculator Astable f = 1.44/((R1+2R2)C) + monostable t = 1.1RC — pick R1, R2, C in Ω/kΩ and µF/nF, read frequency, duty cycle and pulse width — browser-only Open

Real-world use cases

  • Dim an LED smoothly from a microcontroller pin

    You want an LED at about 30 percent brightness off a 3.3 V GPIO. Set Vcc to 3.3 V, pick a flicker-free 1 kHz frequency, and dial the duty to 30 percent. The tool shows a 1 ms period, 300 microseconds on, 700 microseconds off, and a 0.99 V average. You translate that duty straight into the analogWrite or timer compare value and the LED sits at the brightness you wanted, no series-resistor guesswork for the dimming part.

  • Set a brushed DC motor's speed without audible whine

    A small fan motor runs rough and buzzes at 500 Hz. Bump the frequency to 20 kHz in the tool so the switching is above hearing, keep the duty at 60 percent, and read the 50 microsecond period with 30 microseconds on. The average voltage line tells you the motor sees roughly 60 percent of the supply, so you know how much headroom is left before full speed.

  • Verify a timer register against a scope reading

    Your firmware claims 40 percent duty but the scope shows a 360 microsecond high pulse at 1 kHz. Switch to reverse mode, enter 360 microseconds and 1 kHz, and the tool back-solves 36 percent. Now you know the prescaler or compare value is off by a notch and can fix the register instead of chasing a phantom load problem.

  • Work out a hobby servo pulse and its duty cycle

    A standard servo wants a 1.5 ms pulse every 20 ms for center. Set the frequency to 50 Hz (a 20 ms period) and use reverse mode with a 1.5 ms on-time to confirm the duty is 7.5 percent. That tiny duty range, roughly 5 to 10 percent, is why servo code thinks in microseconds of pulse width rather than a percentage knob.

Common pitfalls

  • Mixing up frequency and period. Frequency is cycles per second (Hz), period is seconds per cycle, and they are reciprocals. Typing 1000 in the period field when you meant 1 kHz frequency gives an answer a million times off. The tool labels the input as frequency and shows the period it derives.

  • Treating average voltage as the peak the load sees. Vavg = Vcc times duty is only the average. A fast load, or an LED viewed directly, sees the full Vcc pulses flicking on and off, not a smooth 2.5 V. The average is what a slow or filtered load responds to, so add a capacitor or pick a fast enough frequency.

  • Forgetting the servo exception. Hobby servos use a fixed ~50 Hz frame and read pulse width in milliseconds, not duty percentage. Setting a servo to 50 percent duty sends a 10 ms pulse and drives it hard against an end stop, so always think in on-time for servos, not duty.

Privacy

Every step — the reciprocal for the period, the multiply for on-time and off-time, the average-voltage product, and the reverse duty solve — is plain JavaScript running in your browser tab. No frequency, duty value or supply voltage is uploaded or logged. The one thing to know: the share link encodes your inputs in the URL query string, so a link pasted into chat will leave those numbers in the recipient server's access log. For a sensitive design, use the copy button and paste the result text instead.

FAQ

Tool combos

Folks in your role tend to reach for these alongside this tool.

Made by Toolora · 100% client-side · Updated 2026-05-30