ByteScope

MP3 file format

MPEG-1/2 Audio Layer III, the ubiquitous lossy audio format.

MIME type
audio/mpeg
Extensions
.mp3
Category
Audio

Magic-number signature

0x00000000494433ID3'ID3' metadata tag

Tagless MP3s instead start with an MPEG frame sync: FF followed by a byte with its top 3 bits set.

About the MP3 format

MP3 is the format that made portable digital music mainstream, using a perceptual model of hearing to discard what most listeners cannot detect and shrink audio to roughly a tenth of its raw size. It is not a container in any real sense: an MP3 file is a bare sequence of independent frames, each one about 26 milliseconds long and each carrying its own four-byte header stating its bitrate, sample rate and channel mode. There is no file-level length, no index, and no table of contents, which is why an MP3 can be cut anywhere with a text editor and still play. Almost every file in the wild is preceded by an ID3v2 tag holding the title, artist and cover art, and that tag is what supplies the recognisable ASCII at offset 0.

Header layout, byte by byte

OffsetLengthFieldMeaning
03ID3v2 identifier49 44 33, the ASCII letters ID3. This is a metadata tag bolted onto the front of the audio, not part of the MP3 format itself, and a perfectly valid MP3 may have none at all — in which case the file opens straight into a frame header.
32ID3v2 versionMajor version then revision: 03 00 for ID3v2.3 and 04 00 for ID3v2.4, the two versions in real use. The revision byte is always 00, and neither byte may be FF.
51ID3v2 flagsBit 7 marks the tag unsynchronised, bit 6 says an extended header follows, bit 5 marks it experimental, and bit 4, in version 2.4 only, says a ten-byte footer sits at the end of the tag. Most files have all of them clear.
64ID3v2 tag sizeA syncsafe integer: four bytes each with its top bit forced to zero, contributing seven usable bits, for 28 bits in total. The value excludes the ten-byte header. Writers that forget the syncsafe encoding produce a size that is too large, and the decoder then skips into the middle of the audio and loses the opening fraction of a second.
10variableID3v2 framesThe tag body, as many bytes as the size at offset 6 declared. Each frame is a four-character identifier, a size and flags: TIT2 for the title, TPE1 for the artist, TALB for the album, TSSE for the encoder, APIC for cover art. Album art routinely makes this section far larger than a minute of the audio behind it.
454First MPEG audio frame headerWhere the audio actually starts — ten bytes of ID3 header plus whatever the size at offset 6 said, so the 45 in the offset column is what a 35-byte tag gives and it moves with the tag in every other file. A frame header of FF FB 40 C0 decodes as eleven set sync bits, then MPEG version 1, layer III, no CRC; then bitrate index 4 and sample-rate index 0, meaning 56 kbps at 44100 Hz; then channel mode 3, mono.
664Xing or Info tagA pseudo-frame carrying the total frame count and a seek table, sitting inside the first audio frame after the header and the side information — 17 bytes for MPEG-1 mono, 32 for MPEG-1 stereo, 9 and 17 for MPEG-2 — which puts it 21 bytes into the frame here. It reads Xing on a variable-bitrate file and Info on a constant-bitrate one, and its absence is why some players report a wildly wrong duration.
-128128ID3v1 tagThe original metadata format, a fixed 128-byte block at the very end of the file beginning with the ASCII letters TAG, 54 41 47. Thirty bytes each for title, artist and album, four for the year, thirty for a comment and one for a genre number. It is still written for compatibility, and a decoder that does not know about it plays it as a short burst of noise.

Telling it apart from its neighbours

Easily confused withHow to tell
ADTS AACThe trap for anything testing only for a frame sync. A raw .aac file begins FF F1 or FF F9, which passes an eleven-bit sync test just as an MP3 frame does. The separator is the two layer bits, bits 2 and 1 of the second byte: MP3 has 01 for Layer III, while ADTS leaves them 00, a value MPEG-1 audio reserves and never uses. Checking the full frame header rather than the sync alone is what avoids this.
MP2/MP1Identical frame structure and the same FF Ex sync, differing only in those same layer bits — 10 for Layer II and 11 for Layer I. MP2 is still in use in broadcast, so files do turn up, and a player that assumes Layer III on any MPEG audio sync will decode noise rather than refuse.
FLACNot confusable in a hex editor, since FLAC opens with the readable ASCII fLaC, but confused constantly in practice because both extensions describe the same album. There is a real byte-level hazard here in one direction: some careless taggers write an ID3v2 tag onto the front of a FLAC file, which the FLAC specification does not permit, and the result then looks like an MP3 to any detector that stops at 49 44 33.
WAVA RIFF WAV file can contain MP3 data rather than PCM, declared by the format tag 0x0055 in its 'fmt ' chunk. Such a file begins 52 49 46 46 and is a WAV by every structural test, while the bytes inside it are ordinary MP3 frames. Renaming it to .mp3 leaves the RIFF header in place and most decoders then stumble over the first forty-odd bytes.

How these files break

  • Garbage between the tag and the first frame. A partial download, an ID3 size written wrong, or a stray block of album art leaves bytes that are not a frame header where one should be. Decoders resynchronise by scanning forward for the next FF Ex pattern, so the audio plays — after a click, and with a duration computed from the wrong starting point.
  • A variable-bitrate file with no Xing header. Without the frame count in that pseudo-frame a player has no choice but to estimate the length from the bitrate of the first frame it sees, which on a VBR file is simply wrong. The symptom is a track that says three minutes, plays for five, and seeks to the wrong place every time.
  • Truncation. Because there is no file-level length anywhere in the format, a truncated MP3 is indistinguishable from a shorter one: it plays cleanly to the cut and stops with no error at all. The only hints are the frame count in the Xing header, if there is one, and a final frame that ends before its declared length.
  • An ID3v1 tag decoded as audio. The 128-byte block at the end begins with TAG and is not a frame, so a decoder that walks frames to the end of the file and does not check for it emits a short burst of noise. It is the classic click at the end of a track ripped by older software.
  • An ID3v2 size field that is not syncsafe. Some writers put an ordinary big-endian integer at offset 6, which reads larger than the real tag because each byte can then exceed 127. The decoder skips too far, lands inside the audio, and the first fraction of a second is gone — a tagger bug that leaves the audio itself completely intact.

Where the format stands today

MP3 is technically obsolete and practically unavoidable. AAC beats it at the same bitrate and is what streaming services and every phone recording actually use; Opus beats both below 64 kbps and is what voice and real-time audio run on. None of that has displaced MP3, because the last of its patents expired in 2017 and it now enjoys something none of its successors do — every device made in the last twenty-five years plays it, with no licence, no negotiation and no fallback. That makes it the default for podcasts, for audiobooks, for anything downloaded rather than streamed, and for car stereos and cheap hardware players that will never see a firmware update. For anything you intend to edit or re-encode it is the wrong choice, because each pass through the encoder loses more, and for archival the right answer is a lossless format with the MP3 generated from it on demand.

Open MP3 files on this site

Every one of these runs in your browser — the file never leaves your machine.

Related formats

Formats that are easy to confuse with MP3 — compare their leading bytes.

FormatFirst bytesExtension
FLAC66 4C 61 43.flac
M4A66 74 79 70.m4a
Ogg4F 67 67 53.ogg
WAV52 49 46 46.wav

Frequently asked questions

What is a magic number in a file?

The first few bytes of a file, which identify its format regardless of what the name says. A PNG always starts with 89 50 4E 47; a ZIP with 50 4B 03 04. Operating systems, browsers and the file command all read these bytes rather than trusting the extension, which is why renaming a file does not change what it actually is.

How do I check a file's magic number myself?

On macOS or Linux, xxd -l 16 yourfile prints the first 16 bytes; on Windows, Format-Hex -Path yourfile -Count 16 in PowerShell. Or drop the file into the File Type Identifier on this site, which reads the bytes locally and names the format for you — nothing is uploaded.

Why do two formats share the same magic number?

Because one is built on the other. Every docx, xlsx, pptx, apk, jar and epub begins with the ZIP signature, since all of them are ZIP archives underneath; telling them apart means looking at the entries inside. Java class files and macOS universal binaries both start with CA FE BA BE and are distinguished by the field that follows.

Can a file have no magic number at all?

Yes. Text-based formats — XML, HTML, JSON, SVG, CSV — have no fixed byte signature, so they are recognized structurally instead: a leading <?xml declaration, a <svg element, or a { followed by a quoted key. That detection is a good guess rather than a certainty, which is why this reference marks those formats as probe-detected.

Does a matching magic number mean the file is safe?

No. It tells you what the format is, not whether the contents are harmless — a genuine PDF or docx can still carry a malicious payload. Identifying the true type is a useful first check, especially when the extension disagrees with the bytes, but it is not a malware scan.

Have a file that might be in the MP3 format? Identify it with the File Type Identifier — it reads the magic number locally, nothing is uploaded. Or browse all formats.