MPEG-1 Audio Layer 3 (.mp3)
.mp3 file signature | audio/mpeg
MPEG-1 Layer 3file without anID3tag or with anID3v1 tag (which is appended at the end of the file)
Magic Bytes
Offset 0
49 44 33
Sources: Apache Tika, Wikipedia, Gary Kessler, Neil Harvey FileSignatures
All Known Signatures
14 signature variants are documented for .mp3 files across multiple sources.
| Hex Signature | Offset | Sources |
|---|---|---|
| 49 44 33 | 0 | Apache Tika, Wikipedia, Gary Kessler, Neil Harvey FileSignatures |
| FF F2 | 0 | Apache Tika |
| FF F3 | 0 | Apache Tika |
| FF F4 | 0 | Apache Tika |
| FF F5 | 0 | Apache Tika |
| FF F6 | 0 | Apache Tika |
| FF F7 | 0 | Apache Tika |
| FF FA | 0 | Apache Tika |
| FF FB | 0 | Apache Tika |
| FF FC | 0 | Apache Tika |
| FF FD | 0 | Apache Tika |
| FF E3 | 0 | Apache Tika |
| FF FF | 0 | Apache Tika |
| FF FB FF F3 FF F2 | 0 | Wikipedia |
Extension
.mp3
MIME Type
audio/mpeg
Byte Offset
0
Risk Level
Safe
Validation Code
How to validate .mp3 files in Python
def is_mp3(file_path: str) -> bool:
"""Check if file is a valid MP3 by magic bytes."""
signature = bytes([0x49, 0x44, 0x33])
with open(file_path, "rb") as f:
return f.read(3) == signature
How to validate .mp3 files in Node.js
function isMP3(buffer: Buffer): boolean {
const signature = Buffer.from([0x49, 0x44, 0x33]);
return buffer.subarray(0, 3).equals(signature);
}
How to validate .mp3 files in Go
func IsMP3(data []byte) bool {
signature := []byte{0x49, 0x44, 0x33}
if len(data) < 3 {
return false
}
return bytes.Equal(data[:3], signature)
}
API Endpoint
/api/v1/mp3
curl https://filesignature.org/api/v1/mp3
See the full API documentation for all endpoints and parameters.
Frequently Asked Questions
What is a .mp3 file?
A .mp3 file is a MPEG-1 Audio Layer 3 file. MPEG-1 Layer 3file without anID3tag or with anID3v1 tag (which is appended at the end of the file)
What are the magic bytes for .mp3 files?
The magic bytes for MPEG-1 Audio Layer 3 files are 49 44 33 at byte offset 0. These bytes uniquely identify the file format regardless of the file extension.
How do I validate a .mp3 file?
To validate a .mp3 file, read the first bytes of the file and compare them against the known magic bytes (49 44 33) at offset 0. This is more reliable than checking the file extension alone, as extensions can be renamed.
What is the MIME type for .mp3 files?
The primary MIME type for .mp3 files is audio/mpeg.
Is it safe to open .mp3 files?
MPEG-1 Audio Layer 3 (.mp3) files are generally safe to open. They are classified as low risk because they primarily contain data rather than executable code. However, always ensure files come from a trusted source.