By · Updated

Spectrogram Generator

Audio Spectrogram Image From an MP3, Log or Linear Axis, Any Size

No ratings yet

OneTask is free, with no sign-up, and built by one person.
If this tool saved you time, a coffee helps keep new ones coming.

How the Spectrogram works

This spectrogram generator shows frequencies over time. Drop an audio file in, drag the handles to choose the region you want to see, and press Export to save a spectrogram: time runs left to right, frequency runs bottom to top, and brightness shows how much energy is at each point. The stats line tells you the frequency resolution, the time each pixel column covers and the axis range before you render. The whole thing is computed in your browser.

Spectrogram generator: what to know first

A waveform shows how loud a sound is at each moment; a spectrogram shows what it is made of. Every column of the image is one short slice of time, every row is one band of frequency, and the colour of each cell is the level in that band at that moment. Speech shows up as stacked harmonic bands that bend with the pitch of the voice, a kick drum as a bright flash at the bottom, hiss as an even wash across the top, and a lossy encoder as a hard ceiling where everything above 16 kHz has been thrown away.

How it is drawn. The selected region is mixed to mono and sliced into overlapping blocks of the chosen FFT size. Each block is shaped with a Hann window and transformed into a set of frequency bins, whose levels in decibels are mapped to a colour. There is exactly one block per pixel column, so the hop between blocks depends on the region length and the image width — the Image stat shows the resulting milliseconds per column. The image is built column by column with a progress bar, so a long file at a large size does not freeze the page.

FFT size sets the trade between frequency and time detail. A large FFT (8192) gives narrow bins — around 5 Hz at 44.1 kHz — so individual harmonics of a bass note are cleanly separated, but each block spans nearly 200 ms and transients smear sideways. A small FFT (512) pins a drum hit to within a few milliseconds but the bins are 86 Hz wide and the bass becomes a blur. 2048 is a good general choice; go up for tonal analysis and down for rhythmic material. The Resolution stat reports both figures for the current setting.

Frequency axis. Logarithmic spaces octaves evenly from 20 Hz up to the top frequency, which matches how pitch is heard and gives the bass region room to breathe; it is the right view for music and voice. Linear spaces hertz evenly, which squeezes everything below 1 kHz into the bottom strip but shows harmonic series as evenly spaced lines and makes the cut-off of a lossy encode obvious — the classic view for checking whether a "lossless" file was made from an MP3. Top frequency is clamped to half the file's sample rate, so a 44.1 kHz file cannot show more than 22.05 kHz whatever you enter.

Dynamic range is how many decibels below full scale the image reaches before it turns to the darkest colour. 90 dB shows almost everything down to the noise floor of a 16-bit file; a smaller range such as 60 dB throws away the quiet background and makes the loud structure stand out. If the picture looks washed out, reduce it; if quiet detail such as reverb tails or a faint hum is missing, increase it.

Colours. Heat runs black through red, orange and yellow to white, the familiar look from audio editors. Viridis is a perceptually uniform map from dark blue through green to yellow that reads correctly for colour-blind viewers and in greyscale print. Greyscale and Inverted grey (black marks on white) suit documents and forensic comparisons.

Axis labels overlay a grid of frequency lines — at octave-ish steps on the logarithmic axis, every few kilohertz on the linear one — and time marks at 1, 5, 10 or 30 second intervals depending on the region length, labelled in the file's own timeline. Turn them off for a clean image to place in a design.

Export writes a PNG named after the source file. The width and height you set are the pixel dimensions of the file, up to 8000 wide, so a whole album side can be rendered at a resolution where each column is a fraction of a second.

FAQ

Why does my "lossless" file have nothing above 16 kHz?

Because it was almost certainly made from a lossy source. MP3 and AAC encoders discard energy above a ceiling that depends on the bitrate — typically 16 kHz at 128 kbps and around 19–20 kHz at 320 kbps — and re-encoding to FLAC or WAV does not bring it back. On the linear axis the cut-off appears as a sharp horizontal edge.

The image is mostly dark. What should I change?

Reduce the dynamic range so the colour scale covers fewer decibels; 60 dB is a good second attempt. If the audio itself is very quiet, the problem is the file's level rather than the setting, and normalising it first will help.

Why do drum hits look like vertical smears?

Each block of the FFT covers a fixed span of time, and a transient shorter than the block is spread across the whole block. Use a smaller FFT size — 512 or 1024 — for percussive material.

Can I see the left and right channels separately?

No, the channels are mixed to mono before analysis. To compare them, use the Audio Channel Swapper to export each channel on its own and render the two files separately.

See also: all Audio tools, Images, Video & Screen, PDF, SVG, Simulations & Screensavers, Generative Art, Chart Makers, 3D Model Viewers, Drawing Pads, Mockups & 3D Making, Diagram Makers, 3D Science, Tracker Music.

Related tools