A file signature is data used to identify or verify the content of a file. Such signatures are also known as magic numbers or magic bytes and are usually inserted at the beginning of the file.
Many file formats are not intended to be read as text. If such a file is accidentally viewed as a text file, its contents will be unintelligible. However, some file signatures can be recognizable when interpreted as text. In the table below, how the file signature appears when interpreted as text in the common ISO/IEC 8859-1 encoding is shown, with unprintable characters represented as the control code abbreviation or symbol, or codepage 1252 character where available, or a box otherwise. In some cases the space character is shown as ␠.
Hex signature ISO/IEC 8859-1 Offset Extension Description23 21#! 0 Script or data to be passed to the program following the shebang (#!)02 00 5a 57 52 54 00 00 00 00 00 00 00 00 00 00␂␀ZWRT␀␀␀␀␀␀␀␀␀␀0cwkClaris Works word processing doc00 00 02 00 06 04 06 00 08 00 00 00 00 00␀␀␂␀␆␄␆␀␈␀␀␀␀␀0wk1Lotus 1-2-3 spreadsheet (v1) file00 00 1A 00 00 10 04 00 00 00 00 00␀␀␚␀␀␊␄␀␀␀␀␀0wk3Lotus 1-2-3 spreadsheet (v3) file00 00 1A 00 02 10 04 00 00 00 00 00␀␀␚␀␂␊␄␀␀␀␀␀0wk4wk5Lotus 1-2-3 spreadsheet (v4, v5) file00 00 1A 00 05 10 04␀␀␚␀␅␊␄0123Lotus 1-2-3 spreadsheet (v9) file00 00 03 F3␀␀␃ó0Amiga Hunk executable file00 00 49 49 58 50 52 (little-endian)00 00 4D 4D 58 50 52 (big-endian)␀␀IIXPR␀␀MMXPR0qxdQuark Express document50 57 53 33PWS30psafe3Password Gorilla Password DatabaseD4 C3 B2 A1 (little-endian)Ôò¡0pcapLibpcap File FormatA1 B2 C3 D4 (big-endian)¡²ÃÔ4D 3C B2 A1 (little-endian)M<²¡0pcapLibpcap File Format (nanosecond-resolution)A1 B2 3C 4D (big-endian)¡²<M0A 0D 0D 0A␊␍␍␊ 0pcapngPCAP Next Generation Dump File FormatED AB EE DBí«îÛ 0rpmRedHat Package Manager (RPM) package53 51 4C 69 74 65 20 66 6F 72 6D 61 74 20 33 00SQLite format 3␀ 0sqlitedbsqlitedbSQLite Database53 50 30 31SP01 0binAmazon Kindle Update Package49 57 41 44IWAD 0wadinternal WAD (main resource file of Doom)00␀ 0PICPIFSEAYTRIBM Storyboard bitmap fileWindows Program Information FileMac Stuffit Self-Extracting ArchiveIRIS OCR data file00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00␀␀␀␀␀␀␀␀ ␀␀␀␀␀␀␀␀ ␀␀␀␀␀␀␀␀ 11 PDB PalmPilot Database/Document FileBE BA FE CA¾ºþÊ 0 DBA Palm Desktop Calendar Archive00 01 42 44␀␁BD 0 DBA Palm Desktop To Do Archive00 01 44 54␀␁DT 0 TDA Palm Desktop Calendar Archive54 44 46 24TDF$ 0 TDF$ Telegram Desktop File54 44 45 46TDEF 0 TDEF Telegram Desktop Encrypted File00 01 00 00␀␁␀␀ 0 Palm Desktop Data File (Access format)00 00 01 00␀␀␁␀0icoComputer icon encoded in ICO file formatIcons (at MSDN)69 63 6e 73icns0icnsApple Icon Image format66 74 79 70 33 67ftyp3g43gp3g23rd Generation Partnership Project 3GPP and 3GPP2 multimedia files66 74 79 70 68 65 69 6366 74 79 70 6dftypheic4heicHigh Efficiency Image Container (HEIC)1F 9D␟□ 0 ztar.zcompressed file (often tar zip) using Lempel-Ziv-Welch algorithm1F A0␟⍽ 0 ztar.zCompressed file (often tar zip) using LZH algorithm2D 6C 68 30 2D-lh0- 2 lzh Lempel Ziv Huffman archive file Method 0 (No compression)2D 6C 68 35 2D-lh5- 2 lzh Lempel Ziv Huffman archive file Method 5 (8 KiB sliding window)42 41 43 4B 4D 49 4B 45 44 49 53 4BBACKMIKEDISK 0 bac AmiBack Amiga Backup data file49 4E 44 58INDX 0 idx AmiBack Amiga Backup index file62 70 6C 69 73 74bplist 0 plist Binary Property List file42 5A 68BZh 0 bz2 Compressed file using Bzip2 algorithm47 49 46 38 37 6147 49 46 38 39 61GIF87aGIF89a0gifImage file encoded in the Graphics Interchange Format (GIF)GRAPHICS INTERCHANGE FORMAT(sm) Version 89a49 49 2A 00 (little-endian)II*␀0tiftiffTagged Image File Format (TIFF)4D 4D 00 2A (big-endian)MM␀*49 49 2B 00 (little-endian)II+␀0tif tiffBigTIFF4D 4D 00 2B (big-endian)MM␀+049 49 2A 00 10 00 00 00 43 52II*␀␐␀␀␀CR 0 cr2 Canon RAW Format Version 2Canon's RAW format is based on TIFF.66 74 79 70 63 72 78 43 52ftypcrx 0 cr380 2A 5F D7€*_× 0 cin Kodak Cineon image52 4E 43 0152 4E 43 02RNC␁RNC␂0Compressed file using Rob Northen Compression (version 1 and 2) algorithm4E 55 52 55 49 4D 474E 55 52 55 50 41 4CNURUIMGNURUPAL0nuinupnuru ASCII/ANSI image and palette files53 44 50 58 (big-endian format)SDPX0dpxSMPTE DPX image58 50 44 53 (little-endian format)XPDS76 2F 31 01v/1␁ 0 exr OpenEXR image42 50 47 FBBPGû 0 bpg Better Portable Graphics formatFF D8 FF DBÿØÿÛ 0 jpgjpeg JPEG raw or in the JFIF or Exif file formatFF D8 FF E0 00 10 4A 46 49 46 00 01ÿØÿà␀␐JFIF␀␁FF D8 FF EEÿØÿîFF D8 FF E1 ?? ?? 45 78 69 66 00 00ÿØÿá??Exif␀␀FF D8 FF E0ÿØÿà0jpgJPEG raw or in the JFIF or Exif file format␀␀␀␌jP␠␠␍␊‡␊0jp2j2kjpfjpmjpg2j2cjpcjpxmj2 JPEG 2000 formatÿOÿQ71 6F 69 66qoif 0qoi QOI - The “Quite OK Image Format”46 4F 52 4D ?? ?? ?? ?? 49 4C 42 4DFORM????ILBM0any ilbmlbmibmiff IFF Interleaved Bitmap Image46 4F 52 4D ?? ?? ?? ?? 38 53 56 58FORM????8SVX0any 8svx8svsvxsndiff IFF 8-Bit Sampled Voice46 4F 52 4D ?? ?? ?? ?? 41 43 42 4DFORM????ACBM0any acbmiff Amiga Contiguous Bitmap46 4F 52 4D ?? ?? ?? ?? 41 4E 42 4DFORM????ANBM0any anbmiff IFF Animated Bitmap46 4F 52 4D ?? ?? ?? ?? 41 4E 49 4DFORM????ANIM0any animiff IFF CEL Animation46 4F 52 4D ?? ?? ?? ?? 46 41 58 58FORM????FAXX0any faxxfaxiff IFF Facsimile Image46 4F 52 4D ?? ?? ?? ?? 46 54 58 54FORM????FTXT0any ftxtiff IFF Formatted Text46 4F 52 4D ?? ?? ?? ?? 53 4D 55 53FORM????SMUS0any smussmumusiff IFF Simple Musical Score46 4F 52 4D ?? ?? ?? ?? 43 4D 55 53FORM????CMUS0any cmusmusiff IFF Musical Score46 4F 52 4D ?? ?? ?? ?? 59 55 56 4EFORM????YUVN0any yuvnyuviff IFF YUV Image46 4F 52 4D ?? ?? ?? ?? 46 41 4E 54FORM????FANT0any iff Amiga Fantavision Movie46 4F 52 4D ?? ?? ?? ?? 41 49 46 46FORM????AIFF0any aiffaifaifcsndiff Audio Interchange File Format4C 5A 49 50LZIP 0 lz lzip compressed file30 37 30 37 30 310707010cpiocpio "new" ASCII archive file30 37 30 37 30 320707020cpiocpio ASCII archive file with crc30 37 30 37 30 370707070cpiocpio ASCII archive file4D 5AMZ 0 exedllmuisysscrcplocxaxiecimerstspfonefi DOS MZ executable and its descendants (including NE and PE)53 4D 53 4E 46 32 30 30SMSNF200 0 ssp SmartSniff Packets File 5A 4DZM 0 exe DOS ZM executable and its descendants (rare)50 4B 03 0450 4B 05 06 (empty archive)50 4B 07 08 (spanned archive)PK␃␄PK␅␆PK␇␈ 0 zipaarapkdocxepubipajarkmzmaffmsixodpodsodtpk3pk4pptxusdzvsdxxlsxxpi