White Noise Generator
Generate soothing white, pink, or brown noise for sleep, concentration, meditation, or relaxation. Adjust volume, set a sleep timer from 15 minutes to 2 hours, and let continuous ambient sound mask distracting noises. All audio is generated locally in your browser — no streaming, no downloads, no internet connection required after loading.
How Does the White Noise Generator Work?
The White Noise Generator uses the Web Audio API's ScriptProcessorNode (with AudioWorkletNode as a fallback in supported browsers) to produce continuous noise signals in real time. Unlike oscillator-based tones that produce periodic waveforms, noise is generated by filling audio buffers with random sample values. For white noise, each sample is a random number between -1 and +1, creating a signal with equal energy across all audible frequencies. This produces the characteristic "hissing" or "static" sound that effectively masks other environmental sounds.
The generated audio signal passes through a GainNode that controls the output volume, allowing smooth real-time adjustment without interrupting playback. When a sleep timer is set, the tool schedules an automatic fade-out and stop after the specified duration, gently reducing volume over several seconds rather than abruptly cutting off the sound. The entire process runs within your browser's audio processing thread, consuming minimal CPU resources while maintaining consistent, glitch-free playback.
What Is White Noise?
White noise is a random signal with a flat frequency spectrum, meaning it contains equal power at every frequency within the audible range (20 Hz to 20,000 Hz). The name comes from an analogy to white light, which contains all visible frequencies of light at equal intensity. Because white noise covers the entire frequency spectrum uniformly, it effectively masks other sounds by filling in the frequencies that disruptive noises occupy. A slamming door, a barking dog, or traffic outside your window — all these sounds are absorbed into the constant blanket of white noise, preventing them from startling or distracting you.
Pink Noise vs. White Noise
Pink noise differs from white noise in its frequency distribution. While white noise has equal energy per frequency (flat spectrum), pink noise has equal energy per octave, meaning its power decreases by 3 dB per octave as frequency increases. This gives pink noise a deeper, warmer quality compared to the brighter, hissier character of white noise. Mathematically, pink noise follows a 1/f power spectrum — lower frequencies are louder than higher ones. Many people find pink noise more natural and pleasant for sleep because it resembles sounds found in nature, such as steady rainfall, wind through trees, or waves on a shore. Research published in the journal Frontiers in Human Neuroscience (2012) found that pink noise during sleep may enhance memory consolidation by synchronizing brain wave activity.
Brown Noise (Brownian Noise)
Brown noise, also called Brownian noise or red noise, has an even steeper frequency rolloff than pink noise — its power decreases by 6 dB per octave, following a 1/f-squared spectrum. The name comes from Robert Brown and Brownian motion (the random movement of particles), not the color brown. This produces a deep, rumbling sound similar to a strong waterfall, distant thunder, or heavy ocean surf. Brown noise is generated by integrating white noise — each sample is derived from the previous one plus a small random change, with a "leak" factor that prevents the signal from drifting too far. Many users prefer brown noise for its bass-heavy, enveloping quality that feels particularly calming and immersive.
Science of Noise for Sleep and Focus
The primary mechanism by which noise aids sleep and concentration is auditory masking. Your brain continuously monitors environmental sounds for potential threats, even during sleep. Sudden changes in the sound environment — a car horn, a conversation, a door closing — trigger an arousal response that can wake you or break your concentration. Continuous background noise raises the auditory threshold, making these transient sounds less noticeable relative to the baseline. Studies published in the Journal of Caring Sciences (2016) found that white noise significantly improved sleep quality in hospital patients exposed to high levels of environmental noise.
For focus and productivity, moderate ambient noise (around 70 dB) has been shown to enhance creative thinking by inducing a moderate level of processing disfluency, according to research in the Journal of Consumer Research (2012). This gentle cognitive challenge promotes abstract processing without overwhelming working memory. However, very loud noise impairs concentration, so keeping your noise generator at a moderate volume is key. The sweet spot for most people is a comfortable background level that masks distractions without demanding conscious attention.
Safe Listening Levels
While noise generators are safe at reasonable volumes, prolonged listening at high volumes can damage hearing just like any other sound. The World Health Organization recommends keeping personal audio device volume below 60% and limiting listening time to no more than 60 minutes at a stretch (the 60/60 rule). For sleep, keep the volume at the lowest level that effectively masks disruptive sounds — typically 30-50% of your device's maximum output. If you need to raise the volume above 50% to mask noise, consider using earplugs or earbuds instead, or address the source of the disruptive noise directly.
Frequently Asked Questions
Is white noise safe to listen to all night while sleeping?
Yes, at a safe volume. Keep the volume at the lowest level that effectively masks disruptive sounds, typically 30-50% of your device maximum. The WHO recommends the 60/60 rule: no more than 60% volume for no more than 60 minutes. For overnight use at low to moderate volume through speakers (not earbuds), the risk is minimal. Avoid sleeping with earbuds at high volume.
What is the difference between white, pink, and brown noise?
White noise has equal energy at all frequencies, producing a bright, hissing sound like TV static. Pink noise has more bass and less treble (equal energy per octave), sounding like steady rain. Brown noise has even more bass with very little high-frequency content, resembling a deep waterfall or rumbling thunder. Most people find pink or brown noise more pleasant for sleep.
Can white noise help babies sleep?
Many parents find white noise helpful for infant sleep, as it resembles the constant whooshing sound of blood flow heard in the womb. The American Academy of Pediatrics recommends keeping noise machines at least 200 centimeters (7 feet) from the baby and at a volume no louder than 50 dB. Always use the lowest effective volume and consider a timer so it does not play all night.
Does the noise keep playing if I lock my phone or switch tabs?
Behavior varies by device and browser. Most desktop browsers continue audio playback when the tab is in the background. On mobile devices, some browsers pause audio when the screen is locked or the app is backgrounded. For reliable overnight playback, keep the browser tab active and prevent your device from sleeping by adjusting your display/sleep settings.
Is brown noise better than white noise for concentration?
This is largely a matter of personal preference. Some people find brown noise better for concentration because its deeper, bass-heavy sound feels less intrusive and more immersive. White noise can feel harsh or fatiguing over long periods for some listeners. Pink noise is often considered the best middle ground. Experiment with all three to find what works best for you — there is no universally superior choice.