X Bitmap (Legacy MIME Alias)
image/x-xbm
Released 1988
· by MIT / X Consortium (X Window System)
The image/x-xbm MIME type is a common unofficial alias for the X Bitmap (XBM) format, a plain-text raster image format developed in the late 1980s for the X Window System (X11). Structurally formatted as valid C source code, an XBM file represents 1-bit monochrome (black and white) pixels as a static array of hexadecimal byte values that can be compiled directly into C or C++ programs. While 'image/x-xbitmap' is the more traditional long-form MIME identifier, 'image/x-xbm' is frequently encountered in legacy Apache/Nginx configurations, older web server mappings, and historic Unix application suites.
Technical Specifications
.xbm
None
image/x-xbitmapimage/xbmapplication/x-xbitmap
Magic Bytes & HTTP Headers
#define
Browser Support Matrix
| Browser | Status | Min Version |
|---|---|---|
|
|
Not Supported | — |
|
|
Not Supported | — |
|
|
Not Supported | — |
|
|
Not Supported | — |
|
|
Supported | Legacy |
Advantages & Limitations
- Can be compiled directly into C or C++ source code without needing an external file loader or binary asset manager
- Human-readable structure allows developers to inspect, edit, or hand-craft tiny icons directly within a text editor
- Extremely predictable and lightweight for 1-bit hardware displays and embedded systems
- Strictly limited to 1-bit monochrome (black and white) graphics with no gray or color support
- Text-based C syntax creates massive file bloat compared to binary 1-bit formats like PBM
- Completely deprecated in modern web browsers and desktop GUI frameworks
Developer Code Snippets
File Detection Steps
How to programmatically detect a image/x-xbm
file by reading its raw bytes:
- 1 Because XBM files are text files rather than binary files, traditional binary magic numbers do not apply.
- 2 To detect an XBM file programmatically, check if the file begins with standard C preprocessor directives, specifically the ASCII string '#define' (Hex: 23 64 65 66 69 6E 65).
- 3 When encountering 'image/x-xbm' in web server configurations or uploads, you can safely normalize it to 'image/x-xbitmap' or treat it as text-based 1-bit raster data.
Software Support
ImageMagick
Conversion Tools
Share & Embed
[](https://freewebptojpg.com/mime/image/xbm)
<iframe src="https://freewebptojpg.com/mime/image/xbm/embed" width="100%" height="280" style="border:1px solid #cbd5e1;border-radius:8px;" title="XBM Specs"></iframe>
JSON API
All data on this page is available as a free, open JSON API. Use it in your project, documentation, or tooling.
GET https://freewebptojpg.com/mime/image/xbm.json
Open JSON
Frequently Asked Questions
What is the difference between image/x-xbm and image/x-xbitmap?
There is no difference in the underlying file. Both MIME types refer to the exact same XBM (X Bitmap) file format. 'image/x-xbm' is simply a shorter shorthand alias commonly used in web server configuration files like mime.types.
Can I open an XBM file in a text editor?
Yes. Because an XBM file is literally written in C programming language syntax, you can open it in any text editor to view the image dimensions (`#define ... width/height`) and the array of hex values representing the pixels.
How do I detect an XBM file programmatically?
Because XBM files are plain-text files written in C source code rather than binary files, they lack traditional binary magic numbers. You can detect them by checking if the file begins with the ASCII string '#define'.