Skip to content

XBM (.xbm)

.xbm file signature | image/x-xbitmap

Safe

Magic Bytes

Offset 0
2F 2A 20 58 50 4D

Sources: Apache Tika

Extension

.xbm

MIME Type

image/x-xbitmap

Byte Offset

0

Risk Level

Safe

Validation Code

How to validate .xbm files in Python

Python
def is_xbm(file_path: str) -> bool:
    """Check if file is a valid XBM by magic bytes."""
    signature = bytes([0x2F, 0x2A, 0x20, 0x58, 0x50, 0x4D])
    with open(file_path, "rb") as f:
        return f.read(6) == signature

How to validate .xbm files in Node.js

Node.js
function isXBM(buffer: Buffer): boolean {
  const signature = Buffer.from([0x2F, 0x2A, 0x20, 0x58, 0x50, 0x4D]);
  return buffer.subarray(0, 6).equals(signature);
}

How to validate .xbm files in Go

Go
func IsXBM(data []byte) bool {
    signature := []byte{0x2F, 0x2A, 0x20, 0x58, 0x50, 0x4D}
    if len(data) < 6 {
        return false
    }
    return bytes.Equal(data[:6], signature)
}

API Endpoint

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

See the full API documentation for all endpoints and parameters.

Frequently Asked Questions

What is a .xbm file?

A .xbm file is a XBM file.

What are the magic bytes for .xbm files?

The magic bytes for XBM files are 2F 2A 20 58 50 4D at byte offset 0. These bytes uniquely identify the file format regardless of the file extension.

How do I validate a .xbm file?

To validate a .xbm file, read the first bytes of the file and compare them against the known magic bytes (2F 2A 20 58 50 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 .xbm files?

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

Is it safe to open .xbm files?

XBM (.xbm) 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.