How to open .PNM files (Netpbm images) on Android, Windows and Linux
What .pnm, .ppm, .pgm, .pbm and .pam files are and how to open Netpbm images for free on Android, Windows and Linux, and convert PPM or PGM files to PNG.

PPM, PGM and their relatives turn up in programming classes, image processing scripts, scanner tools on Linux and scientific software. They’re about the simplest image files there are, yet ordinary photo apps, and almost everything on a phone, ignore them.
Folders opens Netpbm images in its image viewer on Android, Windows and Linux, free, and decodes them itself. Colour and greyscale files are well covered; black-and-white PBM and PAM files are where support is still limited, as explained below.
What is a .PNM file?
The Netpbm formats come from Jef Poskanzer’s Pbmplus toolkit of the late 1980s, carried on today as Netpbm. They were designed to be trivially easy for programs to read and write, so tools could pass images to each other: a short text header, then the pixels, with no compression.
| Extension | What it is |
|---|---|
| .pbm | Portable bitmap: black and white, one bit per pixel |
| .pgm | Portable graymap: shades of grey |
| .ppm | Portable pixmap: full colour (red, green, blue) |
| .pnm | Portable anymap: the umbrella name; the file inside is one of the three above |
| .pam | Portable arbitrary map: a later, more general version that adds transparency and other channels |
Each file starts with a “magic number” saying which kind it is: P1, P2 and P3 for the plain-text PBM, PGM and PPM; P4, P5 and P6 for their compact binary versions; P7 for PAM. A plain PPM is readable text. This tiny file is a picture two pixels wide, one red and one blue:
P3
2 1
255
255 0 0 0 0 255
That simplicity is why the formats are loved for teaching and quick experiments, and why the files are big. A 1920 × 1080 binary PPM is about 6 MB, and a plain-text one several times more.
Where they come from: scanimage, the SANE scanner tool on Linux, writes PNM by default; potrace takes PBM as input; OpenCV, ImageMagick and countless student projects read and write them.
How to open a .PNM file with Folders
Android
- Install Folders from the download page and allow file access.
- Find the file. In the search box,
*.ppmlists the PPM files below the current folder, and*.p?mcatches all five endings at once. - Tap it to open it in the image viewer. From another app, choose Open with → Folders.
Windows and Linux
- Browse to your script’s or scanner’s output folder in Folders and double-click a file. The arrow keys step through a numbered sequence of frames.
- On Windows, right-click the file in File Explorer → Open with → Folders; the installer registers all five endings.
What you can do with Netpbm files in Folders
- View PPM and PGM files, plain or binary, and PNM files containing them, with zoom, Details, Share and Open with another app. Files with more than 8 bits per sample (a maximum value above 255) open too.
- Convert to ▸ PNG on Windows and Linux for a compact, lossless copy any program opens, or to JPEG, WebP, AVIF, HEIC, TIFF, BMP, GIF, ICO or TGA. That works for .pnm, .ppm, .pgm and .pbm files, and a folder of frames converts in one go.
The limits, honestly:
- PBM support is incomplete: binary PBMs (P4) may not open, and plain-text ones (P1) may appear with black and white swapped.
- PAM files may not open, and Convert to doesn’t take them.
For those, the Netpbm tools themselves (pamtopng, pnmtopng) or ImageMagick (magick input.pam output.png) give you a PNG in a second.
Other ways to open Netpbm files
- GIMP (free) opens and saves PBM, PGM, PPM and PNM.
- ImageMagick and the Netpbm tools on the command line read and convert all five, PAM included.
- XnView MP (Windows and Linux) and IrfanView (Windows) view them.
- Linux desktops: many image viewers open PPM and PGM straight away.
Problems opening a .PNM file?
It won’t open, or shows noise. Look at the start of the file in any text editor: the first two characters say what it really is, and for plain files the width, height and maximum value follow. A wrong width or height in the header, or a file cut short, breaks the picture.
The picture is black or nearly black. The header may declare a maximum value of 65535 while the data uses only small numbers, which happens with 16-bit sensor dumps. The image is there, just very dark; stretch the levels in GIMP.
It’s huge. There’s no compression, by design. On a computer, convert it to PNG, which keeps every pixel.
Questions people ask
What opens a .ppm file? Folders on Android, Windows and Linux; on a computer also GIMP, ImageMagick, XnView MP and many Linux image viewers.
How do I convert PPM to PNG?
On Windows or Linux, select the files in Folders and choose Convert to ▸ PNG. On the command line, pnmtopng input.ppm > output.png or magick input.ppm output.png does the same.
PPM vs PNM: what’s the difference? PNM isn’t a separate format. It’s the shared name for PBM, PGM and PPM, and a .pnm file is one of those three inside.
Why are PPM files so big? They store every pixel uncompressed, on purpose, so any program can read them with a few lines of code.
For another simple uncompressed format, see the BMP guide, or the TIFF guide for scans. Or browse all 382 file types Folders opens.
Keep reading
How to open .ARW files (Sony raw photos) on Android, Windows and Linux
What an .arw file is and how to open ARW, SRF and SR2 raw photos from Sony Alpha and Cyber-shot cameras for free on Android, Windows and Linux.
How to open .AVIF files (AV1 images) on Android, Windows and Linux
What an .avif file is, why AVIF images won't open in older software, and how to open AVIF and convert it to JPG or PNG for free on Android, Windows and Linux.
How to open .BMP files (Windows bitmap images) on Android, Windows and Linux
What a .bmp file is and how to open BMP and WBMP bitmap images for free on Android, Windows and Linux, and how to shrink a big BMP by converting it to PNG.



