DJVU

image/vnd.djvu

Safe

Magic Bytes

Offset: 0
41 54 26 54 46 4F 52 4D

DjVu is a specialized file format developed by AT&T Labs for the distribution of high-resolution scanned documents and digital images. It is primarily utilized for archiving historical texts, academic papers, and detailed manuals where maintaining high visual fidelity alongside small file sizes is essential. Although largely superseded by the PDF standard, DjVu remains a stable legacy format favored for its superior compression of scanned color documents and images without significant performance overhead.

Extension

.djvu

MIME Type

image/vnd.djvu

Byte Offset

0

Risk Level

Safe

Validation Code

How to validate .djvu files in Python

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

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);
}
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

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

Related Formats