
Drop .xbm or .xpm files here
Or choose files from your device. Everything is converted in your browser; nothing is uploaded.
Paste XBM or XPM source code
How to convert XBM or XPM to PNG
- Drop one or more
.xbmor.xpmfiles into the box above, choose them from your device, or paste the source code directly. - Check the preview. For XBM files, pick the ink and paper colors, or make the paper transparent.
- Pick a PNG size. Icons and cursors are often 16×16 or 32×32, so 4× or 8× gives you a usable image with crisp, unblurred pixels.
- Download each PNG on its own, or download every converted file at once as a ZIP.
What are XBM and XPM files?
XBM (X BitMap) and XPM (X PixMap) are image formats from the X Window System, the graphics layer behind classic UNIX and Linux desktops. Both store the picture as plain text written in C syntax, so a program could compile an icon straight into its source code. That is why you still find them in old window-manager themes, cursor sets, Emacs and Tk icons, and embedded projects.
XBM holds one bit per pixel: every pixel is either ink or paper. XPM adds a color table, so it can hold full color and transparent pixels. Neither format is supported by modern browsers or most image editors, which is why converting to PNG is the easiest way to view, edit, or share them.
| XBM | XPM | PNG | |
|---|---|---|---|
| Colors | 2 (1-bit) | Any number, from a color table | Up to 16 million plus alpha |
| Transparency | No (this tool can add it) | Yes, colors marked None | Yes, full alpha channel |
| Storage | C array of hex bytes | C array of quoted strings | Compressed binary |
| Opens in browsers | No | No | Yes |
Supported variants
This converter reads the versions of each format you are likely to run into:
- X11 XBM with
unsigned charorcharbyte arrays, the standard format since the late 1980s. - X10 XBM with 16-bit
shortarrays, used by very old X10 bitmaps. - Arduino and microcontroller XBMs, including arrays declared as
uint8_twithPROGMEM, such as images drawn with the u8g2drawXBM()function on OLED displays. - XPM3, the common C-string format that starts with
/* XPM */, with any number of characters per pixel. - XPM2, the plain-text variant that starts with
! XPM2. - XPM colors written as
#RGB,#RRGGBB, or 16-bit#RRRRGGGGBBBBhex, X11 color names such aslight slate grayorgray50, andNonefor transparency.
XBM and XPM converter FAQ
Are my files uploaded anywhere?
No. The files are read and converted by JavaScript running in your own browser. Nothing is sent to a server, so the tool also works on private or unreleased artwork.
Does the PNG keep XPM transparency?
Yes. Any XPM color defined as None becomes a fully transparent pixel in the PNG. The checkered background in the preview shows exactly which pixels are transparent.
Why is my XBM black and white? Can I change the colors?
XBM stores only one bit per pixel, so it has no colors of its own. By default set bits are drawn black on white, the X11 convention. Use the ink and paper color pickers to change them, or turn on transparent paper to get a cutout PNG.
Why does the PNG look blurry when I enlarge it?
Most viewers smooth small images when they scale them up. Use the PNG size option instead: the tool enlarges each pixel into a solid square, so an icon exported at 8× stays sharp.
I pasted an Arduino image array and got an error. What's wrong?
The converter needs the image width and height, which XBM files declare with lines like #define logo_width 128 and #define logo_height 64. Many sketches keep those numbers elsewhere, so add the two lines above the array and convert again. Also note that arrays made for the Adafruit GFX drawBitmap() function store pixels in the opposite bit order from XBM and will look scrambled.
Is the XBM or XPM hotspot kept?
Cursor files often define a hotspot, the pixel that marks the click point. PNG has no place to store it, so the tool shows the hotspot coordinates on each file card for you to note down.
Can I convert many files at once?
Yes. Drop or select as many files as you like, then use Download all as ZIP to save every PNG in one archive.
More legacy image converters
- PNM (PPM, PGM, PBM) to PNG
- Sun Raster (RAS) to PNG
- SGI RGB (IRIS) to PNG
- PCX to PNG
- TGA to PNG
- WMF to PNG
