File types · Explainer

The MP3 file (.mp3)

An MP3 file is compressed audio that leaves out sounds you're unlikely to hear, making it about a tenth the size of a CD-quality recording. This guide explains what's inside one, how tags and bit rates work, the quirks worth knowing, and has free sample MP3 files to download for testing.

At a glance

Full name
MPEG-1 Audio Layer III (and MPEG-2 Audio Layer III)
Extensions
.mp3
MIME type
audio/mpeg; audio/mp3 is also seen but isn't the registered type
Kind
Binary, lossy compressed audio: a stream of frames with no container around them
Standard
ISO/IEC 11172-3 (MPEG-1) and ISO/IEC 13818-3 (MPEG-2, adds lower sample rates)
First released
1993 as an ISO/IEC standard, developed within MPEG with Fraunhofer IIS as a lead contributor
Bit rates
32 to 320 kbps (MPEG-1), 8 to 160 kbps (MPEG-2)
Sample rates
32, 44.1 and 48 kHz (MPEG-1); 16, 22.05 and 24 kHz (MPEG-2)
Typical size
About 1 MB per minute at 128 kbps (128,000 bits × 60 s ÷ 8 = 960,000 bytes)
Magic number
49 44 33 (ID3) when the file starts with a tag; otherwise a frame sync such as FF FB or FF F3
Patents
Expired; the Fraunhofer licensing programme ended in April 2017

The basics

What is an MP3 file?

MP3 is the audio format that made digital music portable. It shrinks a recording by throwing away detail the ear is unlikely to notice: quiet sounds masked by louder ones at nearby pitches, and very high frequencies. A 128 kbps MP3 is about one eleventh the size of the same audio on a CD. Podcasts, audiobooks, voice notes, sound effects and most downloadable music still use it, because nearly every device that plays sound can play MP3.

MP3 is lossy: the discarded detail is gone for good. Converting an MP3 to WAV or FLAC gives you a bigger file, not better sound, and re-encoding an MP3 to another MP3 loses a little more each time.

Unlike MP4, an MP3 file has no container. It's simply a sequence of frames, each with its own header, with optional ID3 tags at the start and end. That's why you can cut an MP3 at a frame boundary, or join two together, and still have a playable file, at worst with a tiny glitch at the join.

Free to use

MP3 was covered by patents for most of its life. They have all expired, and the Fraunhofer licensing programme ended in April 2017, so anyone can now write MP3 encoders and decoders without paying royalties.

Anatomy

What's inside an MP3 file

An MP3 file is a run of short, independent frames, each holding about 26 milliseconds of sound with a 4-byte header in front. Tags are bolted on before and after. Here is the layout of sample-id3-cover.mp3, our 10-second sample, with the real bytes at each offset.

sample-id3-cover.mp3 (layout)
offset    bytes                                part
0         49 44 33 04 00 00 00 00 4E 45        ID3v2.4 header, tag size 10,053
10        54 49 54 32 00 00 00 28 00 00 03 …   TIT2 frame: title, UTF-8
60        54 50 45 31 …                        TPE1 frame: artist
94        54 52 43 4B …                        TRCK frame: track number
107       54 41 4C 42 …                        TALB frame: album
146       54 44 52 43 …                        TDRC frame: year
162       54 43 4F 4E …                        TCON frame: genre
184       57 58 58 58 …                        WXXX frame: web address
233       43 4F 4D 4D …                        COMM frame: comment
329       41 50 49 43 00 00 49 7C 00 00 …      APIC frame: cover art (PNG)
9,807     00 00 00 00 …                        256 bytes of padding
10,063    FF FB 90 00 … 49 6E 66 6F …          first frame: "Info" header
10,480    FF FB 90 44 …                        audio frame 1 (417 bytes)
10,897    FF FB 92 44 …                        audio frame 2 (418 bytes)
…         …                                    384 audio frames in all
170,976   54 41 47 53 61 6D 70 6C 65 …         ID3v1 tag: "TAG" + 125 bytes
171,104                                        end of file
  1. 149 44 33 04 00 00

    The ID3v2 header

    ID3, then the version (2.4.0) and a flags byte. Most MP3 files start this way, so ID3 is the signature file-type detectors look for first.

  2. 200 00 4E 45

    A synchsafe size

    The tag size, 10,053 bytes, stored in 4 "synchsafe" bytes that each use only 7 bits. With the top bit always zero, the size can never contain an FF byte that a player might mistake for the start of an audio frame.

  3. 3TIT2, TPE1, TALB …

    Text frames

    Each tag frame has a 4-letter ID (TIT2 title, TPE1 artist, TALB album), a size, two flag bytes, then the value. The first byte of the value says the text encoding: 03 is UTF-8, allowed only in ID3v2.4.

  4. 4APIC

    Cover art

    An attached picture: its MIME type, a picture type (03 means front cover) and the image file itself, here a 300×300 PNG. Cover art is often the largest part of a short MP3's tag.

  5. 500 00 00 00 …

    Padding

    Spare zero bytes at the end of the tag, so a tag editor can add or lengthen a field without rewriting the whole file.

  6. 6FF FB 90 00 … Info

    The Info (Xing) frame

    A valid MP3 frame that carries no sound. It stores the number of frames (384) and bytes, which lets players show the right duration at once, plus encoder details. VBR files use the same structure labelled Xing, with a table of contents for seeking.

  7. 7FF FB 90 44

    A frame header

    11 bits of 1 (the frame sync), then MPEG-1, Layer III, no checksum (FB); 128 kbps at 44.1 kHz with no padding (90); joint stereo (44). Every frame of this file starts with a header like this.

  8. 8417 or 418 bytes

    Audio frames

    Each MPEG-1 Layer III frame holds 1,152 samples per channel. At 128 kbps and 44.1 kHz that's 417.96 bytes, so the encoder alternates 417- and 418-byte frames using the padding bit (92 instead of 90) to keep the average exact.

  9. 954 41 47 (TAG)

    The ID3v1 tag

    The original tag format: the last 128 bytes of the file, starting with TAG, with fixed 30-character fields for title, artist and album. Still written for very old players; software that understands ID3v2 uses the ID3v2 tag instead.

Under the hood

How MP3 compression works

  1. 1Split into frames. The encoder takes 1,152 samples at a time (576 in the lower-rate MPEG-2 version), about 26 ms at 44.1 kHz.
  2. 2Split into frequency bands. A filter bank and a transform turn each frame into a set of frequency components.
  3. 3Model what you can hear. A psychoacoustic model works out which components are masked by louder sounds and can be stored roughly, or not at all.
  4. 4Spend the bits. The components are quantised to fit the bit rate and packed with Huffman coding. A bit reservoir lets a demanding frame borrow space left over by an easy one.
  5. 5Use the stereo image. In joint stereo, the encoder can store the sum and difference of the two channels (mid/side) when that's cheaper than storing left and right separately.

At lower bit rates, encoders also filter out the highest frequencies to save bits for the rest. You can see it in sample-1mb.mp3, a sweep from 20 Hz to 20 kHz encoded with LAME at 128 kbps: decoded, the tone stays level up to about 16 kHz and is gone by about 17 kHz.

Bit rates

CBR vs VBR, and which bit rate to choose

ModeHow it worksGood for
CBR (constant bit rate)Every frame uses the same bit rate, so the file size is predictable: duration × bit rate.Streaming and broadcast, devices that seek by byte position, simple duration maths.
VBR (variable bit rate)Each frame gets as many bits as it needs for a target quality. Silence is cheap, cymbals are expensive.Music: better quality for the size. LAME's -V 0 to -V 2 settings are common choices.
ABR (average bit rate)Varies frame by frame but aims for an average.A compromise when you need a rough file size.

A VBR file needs its Xing header. Without it, a player can't know the length without reading every frame, so it guesses from the first frame's bit rate and shows the wrong duration, and seeking lands in the wrong place. Our sample-vbr.mp3 has the header, with a table of contents for seeking.

As a rough guide: 128 kbps is the long-standing default for music, 192 to 320 kbps or VBR -V 0 to -V 2 for higher quality, and 64 to 96 kbps mono for speech. 320 kbps is the highest standard MP3 bit rate; beyond that, use a lossless format.

Metadata

ID3 tags: title, artist and cover art

The MPEG standard has no place for a song title, so the metadata format ID3 was added on top. There are two unrelated generations, and many files carry both:

VersionWhereWhat it can hold
ID3v1 / v1.1The last 128 bytesTitle, artist and album of up to 30 characters, a year, a comment, a genre number and (v1.1) a track number. No Unicode.
ID3v2.3 (1999)The start of the fileAny number of frames of any length: lyrics, cover art, ratings. Text in ISO-8859-1 or UTF-16. The most widely supported version.
ID3v2.4 (2000)The start, or the end with a footerAdds UTF-8 text, synchsafe frame sizes and the TDRC recording-time frame. A few older programs read it badly.
  • Garbled accents or Asian characters usually mean text saved in a legacy code page in an ID3v1 tag or an ISO-8859-1 field, then read as something else. Re-save the tags as UTF-16 (ID3v2.3) or UTF-8 (ID3v2.4).
  • Tags don't show up in one app but do in another: the app may only read one ID3 version. Writing ID3v2.3 is the safest choice for old players and car stereos.
  • No cover art in a player: some only look for an APIC frame with picture type 3 (front cover) and a JPEG or PNG image.

Related formats

MP3 vs AAC, Opus, WAV and FLAC

FormatCompressionNotes
.mp3LossyPlays everywhere. Fine at 128 kbps and up for most listening.
.m4a / .aac (AAC)LossyMP3's successor: better quality at the same bit rate, especially at low rates. Used by Apple Music and in most MP4 video.
.opus, .ogg (Opus)LossyOpen and royalty-free, with very good quality at low bit rates. Used for voice calls and web audio.
.wavNone (usually)Uncompressed PCM: about 10 MB per minute at CD quality. For recording and editing.
.flacLosslessSmaller than WAV with nothing lost. For archiving and high-quality listening.

Keep a lossless master (WAV or FLAC) and make MP3s from it. Converting between lossy formats, such as MP3 to AAC, stacks the losses of both.

Troubleshooting

Common MP3 problems and their causes

  • Wrong duration, or seeking jumps to the wrong place: a VBR file without a Xing header, often after it was cut or joined by a tool that didn't update it. Re-save it with a tool that rewrites the header, such as ffmpeg -i in.mp3 -c copy out.mp3.
  • A short gap between tracks of a live album: encoders add a little silence at the start and pad the end to fill the last frame. Our 60.000-second sweep decodes to 60.029 seconds. LAME records the exact delay and padding in its header, and gapless-aware players use it to trim the silence.
  • Muffled or "swishy" sound: a low bit rate. The high-frequency cutoff and artefacts come from the encoding and can't be undone, so re-encode from the original if you have it.
  • Clicks or distortion after converting from WAV: the source was already at full scale and the decoded MP3 overshoots it. Lower the level by a decibel or so before encoding.
  • The file won't play at all but has the right size: check the first bytes. A file that doesn't start with ID3 or FF Ex/FF Fx may be another format with the wrong extension, such as AAC or WAV renamed to .mp3.

How to

How to open, edit and convert an MP3 file

  • Play it: every operating system, phone and browser plays MP3. Double-click it on Windows or macOS, or drag it into a browser window.
  • Edit the sound: Audacity (free, Windows, macOS, Linux) cuts, fades and normalises. Every edit re-encodes, so export once at the end.
  • Cut without re-encoding: tools such as mp3DirectCut and ffmpeg -ss 10 -t 30 -i in.mp3 -c copy out.mp3 cut at frame boundaries without losing quality.
  • Edit the tags: Mp3tag (Windows, macOS), Kid3 (all platforms) or MusicBrainz Picard. On Windows, File Explorer's Properties → Details tab edits the basics.
  • Convert to MP3: ffmpeg -i input.wav -c:a libmp3lame -q:a 2 output.mp3 makes a VBR file with LAME's -V 2 setting.

Free downloads

Sample MP3 files to download

Free sample MP3 files for testing players, upload forms, tag readers and audio pipelines. The sounds are generated chords and test tones, encoded with LAME, and each file was checked with ffprobe and decoded in full without errors.

sample-id3-cover.mp3 · 167.1 KBDownloadOpen

What's inside sample-id3-cover.mp3

A 10-second MP3 at 128 kbps CBR, 44.1 kHz stereo, with a full ID3v2.4 tag, cover art and an ID3v1 tag at the end. Open it in a tag editor or a hex viewer to follow along.

  1. The music

    Five two-second chords (C, A minor, F, G, C). The bass notes sit mostly on the left channel and the upper notes on the right, so you can hear whether stereo survives.

  2. ID3v2.4 text frames

    Title, artist, album, track number, year and genre, all in UTF-8.

  3. Comment and link

    A COMM comment and a WXXX URL frame pointing back to this page.

  4. Cover art

    A 300×300 PNG in an APIC frame marked as the front cover. Players that show artwork should display it.

  5. Padding

    256 spare bytes at the end of the tag, so editing the tags doesn't force a rewrite of the audio.

  6. The Info frame

    The first frame holds no sound, just the frame count (384) and byte count, so players show 10.03 seconds straight away.

  7. ID3v1 at the end

    The last 128 bytes repeat the title, artist and album in the old fixed-length format for very old software.

All sample MP3 files

  • MP3 with ID3 tags and cover art

    sample-id3-cover.mp3 · 167.1 KB (171,104 bytes)

    10 seconds, 128 kbps CBR, 44.1 kHz joint stereo. ID3v2.4 tag with cover art, an Info frame and an ID3v1 tag.

    • Testing tag readers, cover art display and players
    • A small, realistic MP3 for upload tests
  • VBR MP3 (LAME -V 2)

    sample-vbr.mp3 · 97.4 KB (99,749 bytes)

    The same 10 seconds encoded as VBR with LAME's -V 2 setting (about 79 kbps on average for this simple sound), with a Xing header and an ID3v2.3 tag.

    • Checking duration and seeking in VBR files
    • Testing ID3v2.3 support
  • Bare MP3 frames, no tags

    sample-no-tags.mp3 · 78.8 KB (80,666 bytes)

    5 seconds at 128 kbps with no ID3 tags and no Info frame: the file begins directly with the frame sync FF FB 90 44.

    • File-type detection that doesn't rely on `ID3`
    • Parsers and players handling untagged streams
  • MPEG-2 Layer III, 22.05 kHz mono

    sample-mpeg2-22khz-mono.mp3 · 40.1 KB (41,014 bytes)

    10 seconds at 32 kbps, 22.05 kHz mono: the lower-rate MPEG-2 variant used for speech, with 576 samples per frame and frame headers starting FF F3.

    • Decoders and tools that assume 44.1 kHz stereo
    • Low-bit-rate speech and podcast pipelines
  • 1 MB MP3 file (frequency sweep)

    sample-1mb.mp3 · 1 MB (1,048,576 bytes)

    A 60-second sine sweep from 20 Hz to 20 kHz at 128 kbps, padded inside its ID3v2 tag to exactly 1,048,576 bytes (1 MiB). Turn the volume down: it's a test tone.

    • Upload and size-limit tests
    • Hearing or measuring an encoder's high-frequency cutoff

Ways to test with them

  • Tag readers: sample-id3-cover.mp3 has ID3v2.4 with UTF-8 text and cover art; sample-vbr.mp3 has ID3v2.3. If one shows its title and the other doesn't, your reader doesn't support both versions.
  • Duration: the three 10-second files should report about 10 seconds. A wrong value for the VBR file means the Xing header is being ignored.
  • Detection by content: sample-no-tags.mp3 doesn't start with ID3, so it catches detectors that only look for the tag.
  • Decoder range: the 22.05 kHz mono file checks that a pipeline doesn't assume MPEG-1 at 44.1 kHz.
  • Upload limits: sample-1mb.mp3 is exactly 1 MiB, so you can test a limit at the boundary.

Free to use for testing, teaching and demos, commercially or not, with no attribution needed. A link back to this page is always appreciated.

Put it online

Have an MP3 file? Give it a link.

Drop an MP3 on 99helpers and it gets its own address that plays straight in the browser, on any phone or computer, with nothing to install. Share a podcast episode, demo or voice note as a link.

Questions

MP3 files, frequently asked

What does MP3 stand for?

MPEG Audio Layer III: the third and most advanced of the audio coding layers defined in the MPEG-1 standard. MPEG is the Moving Picture Experts Group.

Is MP3 lossless?

No. MP3 is lossy: it discards sound it predicts you won't hear. Converting an MP3 to WAV or FLAC can't restore what was removed.

What bit rate should I use for MP3?

128 kbps is a common default for music, 192 to 320 kbps or VBR -V 0 to -V 2 for higher quality, and 64 to 96 kbps mono is usually enough for speech.

How big is a one-minute MP3?

About 960 KB at 128 kbps, and 2.4 MB at 320 kbps. For CBR files the size is simply bit rate × duration ÷ 8, plus a few kilobytes for tags and cover art.

What's the difference between MP3 and MP4?

MP3 is an audio format. MP4 is a container that usually holds video plus audio (often AAC). An audio-only MP4 normally uses the .m4a extension.

Why does my MP3 show the wrong length?

It's usually a variable-bit-rate file whose Xing header is missing or out of date, so the player estimates the length from the first frame. Re-saving it with a tool that rewrites the header fixes it.

Is MP3 still patented?

No. The patents have expired and the Fraunhofer licensing programme ended in April 2017, so MP3 is free to use.

Can an MP3 file contain a virus?

An MP3 can't run code, but a malformed file could in principle exploit a bug in a player, so keep software updated. A file named song.mp3.exe is a program, not audio.

Related formats

Other file types explained

Keep going

Related

Sources

Last reviewed 27 October 2026.