QCOW
application/octet-stream
Magic Bytes
Offset: 0
51 46 49
QCOW (QEMU Copy-On-Write) is a disk image file format developed by the QEMU open-source project for use with its hypervisor. It is primarily used to represent the storage contents of virtual machines, supporting features like snapshots and thin provisioning by only allocating storage as needed. While this original version is now largely considered legacy, having been replaced by the updated QCOW2 format, it remains a stable and safe container for virtualized data.
Validation Code
How to validate .qcow files in Python
Python
def is_qcow(file_path: str) -> bool:
"""Check if file is a valid QCOW by magic bytes."""
signature = bytes([0x51, 0x46, 0x49])
with open(file_path, "rb") as f:
return f.read(3) == signature
How to validate .qcow files in Node.js
Node.js
function isQCOW(buffer: Buffer): boolean {
const signature = Buffer.from([0x51, 0x46, 0x49]);
return buffer.subarray(0, 3).equals(signature);
}
Go
func IsQCOW(data []byte) bool {
signature := []byte{0x51, 0x46, 0x49}
if len(data) < 3 {
return false
}
return bytes.Equal(data[:3], signature)
}
API Endpoint
GET
/api/v1/qcow
curl https://filesignature.org/api/v1/qcow