White, pink and brown noise
Noise is a random signal with no tone or rhythm in it. What makes one noise sound different from another is how its power is spread over the frequencies, and that spread is named after colors, loosely borrowed from light.
| Noise | Power per hertz | Per octave | How it sounds |
|---|---|---|---|
| White | the same at every frequency | rises 3 dB | Bright, even hiss |
| Pink | falls as 1/f, about 3 dB per octave | the same in every octave | Softer and fuller |
| Brown | falls as 1/f², 6 dB per octave | falls 3 dB | Deep rumble |
An octave is a doubling of frequency. Each octave of white noise spans twice as many hertz as the one below it, so with the same power per hertz it carries twice the power, which is why white noise sounds weighted toward the high end. Pink noise evens that out: as Robin Whittle's page on pink noise puts it, it has the same distribution of power for each octave. Brown noise leans further toward the low end.
How the generator makes the sound
Everything happens in your browser with the Web Audio API. When you press Play, the page fills an audio buffer of about 12 seconds with random numbers for each stereo channel, which is white noise. The buffer then loops; the end is crossfaded into the start, so there is no click at the loop point. The two channels use different random numbers, so the sound fills the stereo field instead of sitting in the middle.
- Pink noise comes from white noise run through Paul Kellet's refined filter, a sum of seven simple filter stages published on Robin Whittle's page "DSP generation of Pink (1/f) Noise". The page states it is accurate to within ±0.05 dB above 9.2 Hz at a 44.1 kHz sample rate.
- Brown noise comes from adding up white noise sample by sample, with a small leak back toward zero so the level cannot wander off. Adding up, or integrating, white noise gives the 1/f² spectrum of brown noise above the lowest frequencies.
- Each color is scaled to about the same average level, so switching between them does not make a big jump in loudness.
The sleep timer is scheduled on the browser's audio clock: a gain stage holds the volume until the fade starts, then ramps it linearly to silence, and the sound stops at the end. That clock keeps running in a background tab, so the fade happens on time.
Keep the volume low
The CDC notes that over time any sound of 85 decibels or more can cause hearing loss, and that headphones at the highest volume can cost some of your hearing within a few minutes. Noise that plays for a long time is a good reason to keep the level as low as still works for you. Start quiet and turn it up slowly. The decibel guide lists safe listening times at each level.
Noise with a timer, a tone or a sleep plan
Pair the noise with the focus timer for work sessions and breaks, or plan your night with the sleep cycle calculator and set the sleep timer to match. For a single steady pitch instead of noise, for example to test speakers, use the tone generator.
How to use the white noise generator
- 1Turn your device volume down, choose White, Pink or Brown, and press Play or the Space bar.
- 2Set the volume with the slider. You can switch the noise color while it plays.
- 3For a sleep timer, choose how long the noise should play and how long the fade-out should be. The time left shows above the Stop button.
- 4On a phone, turn on Keep screen on if the sound stops when the screen locks. Copy link saves your color, volume and timer.
Sources
- Robin Whittle: DSP generation of Pink (1/f) Noise: Paul Kellet's refined pink noise filter, its accuracy, the definition of pink noise and the 1/f² spectrum of brown noise
- MDN: AudioBufferSourceNode.loop: replaying a buffer when it ends
- MDN: AudioParam.linearRampToValueAtTime(): the scheduled fade-out
- MDN: Autoplay guide for media and Web Audio APIs: why sound starts only after you press Play
- MDN: Screen Wake Lock API: keeping the screen on
- CDC: What noises cause hearing loss?: 85 decibels and headphone volume
Guide on this topic
Frequently asked questions
What is the difference between white, pink and brown noise?
They differ in how the sound energy is spread over the frequencies. White noise has the same power at every frequency, so it sounds bright and hissy. Pink noise has the same power in every octave, so its power per hertz falls by about 3 dB per octave and it sounds softer and fuller. Brown noise falls by 6 dB per octave and sounds like a deep rumble.
Does the noise keep playing when I switch tabs?
In a desktop browser, yes: the noise keeps playing in a background tab, and the sleep timer runs on the browser’s audio clock, so it fades out on time even when the tab is hidden. If the sound stops on your phone when the screen locks or you switch apps, turn on Keep screen on and leave the page open.
How does the sleep timer work?
Choose how long the noise should play and how long the fade-out should be, then press Play. The volume stays where you set it until the fade starts, glides down to silence over the fade time and the noise stops when the timer ends. Changing the timer while the noise plays starts the countdown again from the new time.
Why does the noise not start on its own?
Browsers apply autoplay rules to pages that start sound without a click or a key press, and a page that starts making noise by itself is unpleasant anyway. The generator waits until you press Play or the Space bar.
How loud should I set it?
As low as still works for you. The CDC notes that over time any sound of 85 decibels or more can cause hearing loss and that headphones at full volume can harm your hearing within minutes. Start low, especially with headphones, and raise the volume slowly.
Is the sound recorded or downloaded?
No. Your browser calculates the noise on your device from random numbers with the Web Audio API. Nothing is downloaded or uploaded, so it also works offline once the page has loaded.