# FLAC and Lossless Audio: Comparison, Conversion and When to Use It
FLAC (Free Lossless Audio Codec) is the most popular lossless audio format. Unlike MP3 or AAC, FLAC preserves every bit of the original audio, producing a mathematically identical copy to the source file.
## Lossy vs. Lossless
| Feature | MP3 / AAC (lossy) | FLAC / ALAC / WAV (lossless) |
|---|---|---|
| Quality | Perceptually similar to original | Identical to original |
| Size | 3-10 MB / song | 20-40 MB / song |
| Compression | Destructive (data removed) | Lossless (data recoverable) |
| Re-encoding | Cumulative degradation | No degradation |
| Streaming | Ideal (low bandwidth) | Only on HiFi services |
Can you hear the difference? In most everyday situations (mediocre headphones, background noise), no. On a high-fidelity system, yes.
## Lossless Format Comparison
### FLAC — The Open Standard
- Compression: 40-60% of WAV size (40 MB -> ~22 MB in FLAC)
- Metadata: full support (title, artist, album, cover art)
- Compatibility: Linux, Android, VLC, Windows 11, most modern players
- Apple: NOT natively compatible with iTunes/Apple Music (use ALAC)
- License: completely free and open-source
- Bit depth: supports up to 32-bit / 192 kHz
### ALAC (Apple Lossless)
- Equivalent to FLAC in the Apple ecosystem
- Natively compatible with iTunes, Apple Music, iPhone, iPad
- Extension: .m4a (same as AAC, but lossless)
- Open-source since 2011
### WAV — No Compression
- Pure PCM audio: maximum size, maximum quality
- 1 minute of CD audio (44.1 kHz, 16-bit, stereo) = ~10 MB
- Universal support, very large files
- Ideal for: music production, mastering, professional archiving
### AIFF — Apple's WAV
- WAV equivalent in the Apple ecosystem
- Compatible with Logic Pro, GarageBand, Final Cut Pro
## Conversion with FFmpeg
```bash
# WAV -> FLAC
ffmpeg -i audio.wav audio.flac
# FLAC -> WAV
ffmpeg -i audio.flac audio.wav
# FLAC -> MP3 at 320 kbps
ffmpeg -i audio.flac -b:a 320k audio.mp3
# FLAC -> AAC (for Apple)
ffmpeg -i audio.flac -c:a aac -b:a 256k audio.m4a
# FLAC -> ALAC
ffmpeg -i audio.flac -c:a alac audio_lossless.m4a
# WAV -> ALAC
ffmpeg -i audio.wav -c:a alac output.m4a
# FLAC with preserved metadata
ffmpeg -i input.flac -c:a flac -compression_level 8 -map_metadata 0 output.flac
# Batch: all WAV files -> FLAC
for f in *.wav; do
ffmpeg -i "$f" "${f%.wav}.flac"
done
```
### FLAC Compression Levels
Quality is identical at all levels; only speed and file size differ:
```bash
ffmpeg -i audio.wav -compression_level 0 fast.flac # Fastest
ffmpeg -i audio.wav -compression_level 8 balanced.flac # Default balance
ffmpeg -i audio.wav -compression_level 12 maximum.flac # Max compression
```
Size difference between level 0 and 12: only ~15-20%. Level 5-8 is the usual sweet spot.
## Python with soundfile
```python
import soundfile as sf
# Read FLAC
data, samplerate = sf.read("song.flac")
print(f"Sample rate: {samplerate} Hz, Duration: {len(data)/samplerate:.2f}s")
# WAV -> FLAC
data_wav, fs = sf.read("audio.wav", dtype='float32')
sf.write("audio.flac", data_wav, fs, format='FLAC')
# Read only a section (seconds 10 to 30)
start, end = 10 * samplerate, 30 * samplerate
section, fs = sf.read("song.flac", start=start, stop=end)
sf.write("excerpt.flac", section, fs, format='FLAC')
```
## Python with pydub
```python
from pydub import AudioSegment
audio = AudioSegment.from_file("song.flac", format="flac")
print(f"Duration: {len(audio)/1000:.2f}s | Channels: {audio.channels}")
# FLAC -> MP3
audio.export("song.mp3", format="mp3", bitrate="320k",
tags={"title": "My Song", "artist": "Artist"})
# FLAC -> WAV
audio.export("song.wav", format="wav")
# FLAC -> AAC
audio.export("song.m4a", format="mp4", codec="aac",
parameters=["-b:a", "256k"])
# Normalize volume
from pydub.effects import normalize
normalize(audio).export("normalized.flac", format="flac")
# Cut excerpt (milliseconds)
audio[10000:30000].export("excerpt.flac", format="flac")
# Join full album
from pathlib import Path
tracks = sorted(Path("album/").glob("*.flac"))
album = sum([AudioSegment.from_file(str(t)) for t in tracks])
album.export("full_album.flac", format="flac")
```
## When to Use Each Format
| Situation | Recommended format |
|---|---|
| Music archiving on hard drive | FLAC |
| Music production (DAW) | WAV or AIFF |
| Distribution to Spotify | WAV (service converts it) |
| iPhone / Mac / iPad | ALAC (.m4a) |
| Android portable player | FLAC |
| Internet sharing / social media | MP3 320k or AAC 256k |
| Podcast / voice | MP3 128k or OGG 128k |
| HiFi streaming (Tidal, Qobuz) | FLAC |
## Is Converting MP3 to FLAC Worth It?
No. Converting MP3 -> FLAC only creates a large FLAC file with MP3 quality. The quality lost during MP3 encoding cannot be recovered.
FLAC IS worth it if:
- You have physical CDs to digitize losslessly
- You work in audio production
- You use HiFi services with equipment that can benefit
- You want a master file to derive lossy formats from
## Convert Online
To convert FLAC to MP3, WAV, AAC or other formats without installing software, KaijuConverter offers the conversion directly in your browser.
Guide