Image file formats explained

A practical guide · Updated June 2026

Hundreds of image formats have been invented. You will meet about ten. The three or four letters after the dot are the entire user interface for a set of engineering decisions somebody made on your behalf: whether detail was thrown away to save space, whether the picture can have a transparent background, whether it can move, and how many programs on Earth can open it.

This page is a reference for all ten — JPG, PNG, WebP, GIF, SVG, HEIC, TIFF, BMP, AVIF and RAW. For each one: what it is, where you run into it, and what to convert it to when it lands somewhere it does not belong.

The five questions that separate one format from another

Formats look bewildering until you notice they only differ along a handful of axes. Every entry in the table below is just a different set of answers to these five questions:

There is a quieter sixth axis: metadata. JPG, HEIC, TIFF and most RAW files carry EXIF data — camera model, timestamp, and often GPS coordinates. PNG and BMP usually do not. If you publish photos straight from a phone, that is worth knowing about; our guide on removing EXIF data covers what to do.

All ten formats at a glance

Sizes below are for the same 1200 × 800 photograph exported at roughly equivalent visual quality, so the numbers are comparable to each other rather than absolute. SVG and RAW are marked separately because they are not the same kind of thing.

FormatBest forLossy or losslessTransparencyAnimationTypical sizeConvert to
JPG / JPEGPhotographs, universal sharingAlways lossyNoNo~170 KBWebP for the web
PNGScreenshots, logos, sharp textLosslessYes, 8-bit alphaNo (APNG is an extension)~1.6 MBWebP, or SVG if it is a logo
WebPAlmost anything on a modern siteBothYesYes~120 KBNothing — this is the destination
GIFShort loops, memes, simple animationLossless within 256 coloursOn/off only, no soft edgesYes~610 KB, visibly degradedMP4 or animated WebP
SVGLogos, icons, charts, line artNeither — it is vector codeYesYes, via CSS1–20 KB for an iconPNG only when a raster is required
HEIC / HEIFiPhone camera rollLossy in practiceYesYes, Live Photo sequences~95 KBJPG to share, WebP to publish
TIFFScanning, print, archival mastersUsually losslessYesMulti-page, not animated~2.9 MBWebP or JPG to publish
BMPNothing, in 2026UncompressedTechnically, rarely honouredNo~2.8 MBPNG or WebP immediately
AVIFSqueezing the last bytes out of photosBothYesYes~85 KBNothing, but keep a WebP fallback
RAW (CR3, NEF, ARW, DNG)Editing before anything else happensUnprocessed sensor dataNoNo~25 MB per frameDNG to archive, WebP to publish

Read down the size column and the whole argument makes itself: the same picture ranges from 85 KB to 25 MB depending only on the container you put it in. Read down the "convert to" column and you get the short version of this entire article.

The photographic formats

JPG — the default for thirty years

JPG throws away detail in a way tuned to human vision: it keeps brightness edges and discards fine colour variation, because your eye is far more sensitive to the former. At quality 80 that trade is invisible on a photograph and cuts the file by roughly 95% against uncompressed. Its weaknesses are equally consistent — no transparency, visible blocky artefacts around hard text, and generation loss if you keep opening and re-saving the same file.

HEIC — what your iPhone actually shoots

HEIC is a HEIF container wrapping HEVC-compressed frames, and it has been the iPhone default since iOS 11 in 2017. It holds about the same visual quality as JPG in roughly half the bytes, plus 10-bit colour, transparency and Live Photo sequences. The catch is compatibility: plenty of Windows apps, older CMS uploaders and web forms still reject it, which is why converting HEIC to JPG is one of the most common conversions people need.

AVIF — the current efficiency champion

AVIF stores a still frame using the AV1 video codec. At matched quality it lands around 30% below WebP and close to 50% below JPG, with 10-bit colour and HDR support. Browser support arrived in Chrome in 2020, Firefox in 2021, Safari in 2022 and Edge in 2024, so in 2026 every current browser handles it — but "current browser" is doing real work in that sentence, and desktop software support still lags. Serve it with a WebP or JPG fallback rather than as your only copy.

RAW — not really an image yet

A RAW file (.CR3 from Canon, .NEF from Nikon, .ARW from Sony, .DNG as the open standard) is a dump of sensor readings, not a picture. It carries 12 or 14 bits per channel instead of 8, which is why you can rescue a blown sky in an editor and cannot in a JPG. It also runs 20–60 MB per frame and cannot be displayed by a browser at all. Treat RAW as a negative: archive it, export from it, never upload it.

The graphics formats

PNG — pixel-perfect, and heavy

PNG compresses losslessly, so a screenshot's text stays crisp and a logo's edges stay clean. It also supports a full 8-bit alpha channel, meaning soft, anti-aliased transparency rather than a jagged cutout. The cost is size: as the table shows, the same photograph is roughly ten times larger as a PNG than a JPG. A useful middle ground most people miss is PNG-8, which quantises the image to a 256-colour palette and often halves the file with no visible change on flat-colour graphics. If you are sitting on a folder of oversized PNGs, converting PNG to JPG is the fastest fix — provided none of them need transparency.

GIF — kept alive by culture, not merit

GIF is a 1987 format limited to 256 colours per frame with on/off transparency and no partial opacity. Its animation support is the only reason it survived. It is also spectacularly inefficient: a three-second screen recording that would be 400 KB as an MP4 routinely runs 8 MB as a GIF. Use it only where the platform accepts nothing else, and convert to MP4 or animated WebP everywhere you can.

SVG — the one that is not pixels

An SVG is a text file describing shapes: lines, curves, fills. Because it is instructions rather than a grid of pixels, it renders perfectly sharp at any size on any screen, from a 16-pixel favicon to a billboard. A typical icon is 1–4 KB, a logo maybe 10–20 KB, and you can restyle colours with CSS. It is the correct answer for every logo, icon and diagram — and completely useless for photographs, since a photo has no shapes to describe. One caution: SVG is code, so only accept SVG uploads from sources you trust.

The all-rounder and the leftovers

WebP — the sensible default

WebP is the only format on the list that does everything the web needs: lossy and lossless modes, full alpha transparency, animation, and universal browser support. At matched quality it runs 25–35% below JPG. We cover it in depth in what is a WebP file, and the head-to-head reasoning in JPG vs PNG vs WebP, so the one-line summary here is simply: if a picture is going on a website and you have no specific reason to choose otherwise, make it WebP.

TIFF — the print and archive workhorse

TIFF is a flexible container, usually holding uncompressed or losslessly compressed data at high bit depth, often with multiple pages in one file. Scanners, print shops and museums use it because it preserves everything and nobody worries about compatibility in 30 years. A single 600 dpi A4 scan can easily reach 40 MB. Keep the TIFF as your master; publish something else.

BMP — a historical artefact

A BMP stores raw pixels with almost no compression: multiply width by height by three bytes and you have the file size, so 1920 × 1080 is about 6 MB regardless of content. It exists because early Windows needed something trivial to read. If a BMP arrives from an old scanner or a legacy system, convert it to PNG for an identical, lossless, far smaller copy.

The extension is a label, not a fact

Renaming photo.png to photo.jpg does not convert anything — it just makes the label lie, and half the time the receiving software will reject the file or open it as garbage. The real format lives in the first few bytes, called the magic number. If you ever need to check what a file actually is, open it in any text editor and look at the very start:

FormatFirst bytes (hex)What you see in a text editor
JPGFF D8 FFUnreadable, often starts with ÿØÿ
PNG89 50 4E 47.PNG
GIF47 49 46 38GIF8
WebP52 49 46 46 … 57 45 42 50RIFF then WEBP
BMP42 4DBM
TIFF49 49 2A 00 or 4D 4D 00 2AII* or MM
HEIC… 66 74 79 70 68 65 69 63ftypheic a few bytes in
AVIF… 66 74 79 70 61 76 69 66ftypavif a few bytes in
SVG3C 3F 78 6D 6C or 3C 73 76 67<?xml or <svg — it is plain text

Most RAW formats are TIFF-based, so they also begin with II*; Canon's CR3 is the exception and shows ftypcrx. This one trick explains a surprising number of "why won't this upload" problems: the file is a PNG wearing a JPG name badge.

A worked example: auditing one project folder

Here is a real-shaped scenario. A small team has an assets folder for a website refresh containing 43 files:

That is 515 MB, and someone was about to drag most of it into a CMS. Applying the "convert to" column instead:

  1. The 12 HEIC photos become WebP at 1200 px wide, quality 80 — about 110 KB each, 1.3 MB total.
  2. The 8 RAW frames stay archived on disk. Only the exports ship: WebP at 1600 px, about 180 KB each, 1.4 MB.
  3. The 15 screenshots are resized to 1400 px wide and exported as WebP at quality 90 — text stays crisp at roughly 180 KB each, 2.7 MB. Lossless WebP saves only about a quarter against PNG, so it would leave each file near 1.4 MB.
  4. The 5 TIFF masters stay put; published copies go out as WebP at about 400 KB each, 2 MB.
  5. The 3 GIFs become MP4 clips at about 1.1 MB each, 3.3 MB.

The published set totals roughly 10.7 MB instead of 515 MB — about a 48× reduction — and nothing was lost, because the RAW and TIFF masters never left the archive. That gap between "the file I have" and "the file I should upload" is where nearly all image bloat lives.

Formats you will meet but should not publish

Frequently asked questions

How many image file formats are there, and which ones actually matter?

Hundreds have been invented, but ten cover almost everything you will ever open: JPG, PNG, WebP, GIF, SVG, HEIC, TIFF, BMP, AVIF and RAW. Of those, only four are worth publishing on a website — WebP, AVIF, JPG and SVG. The rest are camera formats, print formats or historical leftovers that you should convert before they reach a visitor.

What is the difference between a lossy and a lossless image format?

A lossy format such as JPG permanently discards detail your eye is unlikely to notice, which is how it turns a 2.9 MB image into a 170 KB one. A lossless format such as PNG stores every pixel exactly, so the file you open is identical to the one you saved. Lossy is right for photographs, lossless is right for logos, screenshots and anything with sharp text or flat colour.

Which image format should I use in 2026?

For photographs and most graphics on a website, use WebP — it is supported everywhere and typically 25–35% smaller than JPG. Use SVG for logos, icons and line art. Keep JPG as a fallback when a file has to open in old software, and PNG when you need pixel-perfect lossless quality. AVIF is smaller still and worth serving alongside WebP if your platform supports fallbacks.

Try the free tool — in your browser

Every conversion in the table above takes seconds, and nothing leaves your device — the work happens in your browser, so your files are never uploaded to a server:

If you want the reasoning behind the three formats you will use most, read JPG vs PNG vs WebP next, or what is a WebP file for the format that should be your default. For the dimensions and kilobyte budgets to aim at once you have picked a format, see the best image size for a website.