GameParticles
Images

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.

DeviceOpens with
WindowsPhotos, Paint, any browser
macOSPreview, Quick Look (press Space in Finder), any browser
iPhone and iPadPhotos, Files
AndroidGallery or Google Photos, Files
LinuxThe default image viewer, any browser
Any systemDrag 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.

VariantColorsTransparencyTypical use
PNG-8Up to 256, from a paletteYes, though many tools export only on or offSimple logos, icons, flat illustrations
PNG-24Up to 16.7 millionNoneScreenshots and graphics without transparency
PNG-32Up to 16.7 millionFull alpha, 256 levels per pixelGraphics 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.

  1. 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.
  2. Reduce the colors. Exporting as PNG-8 from an image editor shrinks simple graphics dramatically.
  3. 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.

Tools in this guide

Frequently asked questions

How do I open a PNG file?

Double-click it. Windows opens PNG files in Photos, macOS in Preview, and phones in their gallery apps. Every web browser and image editor also opens them. If a PNG will not open, it is usually corrupted or wrongly named.

What is a JPEG file?

A JPEG, also written JPG, is an image format designed for photographs. It uses lossy compression, discarding detail the eye rarely notices, to produce files much smaller than a PNG. It does not support transparent backgrounds.

What is the difference between PNG-8 and PNG-24?

PNG-8 stores up to 256 colors chosen from a palette, giving small files for simple graphics. PNG-24 stores up to 16.7 million colors for smooth gradients and photos. PNG-32 is PNG-24 plus an alpha channel for partial transparency.

How do I convert a PNG to JPG?

Open the PNG in an image tool and export it as JPEG. In the Image Compressor, drop the file in, pick JPEG as the output format, set quality around 80 to 85 and download. Transparent areas become white, since JPG has no transparency.

More images guides

JSON Formatter
Developer · Format, validate and minify JSON with syntax highlighting.
↵
Base64 Encode / Decode
Developer · Encode text to Base64 or decode Base64 back to plain text.
↵
URL Encoder / Decoder
Developer · Encode or decode URL components and query strings.
↵
Hash Generator
Developer · Generate MD5, SHA-1, SHA-256 and SHA-512 hashes.
↵
UUID Generator
Developer · Generate UUIDs v4 (random) in bulk with one click.
↵
Regex Tester
Developer · Test regular expressions against text with live match highlighting.
↵
Word Counter
Text · Count words, characters, sentences, paragraphs and reading time.
↵
Case Converter
Text · Convert text between UPPER, lower, Title, camelCase, snake_case and more.
↵
List Sorter
Text · Sort, reverse, deduplicate and shuffle lists of text.
↵
Markdown Preview
Text · Write Markdown and see a live rendered preview side by side.
↵
Percentage Calculator
Numbers · Calculate percentages, increases, decreases and what % one number is of another.
↵
Color Converter
Colors · Convert colors between HEX, RGB, HSL and HSV instantly.
↵
Snake
Arcade · Eat food, grow longer, don't hit the walls. A timeless classic.
↵
2048
Puzzle · Slide tiles and combine them to reach the legendary 2048 tile.
↵
Word Grid
Puzzle · Guess the hidden five letter word in six tries using color clues.
↵
Sudoku
Puzzle · Fill the 9x9 grid with logic. Four difficulties from easy to expert.
↵
Minesweeper
Strategy · Use number clues to clear the minefield. Classic logic, three levels.
↵
Breakout
Arcade · Smash every brick with paddle and ball. Power-ups, combos, endless levels.
↵
Typing Practice
Casual · Build your WPM and accuracy with timed drills from 30 seconds to 5 minutes. Find your weak keys.
↵
TypeRunner
Arcade · Multiplayer typing race. Race friends by link, beat computer runners, or chase your own ghost.
↵
Typing Blocks
Arcade · Type each word before its wooden block lands. Miss, and the pile climbs toward the line.
↵
Bubble Shooter
Arcade · Aim, bank shots off the walls, and pop groups of three or more bubbles.
↵
Road Rush
Arcade · Race seven rivals through traffic and punch your way to the front.
↵