How to Normalize FLAC Files: ReplayGain Tags, Done Right
Sooner or later every MP3Gain user asks the same question about their lossless shelf: can I do that to my FLAC files? The honest answer is not the same way — and that is fine. FLAC normalization works by writing ReplayGain tags into the files and letting the player apply the adjustment during playback. The audio is never rewritten at all, which makes the method perfectly reversible and completely safe — but it also means the leveling only exists in players that understand the tags. Here is how the mechanism differs, and how to do it properly with metaflac or foobar2000.
Why FLAC has no MP3Gain equivalent
MP3Gain works because the MP3 format gives it something to work with: every MP3 frame carries a global gain value that decoders apply as part of normal playback, so changing the file’s loudness is a matter of rewriting that field (the mechanism is explained in Is MP3Gain Lossless?). FLAC has no equivalent decoder-applied gain field in its frames. There is therefore no mainstream tool that changes a FLAC file’s actual loudness losslessly and reversibly the way MP3Gain changes an MP3’s — any process that alters FLAC audio data means decoding and re-encoding, which defeats the point of keeping FLAC.
Instead, the FLAC specification reserves space in the file’s Vorbis comment metadata for ReplayGain values. The standard workflow is: a scanner analyzes each track’s perceived loudness, computes the adjustment needed to reach the reference level, and stores that number — plus the track’s peak — as tags such as REPLAYGAIN_TRACK_GAIN and REPLAYGAIN_ALBUM_GAIN. A ReplayGain-aware player reads the tags and turns the volume up or down while playing. The file’s audio samples are never modified, so “undoing” normalization is as trivial as deleting the tags. This tag-based design is also why FLAC, Musepack, and APE players so consistently support ReplayGain: support for the values is written into the formats’ own specifications.
Method 1: metaflac (the official command-line tool)
metaflac ships with the FLAC project itself, and its --add-replay-gain option is the canonical way to tag FLAC files:
- Run
metaflac --add-replay-gain *.flacin a folder to write track gain values for each file. - For an album, pass all of the album’s files in a single invocation — metaflac treats one invocation’s file set as one album and computes the shared album gain from them together. Running it file-by-file silently gives you track gains only, which will flatten the intended loudness differences between songs on the same album.
- Remove the values just as easily with
metaflac --remove-replay-gainif you ever want the tags gone.
Because only metadata changes, the operation is fast and risk-free — you do not even need backups, though a scanner bug can at worst cost you the tags, never the audio.
Method 2: foobar2000 (the graphical route)
If you would rather click than type, foobar2000’s built-in ReplayGain scanner does the same job and writes the same standard tags: select the files in a playlist, right-click, and choose ReplayGain → “Scan per-file track gain” for individual tracks or “Scan selection as a single album” for album gain. Our MP3Gain vs foobar2000 comparison covers the philosophical difference between the two tools in depth; for FLAC there is no contest, because foobar2000’s tag-writing is exactly what the format was designed for. Newer cross-format scanners such as rsgain write the same tags for FLAC as well, if you want one tool that covers a mixed library.
What actually gets written — and how to check
A properly tagged FLAC file carries up to five ReplayGain fields in its Vorbis comments: REPLAYGAIN_TRACK_GAIN and REPLAYGAIN_TRACK_PEAK for the file alone, REPLAYGAIN_ALBUM_GAIN and REPLAYGAIN_ALBUM_PEAK from the album pass, and a reference loudness marker recording the level the values were computed against. The peak fields are not decoration: they let a player cap its adjustment so that applying a large positive track gain cannot push the loudest sample into clipping, trading a little loudness for a clean signal — the tag-based world’s answer to MP3Gain’s clipping warnings. You can inspect what any scanner wrote with metaflac --list file.flac and a search for REPLAYGAIN among the comments, or in foobar2000’s properties panel. If the album fields are missing, the files were scanned one by one instead of as a set — rescan them together rather than living with flattened dynamics.
One playback setting matters as much as the tags themselves: most players let you choose whether ReplayGain is applied per track, per album, or not at all, and the wrong mode makes a correctly tagged library sound wrong. Album mode is the right default for album listening; track mode suits shuffled playlists of unrelated singles. And when you eventually convert FLACs for a portable device, note that good converters (foobar2000’s included) can read these same tags and apply the gain during conversion — so the tagging work you do once keeps paying off every time the files change shape.
One scanner per album, one reference for the library
A final consistency rule. ReplayGain values are stored relative to a recorded reference level, and mainstream scanners — metaflac, foobar2000, rsgain in its default ReplayGain mode — share the conventional reference that descends from the original specification, so tags written by different tools generally interoperate. Even so, rescan a whole album with a single tool in a single pass rather than patching individual files over the years with whatever is installed: album gain is only ever as coherent as the analysis set behind it. If you later switch tools or deliberately change the reference approach (some newer workflows write values derived from the EBU R128 loudness standard instead), retag the library wholesale rather than mixing vintages — your player applies all of these values blindly, and a library where half the albums answer to one reference and half to another reintroduces exactly the jumps you set out to remove.
The catch you must plan around: player support
Tag-based leveling is a promise the player has to keep. Desktop players with good FLAC support (foobar2000, MusicBee, most Linux players) honor ReplayGain tags; many car stereos, smart speakers, and cheap hardware players ignore them completely, in which case your carefully tagged FLACs play at their original, mismatched volumes — the same failure mode described for car USB playback in our tutorials. If the destination ignores tags, your realistic options are to convert a copy of the library for that device (accepting that the copy is a transcode) or to level at playback time on a player you control. Do not “fix” your archival FLACs by permanently re-encoding them at a normalized level: you would be trading an exact, lossless archive for a one-time convenience.
Working with other formats too? The format support overview shows which formats get file-level treatment (MP3, AAC via AACGain, WAV via WaveGain) and which are tag-only like FLAC.
Mixed library? Start with the map
Each format levels differently. The overview page matches every common format to the tool and method that actually works for it.
See the Format OverviewNext steps: Normalize OGG Vorbis · MP3Gain vs foobar2000 · Download MP3Gain · Normalize WAV Files
