PBM file format: what it is and how to use it
PBM is the Portable Bitmap, the 1-bit member of the Netpbm family, storing pure black-and-white images in a format readable even as ASCII. Learn when to use it and what to choose instead.
-
No uploadsFiles stay on your device
-
Batch processingHandle multiple files at once
-
100% privateNo sign-up, no tracking
What is a PBM file?
A .pbm file is a black-and-white image in Portable Bitmap, the simplest of the Netpbm family: a header (P1 for ASCII or P4 for raw binary) then one bit per pixel, no gray, no color. It is the format a fax machine would understand, and the one a ten-line script can write.
When should you use PBM?
- 1-bit imagery: scanned line art, dithered output, masks.
- Teaching and tinkering: ASCII PBM is literally numbers in a text file.
- Netpbm toolchains: the classic Unix image-conversion suite.
When is another format a better fit?
For anything beyond pure black-and-white, PGM handles gray and PPM handles color. For real-world images PNG is always the answer: same data, compressed, universally readable. PBM's value is its absolute minimalism.
The short version: PBM is the 1-bit pipe format: perfect for masks and scripts. Convert to PNG for everything else.
How to open a PBM file
On Windows
Double-click the file, or open it with GIMP.
On macOS
XnView opens PBM files on macOS.
In your browser
Open PBM files right in a browser tab or with the dexrr viewer. No install, no upload.
Also opens in
-
Netpbm tools
-
ImageMagick -
GIMP
-
XnView
View PBM files
A quick preview or a new format. No install, no upload.
PBM technical details
- Full name
- Portable Bitmap
- Extensions
- .pbm
- MIME type
-
image/x-portable-bitmap - Magic bytes
-
50 31 / 50 34 (P1/P4) - Compression
- None (uncompressed)
- Developer
- Jef Poskanzer (Netpbm)
- Specification
- netpbm.sourceforge.net
PBM questions, answered
How do I open a .pbm file?
Netpbm tools, ImageMagick, GIMP and FFmpeg read it; general viewers often do not. dexrr displays and converts pbm files directly in your browser.
Can I convert PBM files online?
Yes, dexrr converts pbm locally in your browser: PBM to PNG for normal use.
Is PBM better than PNG?
Only in minimalism, as a 1-bit file trivially parsed. For actual use, PNG stores the same image compressed and readable everywhere.
What does 'P1' vs 'P4' mean in a .pbm file?
The magic number declares the encoding. P1 is ASCII (literal 0s and 1s as text), P4 is raw binary bits packed into bytes.
Is the PBM format outdated?
Stable and niche: a Unix-pipe artifact that survives because scripts still write it, not a modern image format.