Skip to content

AIF (.aif)

.aif file signature | audio/x-aiff

Audio Interchange File Format

Safe

Magic Bytes

Offset 0
46 4F 52 4D 2E 2E 2E 2E 41 49 46 46

Sources: Apache Tika

All Known Signatures

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

Hex Signature Offset Sources
46 4F 52 4D 2E 2E 2E 2E 41 49 46 46 0 Apache Tika
46 4F 52 4D 2E 2E 2E 2E 41 49 46 43 0 Apache Tika
46 4F 52 4D 2E 2E 2E 2E 38 53 56 58 0 Apache Tika
46 4F 52 4D 00 0 Apache Tika
46 4F 52 4D 41 49 46 46 0 Wikipedia

Extension

.aif

MIME Type

audio/x-aiff

Byte Offset

0

Risk Level

Safe

Validation Code

How to validate .aif files in Python

Python
def is_aif(file_path: str) -> bool:
    """Check if file is a valid AIF by magic bytes."""
    signature = bytes([0x46, 0x4F, 0x52, 0x4D, 0x2E, 0x2E, 0x2E, 0x2E, 0x41, 0x49, 0x46, 0x46])
    with open(file_path, "rb") as f:
        return f.read(12) == signature

How to validate .aif files in Node.js

Node.js
function isAIF(buffer: Buffer): boolean {
  const signature = Buffer.from([0x46, 0x4F, 0x52, 0x4D, 0x2E, 0x2E, 0x2E, 0x2E, 0x41, 0x49, 0x46, 0x46]);
  return buffer.subarray(0, 12).equals(signature);
}

How to validate .aif files in Go

Go
func IsAIF(data []byte) bool {
    signature := []byte{0x46, 0x4F, 0x52, 0x4D, 0x2E, 0x2E, 0x2E, 0x2E, 0x41, 0x49, 0x46, 0x46}
    if len(data) < 12 {
        return false
    }
    return bytes.Equal(data[:12], signature)
}

API Endpoint

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

See the full API documentation for all endpoints and parameters.

Frequently Asked Questions

What is a .aif file?

A .aif file is a AIF file. Audio Interchange File Format

What are the magic bytes for .aif files?

The magic bytes for AIF files are 46 4F 52 4D 2E 2E 2E 2E 41 49 46 46 at byte offset 0. These bytes uniquely identify the file format regardless of the file extension.

How do I validate a .aif file?

To validate a .aif file, read the first bytes of the file and compare them against the known magic bytes (46 4F 52 4D 2E 2E 2E 2E 41 49 46 46) at offset 0. This is more reliable than checking the file extension alone, as extensions can be renamed.

What is the MIME type for .aif files?

The primary MIME type for .aif files is audio/x-aiff.

Is it safe to open .aif files?

AIF (.aif) 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.