XBM to JPG Converter
An .xbm file from an old interface toolkit, a web page icon or a Linux icon folder will not open in your picture viewer. It looks like a snippet of C code because that is what it is. This converter reads the text, rebuilds the black and white picture and saves it in a format everything can display.
Embed this tool on your websiteShow code
Free to use on any site. Paste the code where you want the tool to appear. It runs inside the page; visitors' files are processed in their own browser and are not uploaded.
WordPress and most site builders have a "Custom HTML" block where this code can be pasted. The embed keeps a small link back to CalcMaster.
How to convert XBM to JPG
- Add your XBM files by dropping them, clicking the drop zone or pasting.
- The output format is already set to JPG. Adjust quality or size if you need to.
- Press Convert and compare the original and new size for each file.
- Download each file or all of them as a ZIP.
When to convert, and when not to
- You are working with icons or cursors from X11 software and need them as ordinary pictures.
- A program or website refuses the .xbm extension.
- You want to see what the numbers inside an .xbm file draw.
- Do not convert if the file is part of a source code project that still includes it as C code.
What changes
- The text array of numbers is turned into a picture of black and white dots.
- Dark dots in the file become black pixels and the rest become white.
- JPG can soften hard edges slightly; choose PNG for exact squares.
- Small icons stay small, so use Resize with a percentage to enlarge them.
- No colour, no transparency and no metadata exist in the file, so none are written.
A bitmap written as source code
XBM stands for X bitmap. It was designed so that a picture could be included directly in a C program. The file contains a line giving the width, a line giving the height and an array of bytes. Each byte packs eight dots, with the leftmost dot stored in the lowest bit, which is the opposite of what many people expect.
Because the file is plain text, you can open it in a notepad and read it, but you cannot see the picture that way. The converter does the decoding for you and shows a normal image.
Why the picture is black and white
An XBM holds one bit per dot, so every dot is either set or clear. There are no shades and no colour. Programs that used XBM picked the colours themselves when they drew it, for example a foreground and a background chosen by the interface.
Here the set dots are drawn black on a white background, which is the usual way to preview these files. If you need other colours, convert to PNG and recolour the result in an image editor.
Enlarging and saving the result
Icons in this format are often a few dozen dots wide. Resizing by a percentage makes each dot a larger square without adding detail, so the enlarged picture looks blocky. That is the faithful appearance of a bitmap like this.
The converter reads the common way the file is written. If the text is damaged, if the width and height lines are missing or if there are fewer bytes than the size requires, you will see an error. You can fix such a file by regenerating it from the program that made it.
Cursors and window decorations from X11 software are often stored as a pair of XBM files, one for the shape and one for the mask. This tool converts each file on its own; it does not combine a shape with its mask into one picture.
Privacy: your files stay on your device
- The tool decodes, resizes and encodes your pictures with your browser. The files are never sent to a server.
- To check it yourself: open the browser developer tools (F12), open the Network tab, convert a file, and look for any request that carries your image. You will see none.
Frequently asked questions
Why does my .xbm file look like code?
It is C source text with the size and a list of byte values. Programs can include it directly, which is why it was made that way.
Can I get a coloured result?
The file has no colour. Convert to PNG and colour the black and white picture in an editor.
Why is the result so small?
Many XBM files are icons or cursors. Use Resize with a percentage to enlarge the output.
Should I pick JPG or PNG?
PNG keeps the sharp squares exactly. JPG is fine for sharing but may soften edges.
What causes a decoding error?
A missing width or height line, or a list that holds fewer bytes than the size needs. Regenerate the file if you can.