Make a Spectrogram From Audio
How to Make a Spectrogram From Audio
1
Add your file
Drop an audio file onto the page, or click to browse. WAV, MP3, M4A, OGG and FLAC all work, and nothing is uploaded.
2
Select the region
Drag across the waveform to choose the part you want to see. A short selection gives you detail; press Whole file to take in the entire recording at once.
3
Choose how it looks
Pick an aspect ratio — 1:1 for a square, 16:9 for a slide, 9:16 for a story — and one of ten colour palettes, or build your own ramp stop by stop and export it to a file you can keep or share. Any palette can be inverted, which is what you want for printing on white paper. Switch the frequency axis between logarithmic, which matches how you hear pitch, and linear, which matches how the maths works.
4
Turn the axes on or off
With them on you get a labelled grid, frequency and time markings and a decibel legend. With them off the spectrogram fills the whole frame with no chrome at all.
5
Export a PNG
Download at up to 4,096 pixels on the long edge. The aspect ratio you picked is the aspect ratio you get, axes or no axes.
What this is
A spectrogram is a picture of sound: time runs across the bottom, frequency up the side, and the colour at each point is how much energy sits at that pitch at that moment. It shows you things a waveform cannot — the mains hum sitting at 50 or 60 Hz, the harmonic stack that makes a voice sound like that voice, the shelf where an MP3 encoder threw the top octave away, a bird call you would never pick out by ear. Drop in a file, drag across the part you care about, and you get an image of it. Turn the axes on and it is an analysis tool with frequency and time labelled and a decibel scale beside it; turn them off and you get an edge-to-edge square you can print. Everything happens in your browser, so the file never leaves your machine.
How it works
This is a short-time Fourier transform, not a model. The selected region is mixed to mono, cut into overlapping windows, and each window is multiplied by a Hann taper and passed through a radix-2 fast Fourier transform — 1,024 to 8,192 points, depending on the Detail setting. That yields the energy in every frequency band for every instant, which is converted to decibels relative to the loudest point in the selection and mapped onto a colour ramp. The one genuine trade-off in the whole tool is the window length: a long window resolves pitch finely and time coarsely, a short one does the reverse, and no amount of processing gets you both at once. That is the uncertainty principle, not a limitation of the implementation, which is why the control is exposed rather than guessed at for you.
Credits
The research this tool runs on, credited in full — with BibTeX and licence notices — on the credits page.
- Nathaniel J. Smith and Stéfan van der Walt. 2015. A Better Default Colormap for Matplotlib. SciPy 2015. Viridis additionally credited to Eric Firing.Read the paper
Viridis, Magma, Inferno and Plasma
CC0-1.0 (public domain dedication) - Jamie R. Nuñez, Christopher R. Anderton, and Ryan S. Renslow. 2018. Optimizing colormaps with consideration for color vision deficiency to enable accurate interpretation of scientific data. PLOS ONE 13(7): e0199239.Read the paper
Cividis
CC0-1.0 (public domain dedication) - Anton Mikhailov, Google LLC. 2019. Turbo, An Improved Rainbow Colormap for Visualization. Published as a 256-entry sRGB lookup table.
Turbo
Apache-2.0 - D. A. Green. 2011. A colour scheme for the display of astronomical intensity images. Bulletin of the Astronomical Society of India, 39, 289.Read the paper
Cubehelix
Free to use, citation requested
Supported formats
WAV, MP3, M4A, AAC, OGG and FLAC. Files are decoded by your browser, so anything it can play will work here. The spectrogram is exported as a PNG image, at up to 4,096 pixels on the long edge.
Frequently asked questions
- Is my audio uploaded anywhere?
+−Is my audio uploaded anywhere?
No. Everything runs inside your browser using the Web Audio API, so the file never leaves your device. You can prove it: load the page, turn off your Wi-Fi, and the tool still works.- What is a spectrogram actually showing me?
+−What is a spectrogram actually showing me?
Three things at once. Horizontal position is time, vertical position is frequency, and colour is loudness at that frequency and moment. A steady tone shows up as a horizontal line, a drum hit as a vertical stripe across many frequencies, and a voice as a stack of evenly spaced horizontal lines — the fundamental at the bottom and its harmonics above it — that bend as the pitch moves.- Can I tell whether an MP3 was re-encoded from a lossy file?
+−Can I tell whether an MP3 was re-encoded from a lossy file?
Often, yes, and this is one of the most common reasons people reach for a spectrogram. Lossy encoders discard everything above a cutoff, which leaves a hard horizontal edge with nothing but black above it — typically around 16 kHz for a 128 kbps MP3 and 19 to 20 kHz at higher rates. A file claiming to be lossless that shows that shelf was transcoded from a lossy source at some point. Set the frequency axis to linear and the limit to Full range to see it most clearly, since a logarithmic axis compresses the top octave where the evidence is.- Should I use the logarithmic or linear frequency axis?
+−Should I use the logarithmic or linear frequency axis?
Logarithmic for anything musical or spoken, because it matches hearing: each octave takes the same vertical space, so harmonics are evenly stacked and low-frequency detail is not crushed into a sliver at the bottom. Linear for technical work — spotting an encoder cutoff, checking a sample rate, or looking at anything where the absolute spacing of frequencies matters more than the musical relationship between them.- What does the Detail setting change?
+−What does the Detail setting change?
The length of the analysis window, in samples. A 1,024-point window pins down when things happened and blurs what pitch they were, which suits drums and speech consonants. An 8,192-point window separates close harmonics cleanly but smears a snare hit across time. 2,048 is a reasonable default for most material, and it is worth trying two settings on the same selection to see the trade in action.- Which colour palette should I use?
+−Which colour palette should I use?
For reading a spectrogram, one of the perceptually uniform ones — Viridis, Magma, Inferno, Plasma or Cividis. They are built so that an equal step in decibels looks like an equal step in colour, which the classic rainbow palettes are not: a rainbow invents bright edges where the data is smooth, and people reliably see structure in them that is not there. Cividis goes furthest and is designed so a red-green colourblind viewer and a normal-vision viewer read the same image. Turbo is a rainbow rebuilt to avoid those false edges, so it is the one to reach for if you want the familiar high-detail look. Cubehelix rises steadily in brightness and is the safe choice if the image might end up printed or photocopied in greyscale. And if none of them suit, build your own ramp in the custom editor.- Can I make my own colour scheme and keep it?
+−Can I make my own colour scheme and keep it?
Yes. Choose the custom palette and you get an editor: name it, set between two and eight colour stops from quiet to loud, and the spectrogram redraws as you go. It is saved in your browser, so it is still there next time. Export writes it out as a small JSON file you can back up, move to another machine, or send to someone else, and Import reads that file back in — so a palette you spent time tuning is not tied to one browser profile. Import also accepts a plain list of hex colours, if you have a scheme from somewhere else you want to try.- What does inverting the palette do?
+−What does inverting the palette do?
It swaps which end of the colour ramp means loud. Normally quiet is dark and loud is bright, which suits a screen. Inverted, quiet becomes the pale end and loud becomes dark — which is what you want on paper, because a spectrogram that is mostly black costs a fortune in ink and tends to fill in. The decibel scale beside the plot inverts with it, so the two can never disagree.- What does Dynamic range do?
+−What does Dynamic range do?
It sets how far below the loudest moment in your selection still gets colour. At 80 dB you see the noise floor, the room tone and the tail of every reverb; at 40 dB everything quiet drops to black and only the prominent content remains. Lower it for a cleaner-looking image, raise it to hunt for something faint.- How long a selection can I use?
+−How long a selection can I use?
Five minutes at a time on the free tier, and 15 minutes of audio per day across all your spectrograms. The limit is on the region you select, not the file you load, so you can pull a 30-second window out of an hour-long recording without it counting as an hour. Changing the palette, aspect ratio, axes or dynamic range re-draws from the analysis already done and costs nothing.- Does this use AI?
+−Does this use AI?
No, and there is nothing here for it to do. A spectrogram is a fast Fourier transform — exact, deterministic maths that has been the standard tool for looking at sound since the 1960s. There is no model making a judgement about your audio, which is the point: what you see is what is in the file. Audio Magic does use AI where it genuinely helps, such as Whisper for transcription and Demucs for separating stems, both running on your own device.- Do I need an account?
+−Do I need an account?
No. The free tools work straight away with no sign-up, up to 15 minutes of audio per tool per day. An account is only needed if you subscribe to remove the limit.- Is it free?
+−Is it free?
Yes. Every tool on this page is free to use, with a daily limit on total audio processed. There is no watermark and no trial period.
Other free audio tools
- Remove Silence From Audio
- Separate a Song Into Stems with AI
- Convert MP3 to WAV and WAV to MP3
- Bleep Out Words in an Audio File
- Split a Stereo File Into Two Mono Files
- Chain Audio Edits and Run Them in One Pass
- Merge Audio Files Into One
- Remove Background Noise From Audio with AI
- Transcribe Audio to Text with AI
- Add a Fade In and Fade Out to Audio
- Normalize Audio Volume to a LUFS Target
- Detect Sounds in Audio and Get Timestamps
- Free Text to Speech — Download as MP3 or WAV
- Free AI Voice Cloning — In Your Browser, Nothing Uploaded
- Label Who Spoke When with Speaker Diarization