What is a File Signature?
Ask by ICSM Computer
Updated 14 May 2025
A file signature (also called a magic number) is a unique sequence of bytes at the beginning of a file that identifies its file type — regardless of the file extension.
These signatures help operating systems and applications understand the true format of a file, even if the extension is incorrect or missing.
Examples of Common File Signatures
25 50 44 46%PDF89 50 4E 47 0D 0A 1A 0AFF D8 FF47 49 46 38GIF850 4B 03 04PK..50 4B 03 04(because they are ZIP)PK..Why Use File Signature?
virus.exe.jpg).How to Detect File Type from Signature in C#
Step 1: Build a signature map
Step 2: Detect file extension by matching signature
Usage:
Limitations
.zip,.docx,.xlsx).