Duty Cycle to Frequency Calculator & Formula
- Off-time
- ms
- Result
- Period
- ms
- Result
- Duty cycle
- 50 %
- You entered
This calculator converts a duty cycle percentage and a period (or frequency) into the on-time and off-time durations of a periodic signal. You enter the duty cycle (as a percentage) and either the frequency in hertz or the period in seconds, and you get back the on-time, off-time, and the equivalent frequency or period. The relationship is straightforward: duty cycle = on-time divided by the total period, and frequency is the reciprocal of the period.
Formula
The fundamental formulas used in this calculator are:
- Period (T) = 1 / Frequency (f), where T is in seconds and f is in hertz (Hz).
- On-time (t_on) = Duty Cycle (D) × Period (T), where D is expressed as a decimal (e.g., 50% = 0.5).
- Off-time (t_off) = (1 − D) × Period (T).
If you start with frequency instead of period, the on-time becomes D / f and the off-time becomes (1 − D) / f. The calculator uses these directly, converting the result to milliseconds for readability.
Worked Example
Using the default values from the calculator: duty cycle = 50%, frequency = 1000 Hz.
- Period = 1 / 1000 = 0.001 seconds = 1 millisecond.
- On-time = 0.50 × 1 ms = 0.5 ms.
- Off-time = (1 − 0.50) × 1 ms = 0.5 ms.
The calculator shows on-time = 0.500 ms, off-time = 0.500 ms, and period = 1.000 ms. This matches the expected result for a 50% duty cycle at 1 kHz.
What Duty Cycle Means in Practice
Duty cycle describes the fraction of one period during which a signal is active (high, on, or conducting). It is usually expressed as a percentage. For example, a 25% duty cycle means the signal is on for 25% of the time and off for 75%. Duty cycle is used in pulse-width modulation (PWM) to control power delivered to devices like LEDs, motors, and heaters. It also appears in audio signals, switching power supplies, and digital communications.
How to Choose the Right Input
You only need to provide the duty cycle and one of the two time parameters: frequency or period. If you know the frequency in hertz (cycles per second), enter it directly. If you know the period in seconds (time for one full cycle), you can convert it to frequency first (f = 1/T) and then use the calculator. The calculator assumes a simple repeating square wave or similar periodic signal; for more complex waveforms, the definition of “on” may vary.
Common Mistakes and How to Avoid Them
- Mixing up percentage and decimal: Always enter the duty cycle as a percentage (e.g., 50 for 50%), not as 0.5. The calculator handles the conversion internally.
- Forgetting to convert units: If you have the period in milliseconds, convert to seconds before using it in the formula. For example, 10 ms = 0.01 s.
- Confusing on-time with duty cycle: On-time is an absolute duration (e.g., 5 ms), while duty cycle is a ratio (e.g., 50%). They are not the same.
- Rounding too early: Keep intermediate values with full precision until the final result to avoid rounding errors.
Limits of the Formula
The formulas assume an ideal square wave with instantaneous transitions. In real circuits, rise and fall times are not zero, so the actual on-time may differ slightly from the calculated value. Also, the duty cycle is defined as the high time divided by the period; for active-low signals, you may need to invert the logic. The calculator works for any frequency, but extremely high frequencies (gigahertz) or very low frequencies (below 0.001 Hz) may be impractical to measure with typical equipment.
Frequently Asked Questions
What is the difference between duty cycle and frequency?
Frequency is the number of cycles per second (measured in hertz), while duty cycle is the fraction of each cycle that the signal is on. They are independent: you can have a 50% duty cycle at 1 Hz or at 1 MHz.
How do I convert duty cycle to on-time if I only know the period?
Multiply the duty cycle (as a decimal) by the period. For example, a 30% duty cycle with a 20 ms period gives an on-time of 0.30 × 20 ms = 6 ms.
Can I use this calculator for PWM signals?
Yes, this is exactly what PWM signals are. The on-time corresponds to the pulse width, and the off-time is the gap between pulses. The calculator helps you set the correct values for your application.
What is a good duty cycle for a motor?
There is no single “good” duty cycle; it depends on the motor and the desired speed or torque. A 50% duty cycle typically gives half speed for a DC motor, but you should always check the motor’s datasheet for safe operating limits.
Does the calculator work for negative duty cycles?
No, duty cycle is defined as a positive percentage between 0% and 100%. Negative values are not meaningful for a periodic signal.
Why does my oscilloscope show a different on-time than the calculator?
Real signals have finite rise and fall times, and the threshold for “on” may vary. The calculator gives the ideal value; your measurement will be close but may differ by a few nanoseconds or microseconds depending on the circuit.
Related
Formula used
in duty | Duty cycle | % | 50 | 0 in freq | Frequency | Hz | 1000 | 0 out on_time | On-time | ms | (duty / 100) * (1 / freq) * 1000 | 3 out off_time | Off-time | ms | (1 - duty / 100) * (1 / freq) * 1000 | 3 out period | Period | ms | (1 / freq) * 1000 | 3
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.