What Is a PNG File? How to Open, Use and Convert It
What is a PNG file? A lossless image format with transparency, best for graphics and screenshots. Learn how to open one, PNG-8 vs PNG-24, and how to convert.
Updated
A PNG file is an image saved in the Portable Network Graphics format. It uses lossless compression, so the picture is stored exactly with no loss of quality, and it supports transparent backgrounds. PNG is the standard choice for screenshots, logos, icons and any graphic with sharp edges or text, and it opens in every browser, phone and computer without extra software.
PNG basics
- Name: Portable Network Graphics, usually pronounced "ping".
- Extension:
.png. MIME type:image/png. - Type: raster, meaning a grid of pixels.
- Compression: lossless.
- Transparency: yes, including partial transparency.
- Animation: not in standard PNG. An extension called APNG adds it, and current browsers play it.
- First published: 1996.
PNG was created in the mid-1990s as a free replacement for GIF, after a patent dispute over the compression method GIF relied on. It improved on GIF in almost every way: millions of colors instead of 256, smooth transparency instead of on or off, and better compression.
How PNG stores an image
PNG compression has two stages. First, each row of pixels is filtered: instead of storing every pixel value, the file stores how much each pixel differs from its neighbors. In flat or smoothly changing areas those differences are mostly zero. Second, the filtered data is compressed with DEFLATE, the algorithm used in ZIP files.
Both stages are fully reversible. Opening a PNG rebuilds every pixel exactly, and saving it again loses nothing. This is the key difference from JPEG, which discards information to save space. The two approaches are compared in lossy vs lossless compression.
The consequence is that PNG size depends on content. A screenshot with large flat areas compresses to a small file. A photograph, full of noise and texture, hardly compresses at all and produces a very large PNG.
How to open a PNG file
You almost certainly already can.
| Device | Opens with |
|---|---|
| Windows | Photos, Paint, any browser |
| macOS | Preview, Quick Look (press Space in Finder), any browser |
| iPhone and iPad | Photos, Files |
| Android | Gallery or Google Photos, Files |
| Linux | The default image viewer, any browser |
| Any system | Drag the file into a browser window |
If a PNG refuses to open, the usual causes are an incomplete download or a file that is not really a PNG. A file renamed to .png from another format, such as HEIC or WebP, may fail in strict software. Download it again, or open it in a browser, which identifies images by their contents instead of their name.
PNG-8 vs PNG-24 vs PNG-32
These names describe how many bits are used for each pixel. They appear in the export dialogs of image editors.
| Variant | Colors | Transparency | Typical use |
|---|---|---|---|
| PNG-8 | Up to 256, from a palette | Yes, though many tools export only on or off | Simple logos, icons, flat illustrations |
| PNG-24 | Up to 16.7 million | None | Screenshots and graphics without transparency |
| PNG-32 | Up to 16.7 million | Full alpha, 256 levels per pixel | Graphics with soft edges, shadows, glass effects |
PNG-8 files are much smaller, because each pixel is a one-byte reference to a palette entry instead of three or four bytes of color. For artwork that already has few colors, PNG-8 is identical in appearance and a fraction of the size. For gradients and photos, squeezing into 256 colors causes visible banding.
The names are used loosely. Several editors label their full-color option "PNG-24" and include transparency, which is technically PNG-32. If an export has both millions of colors and soft transparent edges, it is 32-bit whatever the menu calls it. The format also supports 16 bits per channel for specialist work.
Transparency
Transparency is the main reason people choose PNG. A full-color PNG stores an alpha value from 0 to 255 for every pixel alongside its red, green and blue values. Zero is fully transparent, 255 is fully opaque, and the values in between give soft edges, drop shadows and semi-transparent overlays that blend with whatever is behind them.
That is why a PNG logo sits cleanly on any background color while a JPG logo carries a white box around it. When you see a gray and white checkerboard behind an image in an editor, that is the editor's way of showing transparent areas. It is not part of the file.
When to use PNG, and when not to
Good uses:
- Screenshots, especially of text and interfaces.
- Logos, icons and illustrations with flat color, when an SVG is not available. See SVG vs PNG.
- Any image that needs a transparent background.
- Working copies of images you will edit and save repeatedly.
- Diagrams, charts and pixel art.
Poor uses:
- Photographs. A photo saved as PNG is commonly several times the size of a good JPG with no visible benefit.
- Large images on web pages, where WebP gives the same result in fewer bytes.
- Commercial print files. PNG stores RGB color only and has no CMYK mode, so printers usually ask for PDF or TIFF. See CMYK vs RGB.
What is a JPEG, briefly
JPEG, also written JPG, is the format built for photographs. It uses lossy compression: it reduces fine detail and color precision in ways that are hard to see, in exchange for files often a tenth the size of the same image as PNG. It has a quality setting, no transparency, and it leaves smudgy artifacts around sharp edges and text.
The short version: PNG for graphics, JPEG for photos. The full comparison, including the JPG and JPEG naming question, is in JPEG vs PNG.
Converting PNG files
PNG to JPG. Worth doing when a photo was saved as PNG, or when an upload form requires JPG. In the Image Compressor, drop in the PNG, set the output format to JPEG and adjust quality while watching the before and after preview. Transparent areas are filled with white.
PNG to WebP. The best option for web pages, since WebP keeps transparency and is smaller. The WebP Converter converts single files or batches, shows the saving for each, and downloads the set as a ZIP. Background on the format is in WebP vs PNG vs JPG.
JPG to PNG. This works, but it does not improve quality. The detail removed by JPEG is gone, and the PNG will be larger. Do it only to stop further loss while editing or to add transparency afterwards in an editor.
Making a PNG smaller
If the file has to stay a PNG, there are three options, in order of effect.
- Reduce the pixel dimensions. Halving the width and height removes three quarters of the pixels. The Image Resizer sets exact dimensions with the aspect ratio locked.
- Reduce the colors. Exporting as PNG-8 from an image editor shrinks simple graphics dramatically.
- Re-pack the file losslessly. Choosing PNG as the output in the Image Compressor recompresses the image without changing any pixel. Savings are modest but free.
Other image utilities, including cropping and background removal, are in the images category.
Try it
Drop a PNG into the Image Compressor and switch the output between PNG, JPEG and WebP. Watch the file size change with each format, and use the preview to check whether you can see any difference in the image itself.