MP4 file signature
Magic number at offset 4 · ftyp
MP4 is an ISO Base Media file. Bytes 4 to 7 are the ftyp box type; the four bytes before it are the box size. The brand at offset 8 (isom, mp42, M4V ) tells the exact flavour.
What this magic number means
A magic number is a short, fixed run of bytes at a known position that tells a program what a file really is, no matter what the filename says. If a file contains, at offset 4, the bytes 66 74 79 70 (the text ftyp), it is a MP4 file.
The ftyp container family is huge: MP4, MOV, M4A, M4V, 3GP, HEIC and AVIF all start with an ftyp box at offset 4 and are told apart by the brand at offset 8.
Formats that use the 66 74 79 70 signature
These file types in our database carry this signature:
It is also seen in: M4A.
How to check a file's signature
You can read the first bytes of any file yourself. The magic bytes are shown in hex, the same way this page lists them.
Linux & macOS
- xxd -s 4 -l 4 example.mp4
- hexdump -C -s 4 -n 4 example.mp4
- file example.mp4
Windows (PowerShell)
- Format-Hex -Path example.mp4 -Count 16
Python
- f=open("example.mp4","rb");f.seek(4);f.read(4).hex()
In your browser
- Drop the file into the WhatFileType identifier, which reads the signature without uploading it.
Frequently asked questions
What is the MP4 file signature?
MP4 files carry, at offset 4, the hex bytes 66 74 79 70 (ftyp in ASCII). This magic number identifies the format regardless of the file's name or extension.
How do I check a file's magic number?
Open the file in a hex editor, or run a command such as xxd -l 16 example.mp4 on Linux or macOS, or Format-Hex -Path example.mp4 -Count 16 in Windows PowerShell, and read the first bytes.
Can a file fake the MP4 signature?
Renaming a file does not change its bytes, so the extension can lie but the signature usually cannot. A genuine MP4 file has these exact bytes; a file with the wrong bytes is not really MP4, whatever its name says.