Back to Projects

LUFS Scanner

by Jeremy Le Grand

EBU R128 / ITU-R BS.1770 Loudness Measurement

100% Private — Runs entirely in your browser. Your audio is never uploaded or stored.

1
Select your audio file
2
Analysis runs in your browser
3
Get LUFS measurements

Drag and drop audio file here

or

Supported: WAV, MP3, AIFF, FLAC, OGG, M4A

Your audio never leaves your device

Your Music Stays Private

This tool runs entirely in your browser. Your audio files are never uploaded to any server, never stored anywhere, and never leave your device. The analysis happens locally using the Web Audio API — it's 100% safe for unreleased tracks and sensitive material.

What is LUFS?

LUFS (Loudness Units relative to Full Scale) measures perceived loudness, not just peak levels. Streaming platforms like Spotify, Apple Music, and YouTube normalize audio to specific LUFS targets to ensure consistent playback volume across all tracks.

Streaming Platform Targets

Spotify -14 LUFS
Apple Music -16 LUFS
YouTube -14 LUFS
Amazon Music -14 LUFS

Understanding the Measurements

  • Integrated Loudness: The overall loudness of your entire track - this is the main number to check against platform targets.
  • True Peak: The maximum signal level. Keep below -1 dBFS to prevent clipping during encoding.
  • Short-term Max: The loudest 3-second section - useful for identifying the loudest parts.
  • Momentary Max: The loudest 400ms moment - shows brief peaks and transients.
  • Loudness Range: The difference between quiet and loud sections (dynamic range).

Technical Details

Standards Compliance

  • EBU R128: European Broadcasting Union recommendation for loudness normalization
  • ITU-R BS.1770-4: International standard algorithm for measuring audio loudness
  • AES Streaming Guidelines: Compatible with Audio Engineering Society recommendations

How the Algorithm Works

  • K-weighting: Audio is filtered with a high-shelf boost (+4dB at 1500Hz) and high-pass filter (60Hz) to model human hearing perception
  • Mean Square: Power is calculated per channel, then summed
  • Gating: Silence below -70 LUFS (absolute gate) and quiet sections 10 LU below average (relative gate) are excluded

True Peak Measurement

  • Inter-sample Detection: Quadratic interpolation detects peaks that occur between digital samples
  • Why it matters: Digital-to-analog conversion can produce peaks higher than the sample values indicate
  • Target: Keep below -1 dBTP to prevent clipping during lossy encoding (MP3, AAC)

Measurement Windows

  • Momentary (400ms): Fast response, captures transients and brief peaks. Updated every 100ms.
  • Short-term (3s): Smoothed reading useful for mixing decisions. Overlapping windows.
  • Integrated (full duration): Gated measurement of entire program. The definitive loudness value.

Under the Hood

  • Analysis Engine: Pure JavaScript implementation of ITU-R BS.1770-4 algorithm
  • Audio Decoding: Web Audio API decodes audio files natively in the browser
  • Privacy: 100% client-side - your audio files never leave your device
  • K-Weighting: Biquad filters implement the standard pre-filter and RLB weighting

Accuracy Notes

  • Precision: Results typically within ±0.5 LUFS of professional meters
  • Limitations: Very short files (<1s) may have less reliable integrated measurements
  • Browser support: Works in all modern browsers (Chrome, Firefox, Safari, Edge)

Super Technical Details

Here's a simplified overview of how LUFS calculation works conceptually.

Step 1: K-Weighting Filter

First, we apply K-weighting to simulate human hearing. This uses two biquad filters in series:

// Conceptual K-weighting pipeline:
//
// 1. HIGH-SHELF BOOST
//    - Boost frequencies above ~1500Hz by ~4dB
//    - Models how our ears are more sensitive to mid-highs
//
// 2. HIGH-PASS FILTER
//    - Roll off frequencies below ~40Hz
//    - We don't perceive very low bass as "loud"
//
// Audio flows through both filters in sequence:
// raw_audio → high_shelf → high_pass → k_weighted_audio

Step 2: Mean Square Power

After K-weighting, we calculate the mean square power for each 100ms block:

// For each 100ms block of K-weighted audio:
//
// 1. Square every sample value
//    (negative values become positive, loud = bigger numbers)
//
// 2. Calculate the average (mean) of all squared values
//    mean_square = sum_of_squares / num_samples
//
// 3. Convert to decibels using logarithmic scale
//    lufs = offset + 10 × log₁₀(mean_square)
//
// The offset value comes from ITU-R BS.1770 spec
// to calibrate the scale correctly

Step 3: Gating (The Secret Sauce)

This is what makes LUFS different from simple RMS. We apply two gates to ignore silence:

// Two-pass gating algorithm:
//
// PASS 1 - ABSOLUTE GATE
// └─ Remove any block quieter than -70 LUFS
//    (this is basically silence or noise floor)
//
// PASS 2 - RELATIVE GATE
// └─ Calculate average of remaining blocks
// └─ Remove blocks that are 10 LU quieter than average
//    (this excludes quiet passages like intros/outros)
//
// FINAL RESULT
// └─ Average the surviving blocks
// └─ This is your Integrated Loudness value

Step 4: True Peak Detection

Sample peaks can miss inter-sample peaks. We use quadratic interpolation to find the real maximum:

// True Peak detection concept:
//
// Digital audio = discrete samples (like frames in a video)
// Real audio = continuous wave
//
// Problem: Peak might occur BETWEEN samples!
//
//     sample[n-1]    sample[n]    sample[n+1]
//         •             •             •
//          \           / \           /
//           \    ?    /   \         /
//            \  ↑    /     \       /
//             \ TRUE PEAK   \     /
//              \_____|_______\___/
//
// Solution: Use interpolation to estimate the curve
// between samples and find the actual maximum.
//
// Convert final peak to dBFS (decibels below full scale)

The Complete Pipeline (Conceptual)

// THE COMPLETE ANALYSIS PIPELINE
// ══════════════════════════════
//
// ┌─────────────────────────────────────────────┐
// │  AUDIO FILE (WAV, MP3, FLAC, etc.)          │
// └─────────────────┬───────────────────────────┘
//                   ▼
// ┌─────────────────────────────────────────────┐
// │  1. DECODE → Raw PCM samples                │
// └─────────────────┬───────────────────────────┘
//                   ▼
// ┌─────────────────────────────────────────────┐
// │  2. K-WEIGHT → Filter to match human ears   │
// └─────────────────┬───────────────────────────┘
//                   ▼
// ┌─────────────────────────────────────────────┐
// │  3. BLOCK → Split into 100ms chunks         │
// │     Calculate power for each block          │
// └─────────────────┬───────────────────────────┘
//                   ▼
// ┌─────────────────────────────────────────────┐
// │  4. GATE → Remove silence & quiet parts     │
// │     Average remaining → INTEGRATED LUFS     │
// └─────────────────┬───────────────────────────┘
//                   ▼
// ┌─────────────────────────────────────────────┐
// │  5. WINDOWS → Find loudest 400ms, 3s spans  │
// │  6. TRUE PEAK → Interpolate max amplitude   │
// └─────────────────────────────────────────────┘

Not Technical Details

What is "Loudness" anyway?

You know how some songs on your playlist are SUPER LOUD and others are quiet, so you're always reaching for the volume button? That's annoying, right?

LUFS is basically a "loudness score" that helps fix this. It's like giving every song a grade based on how loud it feels to your ears - not just how big the sound waves are.

Why can't we just measure the biggest wave?

Imagine you're at a party. Someone pops a balloon - BANG! - that's a huge spike, but it's over in a split second.

Now imagine everyone talking at once for an hour. That constant chatter actually feels louder even though no single moment was as loud as the balloon pop.

LUFS measures the "constant chatter" kind of loudness, not just the balloon pops. That's why it's better for music!

What's "K-Weighting"? (The Ear Simulator)

Your ears are weird. They don't hear all sounds equally:

High sounds (like a whistle) seem louder to you.
Low sounds (like a bass drum) seem quieter even when they're not.

K-weighting is like putting on "ear goggles" so the computer hears music the same way you do. It boosts the highs and reduces the lows before measuring.

What's "Gating"? (Ignoring the Quiet Parts)

Imagine you're measuring how loud a rock concert is. Do you count the silence between songs? What about when the singer whispers for dramatic effect?

Gating means we ignore the quiet parts. If a section is basically silence (below -70 LUFS), we skip it. If a section is way quieter than the rest of the song, we skip that too.

This way, the "loudness score" reflects how loud the actual music is, not how much silence there is.

What's "True Peak"? (Catching the Sneaky Loud Bits)

Digital audio is like a flip-book animation - a bunch of snapshots really close together. But what if the loudest moment happens between two snapshots?

True Peak is like using a magnifying glass to look between the snapshots and find those hidden loud moments. If we miss them, your speakers might make a crackling sound (called "clipping") when playing the song.

Why do Spotify/Apple Music care about this?

Remember that annoying thing where some songs are too loud and others too quiet?

Streaming services fix this by checking every song's LUFS score. If a song is too loud, they turn it down. If it's too quiet, they... well, they usually leave it alone (so artists are encouraged to hit the target).

The magic number is usually -14 LUFS. If your song measures -14, Spotify won't change it at all. If it's -8 (too loud), they'll turn it down by 6 points.

That's why music producers check LUFS before releasing songs - so their music sounds exactly how they intended!