The basic idea: count cycles, divide by time
Frequency is the number of times something repeats each second. Every way of measuring it, however clever, comes down to one sum: frequency = cycles ÷ seconds. If a tap drips 30 times in 60 seconds, its frequency is 30 ÷ 60 = 0.5 Hz, one drip every two seconds. If a guitar string completes 110 vibrations in one second, it sounds at 110 Hz.
The unit is the hertz (Hz), one cycle per second. If you want a quick refresher on what a hertz is, and how kHz and MHz scale it up, start there.
The seven methods below differ only in how they count and how they time. Some count cycles directly over a fixed window. Some time a single cycle and turn the answer upside down. Some compare the unknown with a known reference, and some let a computer split a sound into all of its frequencies at once. Which one suits you depends on how fast the thing repeats, whether it is a motion, a sound or a voltage, and how precise you need to be. Every method also has a limit on precision, and that limit almost always gets better the longer you measure.
Method 1: Count cycles over a set time
The simplest method needs only your eyes and a clock. Pick a fixed time, count the complete cycles that happen in it, and divide. It works for anything slow enough to follow: a pendulum, a heartbeat, a blinking LED, waves arriving on a beach, or a slow fan with one blade marked.
Be careful at the start. Start the clock on a cycle and call that one zero, not one, or you will count one cycle too many. A child's swing that makes 17 full swings in 60 seconds has a frequency of 17 ÷ 60 = 0.28 Hz.
The weak point is that you can only count whole cycles, so the answer is uncertain by about one cycle. Over 10 seconds, a miscount of ±1 cycle is an error of ±0.1 Hz. Over 60 seconds the same miscount is only about ±0.017 Hz. That is the first rule of frequency measurement, and it applies to every method on this page: measuring for longer gives a finer answer.
Counting by eye stops working at around 5 to 10 cycles per second, because the events blur together. Anything faster needs a timer, an instrument or a microphone.
Method 2: Time one period and invert it
Instead of counting many cycles, you can time how long one cycle takes. That time is the period, T, and the frequency is its inverse: f = 1 ÷ T. A pendulum that takes 2 seconds per swing has a frequency of 1 ÷ 2 = 0.5 Hz.
Timing a single period by hand is risky, because your thumb on a stopwatch can easily be a tenth of a second or more off. The fix is to time 10 periods and divide by 10. The same 0.1 s timing error is then spread over ten cycles, so it shrinks to 0.01 s per period.
On an oscilloscope, the screen does the timing. Read how many divisions one cycle spans and multiply by the time per division. If one cycle covers 2.27 ms, the frequency is 1 ÷ 0.00227 s, about 440 Hz, the note A4. Measure across several cycles here too, for the same reason. Every wave has a period in time and a length in space, and this guide explains why waves have a period and a wavelength. To turn a timed period into hertz in one step, use the period to frequency calculator.
The Tap to measure tab in the lab above uses this method. Your taps mark the period, and the page inverts the median time between them. Taking the median rather than the average means one late or early tap hardly changes the result.
Method 3: A frequency counter or a multimeter's Hz mode
For electronic signals, a frequency counter is the standard tool. A basic counter opens a "gate" for a set time, counts how many times the input crosses a threshold while the gate is open, and divides by the gate time. The gate time sets the resolution: with a 1-second gate the display steps in 1 Hz, and with a 10-second gate it steps in 0.1 Hz. It is method 1, automated.
That simple scheme struggles with low frequencies. A 50 Hz signal on a 1-second gate gives just 50 counts, so the answer is only good to about 1 part in 50. Reciprocal counters solve this. They time the input's period against a fast internal clock, usually over many cycles, and then calculate 1 ÷ T. Their resolution is a fixed number of digits for a given gate time, whatever the input frequency, which makes them far better for low frequencies.
Every counter is only as good as its timebase, the quartz crystal oscillator inside it. A basic crystal is typically accurate to within a few parts per million, or a few tens in cheaper instruments, so a 10 MHz reading could be off by tens or even hundreds of hertz. Better counters use temperature-compensated or oven-controlled crystals.
Many digital multimeters also have a Hz setting. It is handy for checking a power supply, a signal generator or a sensor output, though a multimeter's frequency range and accuracy are more limited than a counter's.
Safety first with mains. Measuring the frequency at a wall socket means probing live mains voltage. Only do it with a multimeter rated CAT II or higher that has a Hz function, and only if you are trained to work near mains. Never improvise probes or open a device. If you just want to know whether your grid runs at 50 or 60 Hz, let a microphone listen instead: the Hum mode of the frequency checker reads it from a transformer or fridge with no wires at all.
Method 4: FFT spectrum analysis
Real sounds are rarely a single frequency. A voice, an engine or a humming room mixes many at once. The Fast Fourier Transform (FFT) deals with that. Software takes a short frame of samples from a microphone or a file, and the FFT splits it into a spectrum: a row of frequency "bins", each showing how much energy the sound has near that frequency. The peaks in the spectrum are the frequencies present.
The width of each bin is the sample rate divided by the FFT size. At 48,000 samples per second, a 32,768-point FFT has bins 48,000 ÷ 32,768 ≈ 1.46 Hz wide, while a 1,024-point FFT has bins about 46.9 Hz wide. The FFT resolution tab above lets you switch between them on the same tone.
A single steady tone can be located far more finely than one bin. Its energy spreads over a few neighboring bins in a predictable shape, so fitting a curve through the tallest bin and its two neighbors, called parabolic or quadratic interpolation, lands close to the true frequency. With a 32,768-point FFT on a clean tone, the estimate is usually within a few hundredths of a hertz.
Before the FFT, each frame is multiplied by a window, such as the Hann window, which fades the frame in and out. Without it, the abrupt edges of the frame smear energy across the whole spectrum, an effect called leakage, which can bury a quiet tone next to a loud one.
There is a catch: the FFT cannot be sharp in time and in frequency at once. As a rule of thumb, a frame lasting T seconds can only separate tones about 1 ÷ T hertz apart. A 0.5-second frame cannot tell apart two tones much closer than about 2 Hz, and the window widens that a little more. Longer frames give finer frequency detail but react more slowly when the sound changes. To try all of this on real sounds, open the live spectrum analyzer and watch the peaks of a voice or an instrument.
Method 5: Pitch detection for notes and voices
A spectrum shows every frequency, but a musician or singer usually wants one number: the note. That is the job of a pitch detector, and it is harder than it sounds. The strongest peak in a spectrum is not always the note. In many voices and instruments a harmonic at two or three times the fundamental is louder than the fundamental itself, so "pick the tallest peak" can be an octave or more wrong.
Pitch detectors look for repetition instead. Autocorrelation-style methods compare the signal with delayed copies of itself and find the delay at which it matches best. That delay is the period, and 1 ÷ period is the fundamental, even when the fundamental is weak. The frequency checker on our home page uses the McLeod Pitch Method, published by Philip McLeod and Geoff Wyvill in 2005. It measures this self-similarity in a normalized way and gives a clarity score between 0 and 1 that says how cleanly the sound repeats. A clear whistle scores close to 1. Noise, chords and breathy sounds score low, and a good tool hides low-clarity readings instead of showing a random number.
The classic failure is the octave error: reporting double or half the true pitch. A sound that repeats every period also repeats every two and three periods, so a detector could latch onto any of them. The McLeod method takes the first strong match that comes close to the best one, rather than simply the best, which favors the true period. Steady single notes give the most reliable readings. Chords and fast slides do not have one pitch to find.
Method 6: Compare against a known reference (beats)
You can measure a frequency with nothing more than a reference. Play a known tone, such as a 440 Hz tuning fork or a tone from an app, together with the unknown sound. If the two are close, you hear the loudness swell and fade in a slow wobble called beating. The number of beats per second equals the difference between the two frequencies.
So if a 440 Hz fork and a string beat 3 times a second, the string is at either 437 Hz or 443 Hz. To find out which, raise the unknown slightly, for example by tightening the string a little. If the beats slow down, it was below 440 Hz and is moving toward it. If they speed up, it was above. When the beats stop, the two match.
Beats are easiest to count between about 1 and 5 per second; faster than that, they blur into roughness. Count them for several seconds and divide, just as in method 1. That is exactly what the Count the beats tab asks you to do. Piano tuners have set intervals by counting beats for generations, and the method is precise: one beat in 10 seconds means the two tones are only 0.1 Hz apart.
Method 7: Strobes and motion sensors for spinning and shaking things
A strobe light measures rotation without touching anything. Point it at a fan or a spinning shaft and adjust its flash rate. When the flash rate equals the rotation rate, the part is lit in the same position on every turn and seems to stand still. Read the flash rate and you have the speed.
The part also appears frozen at a half, a third or any whole fraction of the true rate, because it then turns two or three times between flashes. So start with a high flash rate and come down: the first, highest rate that freezes a single clear image is the real one. Put a strip of tape on one blade, because a three-blade fan also looks frozen at three times its rotation rate. Strobes and tachometers often read in revolutions per minute; divide by 60 to get hertz, so 1,200 RPM is 20 Hz.
For vibration, a phone's motion sensors can help. Its accelerometer reports movement many times a second, usually about 60 to 100 times when read from a browser. A sensor that samples N times a second can only measure vibrations up to N ÷ 2 hertz, so a phone resting on a washing machine can catch the slow wobble of the drum but not the 100 Hz buzz of a motor.
Worked examples
A guitar's A string
Hold a phone or laptop microphone 20 to 30 cm from the guitar and pluck the open A string. A spectrum analyzer shows a row of peaks at about 110, 220, 330 and 440 Hz: the fundamental and its harmonics, evenly spaced 110 Hz apart. The spacing alone tells you the fundamental. A pitch detector does the same reasoning in one step and reports A2 at 110.0 Hz, or a few cents sharp or flat if the string is out of tune. Read just after the pluck settles: the first instant is noisy, and the tail end is too quiet.
Mains hum in a room
The hum from transformers, fridges and amplifiers is tied to the mains frequency. A transformer's core stretches and shrinks on both halves of every cycle, so it buzzes at twice the mains frequency. A spectrum with a strong peak at 100 Hz and a smaller one at 50 Hz therefore means a 50 Hz grid, and peaks at 120 Hz and 60 Hz mean a 60 Hz grid. Measure close to the source in a quiet room and give it ten seconds so the low peaks settle. Here is why some countries hum at 50 Hz and others at 60 Hz.
An engine at idle
An engine's sound is dominated by its firing rate. In a four-stroke engine each cylinder fires once every two revolutions, so a four-cylinder engine fires twice per revolution. At a 900 RPM idle it turns 900 ÷ 60 = 15 times a second and fires 15 × 2 = 30 times a second: a 30 Hz firing frequency. That puts the main note of an idling car deep in the bass, which is why a phone microphone often shows its harmonics at 60 and 90 Hz more strongly than the 30 Hz itself.
A screen's refresh rate
A screen's refresh rate is a frequency too, and a browser can measure it by counting. The page asks to draw a new frame before every refresh and counts how many frames arrive. If 240 frames are drawn in 2 seconds, the rate is 240 ÷ 2 = 120 Hz. This is method 1 again, with the browser doing the counting. The result is the rate the browser actually gets, which can be lower than the screen's maximum: battery saver modes often limit it, and some versions of Safari cap animation at 60 Hz.
How to get an accurate reading
- Measure for longer. Resolution is roughly 1 ÷ the measuring time. One second gives about 1 Hz, and ten seconds about 0.1 Hz.
- Avoid clipping. Keep the input level out of the red. A clipped signal grows false harmonics that can fool a pitch detector.
- Get close and get quiet. Hold the microphone near the source and switch off fans, TVs and other noise.
- Check you have the fundamental. If a reading is exactly double or half what you expect, you may be looking at a harmonic or an octave error. Look for evenly spaced peaks: their spacing is the fundamental.
- Know your device's limits. Many phone microphones pick up very low bass weakly, so readings below about 50 Hz are less reliable. Browsers record at 44.1 or 48 kHz, so nothing above 22 to 24 kHz can be measured at all.
- Know what a microphone cannot hear. Radio, Wi-Fi, mobile signals and electromagnetic fields are not sound. No microphone app can measure them, whatever it claims.
Finally, sanity-check the result against the typical frequencies of everyday sounds. If your fridge seems to hum at 3 kHz, something has gone wrong.
Which method should you use?
Match the method to the thing you are measuring. The resolutions below are typical, not guaranteed; they all improve with a longer measurement.
| Situation | Best method | Typical resolution |
|---|---|---|
| Slow motion you can see (pendulum, LED, swing) | Count cycles (1) or time 10 periods (2) | About 0.1 Hz over 10 s |
| Electronic signal | Frequency counter (3) or oscilloscope (2) | Counter: 1 Hz on a 1 s gate, finer with a reciprocal counter; scope: a few percent read by eye |
| Musical note or voice | Pitch detection (5) | A few cents on a steady note |
| Mixed sound, hum or machine noise | FFT spectrum (4) | About 1 ÷ frame length; finer for one clean peak |
| Tuning by ear | Beats against a reference (6) | 0.1 Hz or better with patience |
| Rotating part | Strobe (7) | As fine as the strobe's rate setting |
| Vibration | Phone motion sensor (7) | Only up to about half the sensor's sample rate |
Meet a word you don't know, such as FFT, harmonic or clipping? The sound and frequency glossary explains it in a sentence or two.
Sources
- Hewlett-Packard (now Keysight Technologies), Fundamentals of the Electronic Counters, Application Note 200. Gate time, resolution and reciprocal counting.
- F. J. Harris, "On the Use of Windows for Harmonic Analysis with the Discrete Fourier Transform", Proceedings of the IEEE, vol. 66, no. 1, 1978. Windows such as Hann and spectral leakage.
- J. O. Smith III, Spectral Audio Signal Processing, W3K Publishing, 2011, section "Quadratic Interpolation of Spectral Peaks" (Center for Computer Research in Music and Acoustics, Stanford University: ccrma.stanford.edu/~jos/sasp/).
- P. McLeod and G. Wyvill, "A Smarter Way to Find Pitch", Proceedings of the International Computer Music Conference (ICMC), 2005. The McLeod Pitch Method and its clarity measure.
Measuring frequency: FAQ
How do you measure frequency?
Count how many complete cycles happen in a known time and divide: frequency = cycles ÷ seconds. For slow events you can count by eye. For sound, a microphone and software do the counting, either by timing the period (f = 1 ÷ T) or by finding the strongest peak in a spectrum. Electronic signals are measured with a frequency counter, an oscilloscope or a multimeter with a Hz setting.
Can my phone measure the frequency of a sound?
Yes, for sounds its microphone can pick up. With a browser tool, a phone can measure steady tones from the low bass up to about 15 kHz to within a hertz or better. Very low bass is picked up weakly by many phone mics, and browsers stop at 22-24 kHz because they sample at 44.1 or 48 kHz. A microphone cannot measure radio, Wi-Fi or electromagnetic fields.
How long should I measure to get an accurate reading?
Resolution improves with time. As a rule of thumb, a measurement lasting T seconds can separate frequencies about 1 ÷ T hertz apart: one second gives about 1 Hz and ten seconds about 0.1 Hz. Software can pin down a single clean tone more finely by interpolating, but two close tones still need a longer listen to tell apart.
How do I measure mains frequency safely?
The safest way needs no wires: let a microphone hear the hum from a transformer, fridge or amplifier and read the peak at 50 or 60 Hz, or the buzz at 100 or 120 Hz. Measuring at a socket needs a multimeter rated CAT II or higher with a Hz function, used by someone trained to work near mains voltage. Never improvise probes or open devices.
What is the difference between a frequency counter and a spectrum analyzer?
A frequency counter gives one number: the rate of the strongest repeating signal, counted over a gate time. A spectrum analyzer shows every frequency present and how strong each one is, so you can see harmonics, hum and noise at once. Counters are more precise for one clean signal; spectrum analyzers are better for real-world sounds that mix many frequencies.