DJVU (.djvu)
.djvu file signature | image/vnd.djvu
DjVudocumentThe following byte is either55(U) for single-page or4D(M) for multi-page documents.
Magic Bytes
Offset 0
41 54 26 54 46 4F 52 4D
Sources: Apache Tika
All Known Signatures
2 signature variants are documented for .djvu files across multiple sources.
| Hex Signature | Offset | Sources |
|---|---|---|
| 41 54 26 54 46 4F 52 4D | 0 | Apache Tika |
| 41 54 26 54 46 4F 52 4D 44 4A 56 | 0 | Wikipedia |
Extension
.djvu
MIME Type
image/vnd.djvu
Byte Offset
0
Risk Level
Safe
Validation Code
How to validate .djvu files in Python
def is_djvu(file_path: str) -> bool:
"""Check if file is a valid DJVU by magic bytes."""
signature = bytes([0x41, 0x54, 0x26, 0x54, 0x46, 0x4F, 0x52, 0x4D])
with open(file_path, "rb") as f:
return f.read(8) == signature
How to validate .djvu files in Node.js
function isDJVU(buffer: Buffer): boolean {
const signature = Buffer.from([0x41, 0x54, 0x26, 0x54, 0x46, 0x4F, 0x52, 0x4D]);
return buffer.subarray(0, 8).equals(signature);
}
How to validate .djvu files in Go
func IsDJVU(data []byte) bool {
signature := []byte{0x41, 0x54, 0x26, 0x54, 0x46, 0x4F, 0x52, 0x4D}
if len(data) < 8 {
return false
}
return bytes.Equal(data[:8], signature)
}
API Endpoint
/api/v1/djvu
curl https://filesignature.org/api/v1/djvu
See the full API documentation for all endpoints and parameters.
Frequently Asked Questions
What is a .djvu file?
A .djvu file is a DJVU file. DjVudocumentThe following byte is either55(U) for single-page or4D(M) for multi-page documents.
What are the magic bytes for .djvu files?
The magic bytes for DJVU files are 41 54 26 54 46 4F 52 4D at byte offset 0. These bytes uniquely identify the file format regardless of the file extension.
How do I validate a .djvu file?
To validate a .djvu file, read the first bytes of the file and compare them against the known magic bytes (41 54 26 54 46 4F 52 4D) at offset 0. This is more reliable than checking the file extension alone, as extensions can be renamed.
What is the MIME type for .djvu files?
The primary MIME type for .djvu files is image/vnd.djvu.
Is it safe to open .djvu files?
DJVU (.djvu) 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.