Skip to content

DJVU (.djvu)

.djvu file signature | image/vnd.djvu

DJVU is a document and image file format developed by AT&T Labs and later published as an open specification for scanned documents and text-heavy pages. It is commonly used for digitized books, magazines, and archival materials, especially where compact storage and page-based viewing are important. The format is generally considered safe to open, though, like other complex document formats, files from untrusted sources should be handled with up-to-date viewers.

Safe

Magic Bytes

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

Sources: Apache Tika, Wikipedia

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, Wikipedia
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

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

How to validate .djvu files in Go

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

See the full API documentation for all endpoints and parameters.

Related Formats

Frequently Asked Questions

What is a .djvu file?

A .djvu file is identified by the magic bytes 41 54 26 54 46 4F 52 4D at byte offset 0. DJVU is a document and image file format developed by AT&T Labs and later published as an open specification for scanned documents and text-heavy pages. It is commonly used for digitized books, magazines, and archival materials, especially where compact storage and page-based viewing are important. The format is generally considered safe to open, though, like other complex document formats, files from untrusted sources should be handled with up-to-date viewers.

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.