The direct answer: to convert a time period in milliseconds (ms) to frequency in hertz (Hz), use the formula frequency (Hz) = 1000 / time (ms). For example, a 10 ms period equals 100 Hz, and a 2 ms period equals 500 Hz.
What the Formula Means
Frequency and period are two sides of the same coin. Frequency (f) measures how many cycles occur per second, and the period (T) is the time for one cycle. The relationship is:
f = 1 / T
When T is in seconds, f is in hertz. Since 1 second = 1000 milliseconds, you can rewrite the formula for time in milliseconds:
f (Hz) = 1000 / T (ms)
This works for any repeating signal: a clock, a sound wave, a PWM signal from a microcontroller, or a rotating shaft. The unit hertz (Hz) is simply cycles per second, named after physicist Heinrich Hertz.
Why Use Milliseconds Instead of Seconds?
Many real-world signals have periods much shorter than one second. For example, a 60 Hz power line has a period of about 16.67 ms. Audio frequencies range from 20 Hz to 20 kHz, with periods from 50 ms down to 0.05 ms. Microcontrollers and digital circuits often use delays or clock periods measured in milliseconds or microseconds, so it is natural to express the period in ms and convert to Hz for comparison.
Using milliseconds avoids unwieldy decimals. A 0.005 s period is easier to read as 5 ms, and the conversion gives 200 Hz directly.
How to Convert ms to Hz: Step-by-Step
- Write down the period in milliseconds (ms).
- Divide 1000 by that number.
- The result is the frequency in hertz (Hz).
For example, if a signal repeats every 20 ms:
1000 / 20 = 50 Hz
If the period is 0.5 ms (500 microseconds):
1000 / 0.5 = 2000 Hz (2 kHz)
You can also use the reciprocal directly: convert ms to seconds first (divide by 1000), then take 1 divided by that. Both methods give the same answer.
Common Conversions and Examples
- 1 ms → 1000 Hz (1 kHz)
- 2 ms → 500 Hz
- 5 ms → 200 Hz
- 10 ms → 100 Hz
- 16.67 ms → 60 Hz (standard AC power)
- 20 ms → 50 Hz (standard AC power in many regions)
- 50 ms → 20 Hz (low audio bass)
These values appear frequently in electronics, audio, and timing applications. For instance, a 10 ms LED blink rate is 100 Hz, which appears as a steady light to the human eye.
Common Mistakes and Misconceptions
The most common error is mixing up the direction: dividing time by 1000 instead of 1000 by time. That gives you a number that looks like a frequency but is actually the reciprocal in kHz or something else. Always check: a shorter period must yield a higher frequency.
Another misconception is that Hz and ms are directly comparable. They are not – one is a rate, the other a duration. You cannot say “5 ms is 200 Hz” without stating what repeats. The conversion assumes a periodic signal with a constant period.
Also, be careful with units: if your period is in microseconds, use 1,000,000 / time in µs to get Hz. If it is in seconds, use 1 / time. The 1000 factor only applies when the period is in milliseconds.
How to Choose the Right Unit
Use the unit that makes the numbers manageable. For periods between 1 ms and 1000 ms, milliseconds are convenient. For shorter periods (microseconds), use µs. For longer periods (seconds), use seconds. The conversion formula always follows the same reciprocal relationship, just with a different factor.
In practice, you might see a datasheet that says “period = 4 ms” and you need to know the frequency for a filter design. The conversion is immediate: 1000 / 4 = 250 Hz.
Alternatives and Related Conversions
If you have a frequency and need the period in ms, use the inverse: T (ms) = 1000 / f (Hz). For example, 50 Hz → 1000 / 50 = 20 ms.
For angular frequency (radians per second), use ω = 2πf. That is a different measure, but sometimes people confuse Hz with rad/s. One Hz equals 2π rad/s.
If you are working with a microcontroller and you set a delay of 10 ms, the frequency of that loop is 100 Hz. That is useful for timing tasks like blinking an LED or sampling a sensor.
Frequently Asked Questions
How many Hz is 1 ms?
1 ms is 1000 Hz (1 kHz). That means the signal repeats 1000 times per second.
How do I convert Hz to ms?
Use the formula: period in ms = 1000 / frequency in Hz. For example, 250 Hz → 1000 / 250 = 4 ms.
Is 60 Hz equal to 16.67 ms?
Yes. 1000 / 60 = 16.666... ms. This is the period of standard AC power in North America and many other regions.
What is the difference between ms and Hz?
Milliseconds (ms) measure time duration, while hertz (Hz) measure frequency (cycles per second). They are reciprocals of each other for a periodic signal.
Can I use this conversion for audio signals?
Yes. For a tone with a period of 2 ms, the frequency is 500 Hz. Audio frequencies range from about 20 Hz (50 ms period) to 20 kHz (0.05 ms period).
What if I have a period in microseconds?
Use 1,000,000 divided by the period in microseconds to get Hz. For example, 100 µs → 10,000 Hz (10 kHz).