.PBM

PBM File

Portable Bitmap (Netpbm black-and-white image)
Ask a question
QUICK ANSWER

A PBM file is a Portable Bitmap - a 1-bit black-and-white image from the Netpbm format family (siblings: PGM grayscale, PPM color). It comes in two variants: P1 (plain ASCII) and P4 (binary, 8x more compact). Open or convert it free with GIMP, IrfanView, or XnView MP; for sharing, convert to PNG.

Developer: Jef Poskanzer (Pbmplus / Netpbm project) Category: Raster Image Files Open standard MIME: image/x-portable-bitmap
OPENS ON Windows macOS Linux
Related: .JPG · .PNG · .TIF · .ECW

On this page

19k+ extensions indexed
Last reviewed Jul 7, 2026

Not sure what your file is?

Drop any file into our identifier - we read just the first bytes to name the format.

Identify a file

What is the PBM file format?

The .pbm (Portable Bitmap) format is the 1-bit black-and-white member of the Netpbm family of uncompressed raster formats, alongside .pgm (grayscale) and .ppm (full RGB color). Created by Jef Poskanzer in the mid-1980s as part of the Pbmplus toolkit, it is designed for maximum simplicity and portability across operating systems.

A .pbm file begins with a two-byte magic number followed by an ASCII header declaring the image dimensions, then the pixel data. Two variants exist:

  • P1 (ASCII): each pixel is the character 1 (black) or 0 (white), separated by whitespace - fully human-readable and editable in any text editor.
  • P4 (binary): pixels are packed eight per byte, most-significant bit first, making the file roughly eight times smaller than its P1 equivalent.

The color depth is strictly 1-bit - pure black and white with no grayscale levels or anti-aliasing. There is no compression, no encryption, and no checksums. This simplicity makes .pbm a reliable interchange format in fax processing, OCR pipelines, laser-printer rasterization, and computer-vision binary-mask workflows.

Virtually every major image-processing tool supports it: GIMP, ImageMagick, IrfanView, and Photoshop can all read and write .pbm. A valid P1 .pbm file can even be created by hand in a plain text editor. For modern use cases requiring small file sizes, .png is typically preferred, but .pbm remains the standard choice when a strict binary mask is required.

Security & safety

RISK: LOW

PBM is a passive, fully-documented raster image - header plus raw pixel bits, no scripts or executable content. Safe to open. Only practical concern: large uncompressed files (especially P1 ASCII) can be very large; convert to PNG to save space. No EXIF/metadata privacy risk.

Format details

in a nutshell
FULL NAMEPortable Bitmap (Netpbm black-and-white image)aka Portable Bit Map, Netpbm PBM
DEVELOPERJef Poskanzer (Pbmplus / Netpbm project)since mid-1980s (Jef Poskanzer's Pbmplus toolkit)
MIME TYPEimage/x-portable-bitmap
TYPEUncompressed Netpbm raster bi-level bitmap; ASCII (P1) or raw binary (P4) variant
STANDARDOpen · royalty-free
MAGIC BYTES · FILE SIGNATURE
OFFSET
0001
HEX
5031
ASCII
P1
P1 (50 31) = plain ASCII text variant; P4 (50 34) = raw binary variant. Siblings: P2/P5 = PGM (grayscale), P3/P6 = PPM (color RGB).

Programs that open PBM files

Windows7 apps
Adobe Photoshop Paid File > Open to load the PBM; save to any format via File > Export.
PaintShop Pro Paid File > Open the .pbm; save to any format.
GIMP Open-source File > Open the .pbm; GIMP reads both P1 and P4 variants. Export to PNG via File > Export As.
ACDSee Freemium Opens and browses PBM files in its media browser.
IrfanView Free Open the .pbm to view instantly; File > Save As or batch-convert to PNG/TIFF.
ImageMagick Open-source CLI: 'magick input.pbm output.png' to convert; 'magick identify input.pbm' to inspect.
XnView MP Free Open or browse PBM files directly; XnConvert batch-converts folders of PBM to PNG.
macOS5 apps
Adobe Photoshop Paid File > Open the .pbm; export via File > Export.
GIMP Open-source File > Open the .pbm and export to PNG/JPG.
GraphicConverter Paid Open the .pbm and convert to any common format.
Preview Built-in Double-click to open; most PBM files open directly in Preview.
Netpbm Open-source Install via Homebrew ('brew install netpbm'); use 'pbmtopng' or 'pnmtopng' to convert.
Linux4 apps
GIMP Open-source File > Open the .pbm; export to PNG/JPG.
Inkscape Open-source Can import a PBM by embedding/tracing it, but is a vector editor not a bitmap viewer - not a natural choice.
ImageMagick Open-source 'display in.pbm' to view; 'magick in.pbm out.png' to convert.
Netpbm Open-source Reference toolkit: 'pbmtopng', 'pbmtogif', 'pnmtojpeg' convert PBM to other formats.

Technical details

deep spec
Color depth1-bit (strictly black and white; no grayscale)
P1 pixel encodingASCII: each pixel stored as character '1' (black) or '0' (white), whitespace-separated
P4 pixel encodingBinary: 8 pixels packed per byte, most-significant bit first
Magic numberP1 (0x50 0x31) for ASCII variant; P4 (0x50 0x34) for binary variant
Header formatASCII text - magic number followed by width and height (whitespace-separated integers)
CompressionNone (raw uncompressed pixels)
Bit packing orderMSB-first for P4 binary variant
Sibling formats.pgm (grayscale, P2/P5), .ppm (RGB color, P3/P6); together form the Netpbm/PNM format family
MIME typeimage/x-portable-bitmap
Typical file sizeA few KB to tens of MB (P4 binary is approximately 8x smaller than equivalent P1 ASCII)
Platform supportWindows, macOS, Linux, Unix
Common use casesFax processing, OCR, laser-printer rasterization, computer-vision binary masks
Human-readabilityP1 (ASCII) variant is fully readable and editable in any text editor
Releasedmid-1980s (Jef Poskanzer's Pbmplus toolkit)
Latest versionStable since the 1990s; current Netpbm 10.x implements it (no format version bump)
Open standardYes · royalty-free
Specificationnetpbm.sourceforge.net

PBM conversions

Community Q&A

asked by users
Ask a quick question
Get help from people who work with PBM files. Be specific - include your system and software version.
No account needed · answers usually within a day

No questions yet - be the first to ask about PBM files.

Frequently asked questions

What program opens a PBM file?
The free GIMP, IrfanView and XnView MP all open PBM on Windows; GIMP and Preview work on macOS; GIMP, Netpbm and ImageMagick on Linux.
How do I convert a PBM to PNG?
Open it in IrfanView, GIMP or XnConvert and Save As PNG. From the command line: 'magick input.pbm output.png' (ImageMagick) or 'pnmtopng input.pbm > output.png' (Netpbm).
Can I open a PBM in a text editor?
Only the P1 (plain) ASCII variant is human-readable - you'll see the header and '0'/'1' characters. P4 (binary) PBMs contain packed bits and look like garbage in a text editor; use an image viewer.
What is the difference between PBM, PGM and PPM?
They are the Netpbm family: PBM = 1-bit black and white, PGM = grayscale, PPM = full RGB color. PNM and PAM are umbrella names covering all three. Magic numbers P1/P4, P2/P5, P3/P6 respectively.
What does '1 = black, 0 = white' mean - that seems backwards?
Yes, PBM uses 1 for black and 0 for white, opposite of most raster conventions, because it was designed to model ink-on-paper: 1 = ink present (black), 0 = no ink (white).
Why is my PBM file so large?
P1 (ASCII) PBM stores each pixel as a full ASCII character ('0' or '1'), giving 8 bytes per pixel - convert to P4 binary to shrink 8x, or to PNG for even smaller lossless output.

References

1Netpbm - PBM format specificationnetpbm.sourceforge.net
2Netpbm project homenetpbm.sourceforge.net

Keep exploring

across the database

Top extensions this week

1.AQQAQQ Instant Messenger File
2.CRDOWNLOADChrome Partial Download File
3.PARTPartial Download File
4.BINCD/DVD Disc Image (BIN/CUE)
5.MDMarkdown Document
6.RPMSGRestricted Permission Message
7.NOMEDIAAndroid No-Media Marker File
8.EXEWindows Executable (Portable Executable)
9.DATProgram Data File (generic)
10.TXTPlain Text File

Related extensions

.JPGJPEG Image
.PNGPortable Network Graphics
.TIFTagged Image File Format
.ECWEnhanced Compression Wavelet (ECW) image
.AVIFAV1 Image File Format (AVIF)
.JP2JPEG 2000 Image (ISO/IEC 15444-1)

Free file tools

An in-browser file identifier and image converter - everything runs on your device.

Open the toolbox

Browse file extensions A-Z