Skip to content

BigTIFF files; Tagged Image File Format files >4 GB (.tif)

.tif file signature | image/tiff

Tagged Image File Format file (littleendian, i.e., LSB first in the byte; Intel)

Safe

Magic Bytes

Offset 0
4D 4D 00 2A

Sources: Apache Tika, Gary Kessler, Neil Harvey FileSignatures

All Known Signatures

5 signature variants are documented for .tif files across multiple sources.

Hex Signature Offset Sources
4D 4D 00 2A 0 Apache Tika, Gary Kessler, Neil Harvey FileSignatures
49 49 2A 00 0 Apache Tika, Wikipedia, Gary Kessler
4D 4D 00 2B 0 Apache Tika, Gary Kessler
49 49 2B 00 0 Wikipedia
49 20 49 0 Gary Kessler

Extension

.tif

MIME Type

image/tiff

Byte Offset

0

Risk Level

Safe

Validation Code

How to validate .tif files in Python

Python
def is_tif(file_path: str) -> bool:
    """Check if file is a valid TIF by magic bytes."""
    signature = bytes([0x4D, 0x4D, 0x00, 0x2A])
    with open(file_path, "rb") as f:
        return f.read(4) == signature

How to validate .tif files in Node.js

Node.js
function isTIF(buffer: Buffer): boolean {
  const signature = Buffer.from([0x4D, 0x4D, 0x00, 0x2A]);
  return buffer.subarray(0, 4).equals(signature);
}

How to validate .tif files in Go

Go
func IsTIF(data []byte) bool {
    signature := []byte{0x4D, 0x4D, 0x00, 0x2A}
    if len(data) < 4 {
        return false
    }
    return bytes.Equal(data[:4], signature)
}

API Endpoint

GET /api/v1/tif
curl https://filesignature.org/api/v1/tif

See the full API documentation for all endpoints and parameters.

Frequently Asked Questions

What is a .tif file?

A .tif file is a BigTIFF files; Tagged Image File Format files >4 GB file. Tagged Image File Format file (littleendian, i.e., LSB first in the byte; Intel)

What are the magic bytes for .tif files?

The magic bytes for BigTIFF files; Tagged Image File Format files >4 GB files are 4D 4D 00 2A at byte offset 0. These bytes uniquely identify the file format regardless of the file extension.

How do I validate a .tif file?

To validate a .tif file, read the first bytes of the file and compare them against the known magic bytes (4D 4D 00 2A) at offset 0. This is more reliable than checking the file extension alone, as extensions can be renamed.

What is the MIME type for .tif files?

The primary MIME type for .tif files is image/tiff.

Is it safe to open .tif files?

BigTIFF files; Tagged Image File Format files >4 GB (.tif) 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.