How MP3 Files Work: Frames, Bitrate and ID3 Tags
By SimpleTools24Published 4 min read
An MP3 file is mostly a long sequence of frames, each holding a few dozen milliseconds of compressed audio and a small header describing it. Around those frames you'll usually find ID3 tags with metadata such as title, artist and cover art, and often an Xing or Info header that tells players the total length. The audio itself was compressed with a perceptual model that discards sounds you're unlikely to hear, which is why MP3s are small and why their quality is fixed at encoding time.
In this guide
The Layout of a Typical MP3 File
| Part | Position | Purpose |
|---|---|---|
| ID3v2 tag | Start of file | Title, artist, album, track number, cover art, chapters |
| Xing / Info header | First audio frame | Total frames, total bytes, seek table, encoder info |
| Audio frames | Middle (most of the file) | The compressed audio |
| ID3v1 tag | Last 128 bytes (optional) | Old-style basic metadata |
You can see this for yourself in a binary file viewer: a tagged MP3 begins with the ASCII letters ID3, one of the signatures listed in file signatures and magic numbers.
Frames: The Building Blocks
The Frame Header
Each frame starts with a four-byte header. Its first 11 bits are all set to 1, a sync word that lets a decoder find frames even if it starts reading mid-file. The rest of the header specifies:
- MPEG version and layer (MPEG-1 Layer III is the classic "MP3").
- Bitrate for this frame, such as 128 or 320 kbps.
- Sample rate: 44.1 kHz, 48 kHz or 32 kHz for MPEG-1; lower rates for MPEG-2 and 2.5.
- Padding, a flag that adds a byte to keep the average bitrate exact.
- Channel mode: stereo, joint stereo, dual channel or mono.
Samples per Frame
An MPEG-1 Layer III frame always represents 1,152 samples per channel. At 44.1 kHz, that's about 26.1 milliseconds of sound. A three-minute song therefore contains roughly 6,900 frames.
Frame Size
The frame's size in bytes follows from its bitrate and sample rate:
frame bytes = 144 × bitrate ÷ sample rate (+ 1 if padded)
128 kbps at 44.1 kHz: 144 × 128000 ÷ 44100 ≈ 417 or 418 bytesBecause frames are self-describing, tools can walk through a file frame by frame without decoding the audio. That's exactly how lossless splitters work, as explained in how to split an MP3 without losing quality.
Bitrate: CBR, VBR and ABR
Bitrate is how many bits per second the audio uses. Higher bitrates keep more detail.
- CBR (constant bitrate): every frame uses the same bitrate. Sizes and durations are easy to calculate.
- VBR (variable bitrate): each frame uses as many bits as the encoder thinks it needs. Quiet or simple passages use fewer bits; complex passages use more. You get better quality for the size, but duration can't be calculated from file size alone.
- ABR (average bitrate): varies per frame but targets an average.
| Bitrate | Typical use |
|---|---|
| 64 kbps mono | Speech, voice notes |
| 96–128 kbps | Podcasts, audiobooks |
| 192 kbps | General music listening |
| 256–320 kbps | High-quality music |
| VBR (e.g. LAME -V2) | Efficient music encoding |
The Xing / Info Header
In a VBR file, a player can't estimate the duration from the file size. So encoders write a special first frame, containing no audible audio, with a Xing tag (for VBR) or Info tag (for CBR). It stores the total number of frames and bytes, and a table of contents for seeking. The LAME encoder adds extra fields, including encoder delay and padding, which gapless players use to remove the silence encoders add at the start and end.
When a file is split, each part needs its own correct header. Without one, a player may show the original file's length, or seek inaccurately.
ID3 Tags
ID3 tags hold metadata that the MP3 audio format itself has no place for.
- ID3v1 is a fixed 128-byte block at the end of the file with short fields for title, artist, album, year, comment and genre.
- ID3v2 sits at the start and is far more flexible: long text, multiple languages, embedded images, lyrics, and even chapter markers. Versions 2.3 and 2.4 are the common ones.
Fields you'll care about when splitting or organising audio include title (TIT2), artist (TPE1), album (TALB) and track number (TRCK). A splitter that updates title and track number for each part saves you renaming everything in a tag editor.
How MP3 Compression Discards Sound
The encoder splits audio into frequency bands and uses a psychoacoustic model to decide which components are masked by louder nearby sounds or are otherwise unlikely to be heard. Those get fewer bits or none. This is why MP3 is lossy: decoding never returns the exact original samples, and encoding again discards more. The MP3 splitter avoids that second loss by never decoding the audio: it copies frames and writes fresh headers and tags for each part.
Frequently Asked Questions
Why does my MP3 show the wrong length?
Usually a VBR file without a Xing header, or with a header copied from a different file. Players estimate from the first frame's bitrate and get it wrong.
Is 320 kbps lossless?
No. It's the highest standard MP3 bitrate, but still lossy.
Can I edit MP3 tags without changing the audio?
Yes. Tags are separate from the frames, so tag editors change metadata without touching the sound.
What's the difference between MP3 and MP4?
MP3 is an audio format. MP4 is a container that can hold video and audio, often AAC audio rather than MP3.
Summary
An MP3 is tags plus a stream of self-describing frames, each about 26 ms long at 44.1 kHz. Bitrate can be constant or variable, a Xing/Info header tells players the length, and ID3 tags carry the metadata.
Related tools
Sources
- ID3v2.4.0 Main Structure – id3.org (opens in a new tab)
- MP3 file format (MPEG-1 Audio Layer III) – Library of Congress (opens in a new tab)
Related articles
- Split MP3 Without Losing QualityWhy re-encoding degrades MP3s, how frame-copy splitting avoids it, and the trade-offs in precision.
- How to Split an MP3 FileDivide one MP3 into several files at exact times, equal lengths or natural pauses, without losing quality.
- File Signatures and Magic NumbersHow magic numbers identify files regardless of extension, with a reference list of common signatures.