Spectrogram
Press Start and make a sound. You get a scrolling picture of its frequencies, with the loudest one named.
https://flxcode.com/spectrogram/
Press Start and allow the microphone. Nothing is recorded or uploaded.
- Chrome and Edge: click the icon left of the address bar, set Microphone to Allow, reload.
- Safari on Mac: Safari menu, Settings for This Website, Microphone: Allow. On iPhone: aA menu, Website Settings, Microphone.
- Firefox: click the permissions icon left of the address bar, remove the blocked Microphone entry, press Start again.
- Still blocked? The system privacy settings need to let the browser use the microphone too.
- Plug in or switch on a microphone or headset, then press Start again.
- In the system sound settings the input device must be enabled.
- Close apps that may hold it: video calls, recorders, other browser tabs.
- Unplug and replug a USB microphone, then press Start again.
Newest on the right.
Loudest: –
Cursor: move over the picture
No ads. No account. Nothing you record is uploaded. Check it. We count page events with a daily code.
Problem or idea? Email us
Quick start
- Press Start spectrogram and allow the microphone.
- Whistle, hum, talk or tap something. The picture scrolls from right to left.
- Read the line under the picture: the loudest frequency, its nearest note and its level.
- Move the pointer, or touch the picture, to read the frequency at any height.
- Press Freeze to hold what you see. The microphone stays open until you press Stop.
Numbers this uses
- Sample rate: the one your device gives the browser, usually 44.1 or 48 kHz. Examples here use 48 kHz.
- FFT sizes: 1024, 2048, 4096 (default), 8192 and 16384 samples, from the Web Audio AnalyserNode.
- Scroll speed: 50 columns a second, so a 600 pixel wide picture spans 12 seconds.
- Level range: floor −100 dB and ceiling −30 dB by default, in dB relative to full scale. Both are sliders.
- Averaging between frames: AnalyserNode smoothing 0.3.
- Log axis: starts at 20 Hz. Linear axis: starts at 0 Hz. The top is 2, 5, 10 or 20 kHz, capped at half the sample rate.
- Colour maps: Viridis, Magma and Grey, each 256 steps.
What common sounds look like
| Sound | Picture |
|---|---|
| Whistle | One clean line, usually between 1 and 4 kHz, with little above it. |
| Hummed or sung note | A line plus evenly stacked harmonics, wobbling slightly with vibrato. |
| Speech | Stacked harmonics that move, with bright bands (formants) that shift between vowels. S and sh sounds are noise above 4 kHz. |
| Clap, click, door slam | A short vertical stripe across all frequencies. |
| Mains hum | A thin line at 50 or 60 Hz with lines at its multiples. |
| Fan, air conditioner | A steady fog, brightest at low frequencies. |
| Whine from electronics | A thin, steady line high up, often 8 to 16 kHz. |
Worked examples
Resolution against time at 48 kHz. Bin width is the sample rate divided by the FFT size, and the window is the FFT size divided by the sample rate:
| FFT size | Bin width | Window |
|---|---|---|
| 1024 | 46.88 Hz | 21.3 ms |
| 2048 | 23.44 Hz | 42.7 ms |
| 4096 | 11.72 Hz | 85.3 ms |
| 8192 | 5.86 Hz | 170.7 ms |
| 16384 | 2.93 Hz | 341.3 ms |
Where a 1 kHz tone lands. It falls between bins unless the size divides evenly, so the readout interpolates between the loudest bin and its neighbours:
| FFT size | Bin number | Nearest bin centre |
|---|---|---|
| 1024 | 21.3 | 984.4 Hz |
| 2048 | 42.7 | 1.01 kHz |
| 4096 | 85.3 | 996.1 Hz |
| 8192 | 170.7 | 1 kHz |
| 16384 | 341.3 | 999 Hz |
The lines you see above an A2 (110 Hz) on a guitar or voice, with the note each one is closest to:
| Harmonic | Frequency | Nearest note |
|---|---|---|
| 1 | 110 Hz | A2 |
| 2 | 220 Hz | A3 |
| 3 | 330 Hz | E4 (+2 cents) |
| 4 | 440 Hz | A4 |
| 5 | 550 Hz | C#5 (−14 cents) |
| 6 | 660 Hz | E5 (+2 cents) |
| 8 | 880 Hz | A5 |
Where frequencies sit on a picture 260 rows tall with the top set to 10 kHz (row 0 is the top):
| Frequency | Row, log axis | Row, linear axis |
|---|---|---|
| 100 Hz | 192 | 256 |
| 1 kHz | 96 | 233 |
| 5 kHz | 29 | 129 |
On the log axis every doubling takes the same height. From 20 Hz to 10 kHz that is 9.0 octaves, about 29 rows each. On the linear axis the whole range below 1 kHz is squeezed into the bottom 26 rows.
How it works
The browser's AnalyserNode applies a Blackman window to the latest block of samples and takes an FFT. The page reads the level of each frequency bin in dB, maps every pixel row to a bin (interpolating between two), picks a colour from the level and draws one column on the right. The older picture moves left. Bin k sits at k × sample rate ÷ FFT size.
The loudest frequency is the biggest bin, refined with a parabola through it and its two neighbours, so it is finer than the bin width. The note is the nearest equal-tempered note with A4 = 440 Hz. This is a quick look, not a measurement instrument: the colour scale is relative to digital full scale, not to sound pressure. For a level in dB, use the decibel meter. To tune an instrument, use the online tuner.
Raw signal
The page asks the browser to switch off echo cancellation, noise suppression and auto gain. Those steps cut quiet detail and change levels, which would draw a different picture from the real sound. If your browser ignores the request, the line under the button says so.
FAQ
How do I read a spectrogram?
Time runs left to right with the newest sound on the right edge. Pitch runs from the bottom (low) to the top (high). Colour is loudness, dark for quiet and bright for loud. A steady note is a flat line, a rising note is a slope, a clap is a vertical stripe, and noise is a fog over a band of frequencies.
Why are there several lines above a single note?
Instruments and voices make a fundamental plus harmonics at 2, 3, 4 times its frequency. Those are the stacked lines. Their strength is what gives a violin, a flute and a voice different timbres, even on the same note.
What does the FFT size change?
A bigger FFT gives finer frequency detail but blurs fast changes in time. At 48 kHz, 1024 samples resolve about 47 Hz and cover 21 ms, while 16384 samples resolve about 3 Hz and cover 341 ms. Use 1024 or 2048 for clicks and speech, 8192 or more to separate close tones.
Log or linear axis, which one?
Log spaces each octave equally, so low notes get room and it matches how pitch sounds. Use it for music and speech. Linear spaces every hertz equally, so harmonics look evenly spaced, which helps when you look for a hum and its multiples or a whine at a fixed spacing.
Nothing shows up, or the picture is all dark. What now?
Make a sound first and check the right microphone is active in your system settings. If the picture is dark while you speak, lower the Floor slider, for example to −110 dB. If everything is bright, raise the Ceiling or move away from the microphone.
Why is the top of the picture empty?
The microphone or the sample rate sets the limit. At 48 kHz nothing above 24 kHz can exist, and many laptop microphones roll off well before that. Bluetooth headsets in call mode often cut at 4 or 8 kHz. Check the sample rate with the mic test.
I see a line at 50 or 60 Hz and its multiples. Is that my mic?
It is usually mains hum from a power adapter, a lamp or a bad ground. Hum at 50 or 60 Hz comes with harmonics at 100, 150, 200 Hz (or 120, 180, 240). Switch to the linear axis to see them evenly spaced. Compare with the 60 Hz tone.
Can I open an audio file or save the picture?
No. This page only listens to the microphone, shows the picture on screen and keeps nothing. Use Freeze to hold a moment, then take a screenshot with your system tool.
Is my audio uploaded?
No. The analysis runs in your browser and the picture lives in a canvas that is gone when you stop or leave. We count events like "started the spectrogram" with a daily code, never sound.
More from FLXCode
Decibel MeterNew
Estimate how loud a place is in dB, with A-weighting, min, average, max and Leq. Calibrate it against a known level.
Pitch DetectorNew
Sing, hum or play and see which note it is: note name, octave, frequency, a strip of recent notes and your range.
Online TunerNew
Tune a guitar, bass or ukulele from your browser, or find any note. Needle, cents and an A4 setting from 415 to 466 Hz.
Tone GeneratorNew
Play any frequency from 1 Hz to 22 kHz. Sine, square, triangle or sawtooth.