Magic numbers are unique identifiers found at the beginning of files that help determine their format. These byte sequences enable software and operating systems to recognize file types even when the file extension is missing or incorrect. This cheat sheet lists the magic numbers for various file formats, including video, audio, image, archive, document, executable, and database files.
To check the magic number of a file in a terminal, follow these steps:
- Open a terminal.