Skip to content

Resource Interchange File Format --Windows Audio VideoInterleave file (.avi)

.avi file signature | video/x-msvideo

Resource Interchange File Format --Windows Audio VideoInterleave file, wherexx xx xx xxis the file size (little endian)

Safe

Magic Bytes

Offset 0
52 49 46 46 2E 2E 2E 2E 41 56 49 20

Sources: Apache Tika

All Known Signatures

4 signature variants are documented for .avi files across multiple sources.

Hex Signature Offset Sources
52 49 46 46 2E 2E 2E 2E 41 56 49 20 0 Apache Tika
41 56 49 20 8 Apache Tika
52 49 46 46 41 56 49 20 0 Wikipedia
52 49 46 46 41 56 49 20 4C 49 53 54 0 Gary Kessler

Extension

.avi

MIME Type

video/x-msvideo

Byte Offset

0

Risk Level

Safe

Validation Code

How to validate .avi files in Python

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

How to validate .avi files in Node.js

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

How to validate .avi files in Go

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

API Endpoint

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

See the full API documentation for all endpoints and parameters.

Frequently Asked Questions

What is a .avi file?

A .avi file is a Resource Interchange File Format --Windows Audio VideoInterleave file file. Resource Interchange File Format --Windows Audio VideoInterleave file, wherexx xx xx xxis the file size (little endian)

What are the magic bytes for .avi files?

The magic bytes for Resource Interchange File Format --Windows Audio VideoInterleave file files are 52 49 46 46 2E 2E 2E 2E 41 56 49 20 at byte offset 0. These bytes uniquely identify the file format regardless of the file extension.

How do I validate a .avi file?

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

What is the MIME type for .avi files?

The primary MIME type for .avi files is video/x-msvideo.

Is it safe to open .avi files?

Resource Interchange File Format --Windows Audio VideoInterleave file (.avi) 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.