Format Basics

What Is PPM? The Image Format You Can Open in Notepad

Most image formats are a locked box: inside are bytes only a special program can decode. PPM is the opposite. It is arguably the most honest, simplest image format in the world — its header reads as plain text, and you can assemble the picture by hand. Let's see how that's possible, and why this 1980s "dinosaur" is still very much alive.

Colorful source code on a screen — PPM is a format you can read like text
PPM is so simple its header reads like ordinary text. Photo: Pexels

What PPM is in plain English

PPM (Portable Pixmap) is a color raster image format from the Netpbm family. "Raster" means the picture is built from pixels, like a mosaic. The key word is portable: the format was designed so a file could travel between any computers and operating systems without breaking.

PPM's defining trait is its disarming simplicity. There is no compression, no clever structures, no checksums. A file has two parts: a short text header stating the image dimensions, and the pixel data — simply a list of what color each dot is. That's it. If PNG and JPG are packed suitcases, PPM is your belongings laid out on the table in order.

In short

PPM is the most direct way to store a color image: a header plus the red, green and blue values for every pixel. Easy to read, easy to write — but no space savings at all.

Where the format came from

PPM's story starts with a very mundane problem. In the mid-1980s, programmer Jef Poskanzer wanted to send images over email. The catch: email back then reliably carried only plain text (7-bit ASCII), while any "binary" data tended to get corrupted in transit. Pictures arrived broken.

The fix was brilliantly simple: let's describe the picture with ordinary text characters that email cannot mangle. That gave us PBM (for black-and-white images). By the end of 1988 Poskanzer had added PGM (grayscale) and PPM (full color), shipping them in the Pbmplus toolkit. Later, in 1993, the Netpbm library took over and is still maintained today.

So PPM was never built for quality or size — it was built for reliability and simplicity. And that philosophy — "a transparent format anyone can read" — is exactly what made it immortal in the programming world.

A project tree and code on screen — PPM was made as a format for programmers
Programmers built it for programmers: what mattered was that the file stays easy to read and write. Photo: Pexels

How a PPM file looks inside

Every PPM starts with a "magic number" — two characters telling a program exactly what it's looking at. For PPM that's P3 or P6. The rest of the header always follows the same order:

Full name
Portable Pixmap
Extension
.ppm
Family
Netpbm
Magic number
P3 (text) / P6 (binary)
Compression
None
Transparency
No

The header holds four things, separated by spaces or line breaks:

  • Magic numberP3 or P6.
  • Width of the image in pixels.
  • Height of the image in pixels.
  • Maxval — the maximum color value (usually 255). It tells the reader that "255" means full channel brightness.

Right after maxval comes a single whitespace character — and then the pixel data begins. Each pixel is described by three numbers: how much red (R), green (G) and blue (B) it has. Those three components combine into any color.

Build an image by hand: a live example

The best way to understand PPM is to see one in full. Here is a complete 3×2-pixel image in the text P3 variant. You can type it in Notepad, save it as .ppm, and it will be a real image:

P3
# This is a comment: a 3x2 pixel image
3 2
255
255   0   0     0 255   0     0   0 255
255 255   0   255 255 255     0   0   0

Let's read it the way a program would. The header says: format P3, size 3 by 2, color maximum 255. Then come six pixels (three numbers each). Top row: red (255,0,0), green (0,255,0), blue (0,0,255). Bottom row: yellow (255,255,0), white (255,255,255) and black (0,0,0). That's the entire "magic."

Lines starting with # are comments

In text PPM you can leave notes right inside the file after a #. The program ignores them, but they're handy for humans. Another expression of the format's core idea: it expects people to read it.

Why PPM doesn't compress and weighs a lot

Simplicity has a price. PPM uses no compression whatsoever: each pixel takes its full bytes. In the P6 (binary) variant, one color pixel is exactly three bytes (a byte is just a tiny unit of computer storage). The math is easy: a 4000×3000 photo takes about 36 megabytes. The same image as JPG would fit in 2–4 MB, and as PNG roughly 10–15.

There's also the P3 variant, where numbers are written as text. It's even "fatter": each value spends several characters plus spaces. The upside is that you can open and read it with your eyes. We dig into the differences across the whole family and their magic numbers in the article on the Netpbm family.

0%compression in PPM
3 bytesper pixel in P6
1988year PPM appeared
HTML markup with image tags on screen — PPM stores pixels directly, with no wrapper
No hidden layer: in PPM a number literally equals a pixel channel's brightness. Photo: Pexels

Where PPM shows up today

If the format is so "wasteful," why does it survive in the age of JPEG and WebP? The paradox is that the very simplicity makes PPM indispensable for technical tasks.

  • An intermediate format in pipelines. Image-processing programs such as ImageMagick, dcraw and ffmpeg (tools photographers and developers use) hand pictures to each other as PPM — because every one of them can read it without any extra software.
  • Programming and learning. If you're writing your first graphics algorithm, PPM is ideal: you can output a picture into it in about a dozen lines of code. We cover that in PPM in programming.
  • Scientific visualization. Where you need to keep exact values losslessly and not depend on clever formats.

How to open and convert PPM

Downloaded a .ppm file somewhere and just want to see the picture? Double-clicking it in Windows probably won't help — the system doesn't know the format. The fastest, most universal route is to convert PPM to PNG or JPG. Those open in any viewer and any browser, and the image slims down dramatically thanks to compression.

1

Upload the file

Drag your .ppm into an online converter — nothing to install.

2

Pick a format

PNG if you want lossless quality, JPG if you need the smallest file for a photo.

3

Download the result

Open, send or paste the finished picture anywhere.

Open your PPM file right now

The free FormatZ converter turns an uncompressed PPM into a compact PNG in a couple of seconds — right in your browser, with no install and no sign-up.

Convert PPM to PNG

If instead you need "raw" pixels for your own code or tool, the reverse conversion comes in handy — PNG to PPM. And the full list of available conversions is always on the all formats page.

PPM is not an obsolete format. It's a foundation format: when you need a picture anyone can understand, its simplicity becomes a superpower.
PPM stands for Portable Pixmap. It is a color raster format from the Netpbm family. The file stores an ordinary color image in the simplest possible way: a short text header followed by the red, green and blue values for every pixel.
PPM uses no compression at all. Every pixel takes up its full bytes, exactly as is. So a photo in PPM weighs many times more than the same picture as JPG or PNG. That is the price of simplicity: the format is trivial to read and write, but it does not save space.
They are three relatives from the same Netpbm family. PBM stores a black-and-white image (1 bit per pixel), PGM stores shades of gray, and PPM stores full color (RGB). They are built the same way — a text header plus pixel data — only the amount of information per pixel differs.
Often not: Windows and browsers do not display PPM by default. The easiest fix is to convert PPM to PNG or JPG — for example with the FormatZ online converter. After that the image opens anywhere, and it also shrinks dramatically thanks to compression.
Mostly in programming and image processing: PPM is so easy to parse that it is used as an intermediate format between tools like ImageMagick, dcraw and ffmpeg, and in teaching projects and scientific visualization where simplicity matters more than size.