Skip to content

JBIG2 (.jbig2)

.jbig2 file signature | image/x-jbig2

Safe

Magic Bytes

Offset 0
97 4A 42 32 0D 0A 1A 0A

Sources: Apache Tika

Extension

.jbig2

MIME Type

image/x-jbig2

Byte Offset

0

Risk Level

Safe

Validation Code

How to validate .jbig2 files in Python

Python
def is_jbig2(file_path: str) -> bool:
    """Check if file is a valid JBIG2 by magic bytes."""
    signature = bytes([0x97, 0x4A, 0x42, 0x32, 0x0D, 0x0A, 0x1A, 0x0A])
    with open(file_path, "rb") as f:
        return f.read(8) == signature

How to validate .jbig2 files in Node.js

Node.js
function isJBIG2(buffer: Buffer): boolean {
  const signature = Buffer.from([0x97, 0x4A, 0x42, 0x32, 0x0D, 0x0A, 0x1A, 0x0A]);
  return buffer.subarray(0, 8).equals(signature);
}

How to validate .jbig2 files in Go

Go
func IsJBIG2(data []byte) bool {
    signature := []byte{0x97, 0x4A, 0x42, 0x32, 0x0D, 0x0A, 0x1A, 0x0A}
    if len(data) < 8 {
        return false
    }
    return bytes.Equal(data[:8], signature)
}

API Endpoint

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

See the full API documentation for all endpoints and parameters.

Frequently Asked Questions

What is a .jbig2 file?

A .jbig2 file is a JBIG2 file.

What are the magic bytes for .jbig2 files?

The magic bytes for JBIG2 files are 97 4A 42 32 0D 0A 1A 0A at byte offset 0. These bytes uniquely identify the file format regardless of the file extension.

How do I validate a .jbig2 file?

To validate a .jbig2 file, read the first bytes of the file and compare them against the known magic bytes (97 4A 42 32 0D 0A 1A 0A) at offset 0. This is more reliable than checking the file extension alone, as extensions can be renamed.

What is the MIME type for .jbig2 files?

The primary MIME type for .jbig2 files is image/x-jbig2.

Is it safe to open .jbig2 files?

JBIG2 (.jbig2) 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.