DOT
application/msword
Magic Bytes
Offset: 2080
4D 69 63 72 6F 73 6F 66 74 20 57 6F 72 64 20 36 2E 30 20 44 6F 63 75 6D 65 6E 74
The DOT file format is a legacy binary document template created by Microsoft for its Word word processing software. These files store predefined styles, layouts, and formatting settings to serve as a standardized blueprint for generating multiple consistent documents across various versions of Microsoft Office. Although now largely superseded by the modern XML-based DOTX standard, DOT files remain relevant in legacy environments and archival systems for maintaining compatibility with historical document automation workflows and older business processes.
Validation Code
How to validate .dot files in Python
Python
def is_dot(file_path: str) -> bool:
"""
Check if file is a valid DOT by magic bytes.
Signature offset: 2080 bytes
"""
signature = bytes([0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66, 0x74, 0x20, 0x57, 0x6F, 0x72, 0x64, 0x20, 0x36, 0x2E, 0x30, 0x20, 0x44, 0x6F, 0x63, 0x75, 0x6D, 0x65, 0x6E, 0x74])
with open(file_path, "rb") as f:
f.seek(2080)
return f.read(27) == signature
How to validate .dot files in Node.js
Node.js
function isDOT(buffer: Buffer): boolean {
// Signature offset: 2080 bytes
const signature = Buffer.from([0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66, 0x74, 0x20, 0x57, 0x6F, 0x72, 0x64, 0x20, 0x36, 0x2E, 0x30, 0x20, 0x44, 0x6F, 0x63, 0x75, 0x6D, 0x65, 0x6E, 0x74]);
if (buffer.length < 2107) return false;
return buffer.subarray(2080, 2107).equals(signature);
}
Go
func IsDOT(data []byte) bool {
// Signature offset: 2080 bytes
signature := []byte{0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66, 0x74, 0x20, 0x57, 0x6F, 0x72, 0x64, 0x20, 0x36, 0x2E, 0x30, 0x20, 0x44, 0x6F, 0x63, 0x75, 0x6D, 0x65, 0x6E, 0x74}
if len(data) < 2107 {
return false
}
return bytes.Equal(data[2080:2107], signature)
}
API Endpoint
GET
/api/v1/dot
curl https://filesignature.org/api/v1/dot