Resource Interchange File Format --Windows Audio VideoInterleave file (.avi)
.avi file signature | video/x-msvideo
Audio Video Interleave (AVI) is a multimedia container format developed by Microsoft as part of the Resource Interchange File Format family. It is used to store synchronized audio and video streams for playback, editing, and archival in desktop media applications. AVI is a legacy format with limited support for modern features, but it is generally safe; as with other containers, files from untrusted sources should still be handled cautiously.
Magic Bytes
Offset 0
41 56 49 20
Sources: Wikipedia, Neil Harvey FileSignatures
All Known Signatures
5 signature variants are documented for .avi files across multiple sources.
| Hex Signature | Offset | Sources |
|---|---|---|
| 41 56 49 20 | 0 | Wikipedia, Neil Harvey FileSignatures |
| 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 | 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
def is_avi(file_path: str) -> bool:
"""Check if file is a valid AVI by magic bytes."""
signature = bytes([0x41, 0x56, 0x49, 0x20])
with open(file_path, "rb") as f:
return f.read(4) == signature
How to validate .avi files in Node.js
function isAVI(buffer: Buffer): boolean {
const signature = Buffer.from([0x41, 0x56, 0x49, 0x20]);
return buffer.subarray(0, 4).equals(signature);
}
How to validate .avi files in Go
func IsAVI(data []byte) bool {
signature := []byte{0x41, 0x56, 0x49, 0x20}
if len(data) < 4 {
return false
}
return bytes.Equal(data[:4], signature)
}
API Endpoint
/api/v1/avi
curl https://filesignature.org/api/v1/avi
See the full API documentation for all endpoints and parameters.
Related Formats
Frequently Asked Questions
What is a .avi file?
A .avi file is a Resource Interchange File Format --Windows Audio VideoInterleave file file. Audio Video Interleave (AVI) is a multimedia container format developed by Microsoft as part of the Resource Interchange File Format family. It is used to store synchronized audio and video streams for playback, editing, and archival in desktop media applications. AVI is a legacy format with limited support for modern features, but it is generally safe; as with other containers, files from untrusted sources should still be handled cautiously.
What are the magic bytes for .avi files?
The magic bytes for Resource Interchange File Format --Windows Audio VideoInterleave file files are 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 (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.