XBM magic bytes (.xbm)
.xbm file signature: 23 64 65 66 69 6E 65 20 | image/x-xbitmap
Category: Images
X BitMap (XBM) is a plain-text monochrome image format created for the X Window System and historically maintained by the X Consortium, now supported by X.Org implementations. It is used for simple icons, cursor images, and small graphics in X applications, especially in environments that use lightweight text-based image assets. XBM is a legacy format and remains safe to handle, though its limited color support and text-based structure make it largely obsolete in modern workflows.
Magic Bytes
Offset 0
23 64 65 66 69 6E 65 20
Sources: X BitMap (C-macro header '#define ')
Validation Code
How to validate .xbm files in Python
def is_xbm(file_path: str) -> bool:
"""Check if file is a valid XBM by magic bytes."""
signature = bytes([0x23, 0x64, 0x65, 0x66, 0x69, 0x6E, 0x65, 0x20])
with open(file_path, "rb") as f:
return f.read(8) == signature
How to validate .xbm files in Node.js
function isXBM(buffer: Buffer): boolean {
const signature = Buffer.from([0x23, 0x64, 0x65, 0x66, 0x69, 0x6E, 0x65, 0x20]);
return buffer.subarray(0, 8).equals(signature);
}
How to validate .xbm files in Go
func IsXBM(data []byte) bool {
signature := []byte{0x23, 0x64, 0x65, 0x66, 0x69, 0x6E, 0x65, 0x20}
if len(data) < 8 {
return false
}
return bytes.Equal(data[:8], signature)
}
API Endpoint
/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 identified by the magic bytes 23 64 65 66 69 6E 65 20 at byte offset 0. X BitMap (XBM) is a plain-text monochrome image format created for the X Window System and historically maintained by the X Consortium, now supported by X.Org implementations. It is used for simple icons, cursor images, and small graphics in X applications, especially in environments that use lightweight text-based image assets. XBM is a legacy format and remains safe to handle, though its limited color support and text-based structure make it largely obsolete in modern workflows.
What are the magic bytes for .xbm files?
The magic bytes for XBM (.xbm) files are 23 64 65 66 69 6E 65 20 at byte offset 0. These bytes identify the file format more reliably than the extension alone.
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 (23 64 65 66 69 6E 65 20) 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.