JPG vs PNG vs WebP: Pick the Right Format, Then Convert, Compress or Resize

Format, dimensions and compression are three different fixes. Here is which image format suits which job, and which change actually solves your problem.

JPG vs PNG vs WebP: Pick the Right Format, Then Convert, Compress or Resize
Share this article:

An image has three properties you can change, and most "my image is wrong" problems involve the wrong one. The format (JPG, PNG, WebP) decides what kind of picture the file can hold well and whether it supports transparency. The dimensions (width × height in pixels) decide how much detail there is. The compression level decides how many bytes each pixel costs. This guide covers which format to pick, then which of the three to change for a given problem.

JPG, PNG and WebP: what each is for

FormatBest forTransparencyCompression
JPG (JPEG)Photos, anything with smooth gradientsNoLossy, adjustable quality
PNGScreenshots, logos, diagrams, textYesLossless
WebPPhotos and graphics on websitesYesLossy or lossless

JPG is the default for photos because it throws away detail your eye is unlikely to miss, in exchange for much smaller files. That loss is permanent and adds up: every time a JPG is edited and saved again, it loses a little more. Around 80% to 90% quality is a sensible range for most uses; below about 50%, blocky artifacts appear on skies and skin.

PNG keeps every pixel exactly, which is why sharp text and flat colors look clean and why it is the right choice for a logo with a transparent background. The cost is size: a photo saved as PNG is usually several times larger than the same photo as JPG, with no visible gain.

WebP does both jobs. For photos it is typically smaller than JPG at similar quality, and unlike JPG it keeps transparency. Every current major browser displays it. The catch is outside the browser: some upload forms, older desktop software and print services still reject WebP, which is the most common reason people need to convert a downloaded image back to JPG or PNG.

AVIF and HEIC: the two you receive but cannot make here

AVIF is a newer format that often beats WebP on file size. You will mostly meet it when saving images from websites. The image converter can open an AVIF in any browser that displays one and re-save it as JPG, PNG or WebP, but it cannot produce AVIF.

HEIC is what iPhones save photos as by default. It is efficient, but Windows and most Android phones and web forms do not open it without extra software. The converter can read a HEIC file only in Safari, because Safari is the only major browser that decodes HEIC. In Chrome, Edge or Firefox the file will not load. If you are on Windows or Android, the HEIC to JPG guide covers the routes that work there, and how to stop your iPhone creating HEIC files for sharing.

Convert, compress or resize?

Match the problem to the operation:

  • "This site does not accept this file type": convert. Use the image converter to re-save as PNG, JPEG or WebP. Converting does not change dimensions and does not aim for a size.
  • "The file is too large" but the dimensions are fine: compress. The image compressor re-encodes the photo as JPEG at the quality you set and keeps the same width and height. The output is always JPEG, so transparent areas in a PNG turn solid.
  • "The file is too large" and it is a full-resolution phone photo: resize first, then compress. The image resizer sets exact pixel dimensions with the aspect ratio locked.
  • "The image must be exactly 400 × 400": resize. If the photo is not square, crop it in a photo editor first; this site has no cropping tool, and unlocking the ratio to force a square squashes the picture.
  • "I need it inside an HTML email or JSON payload": encode it with image to Base64, after shrinking it, because the string is about a third larger than the file.

Two of these have output formats worth knowing. The resizer always saves a PNG (named .png), so a resized photo can come out larger in bytes than the JPEG you started with; run it through the compressor afterwards. The compressor always saves a JPEG (named .jpg), so a PNG input comes back as compressed_name.jpg.

Worked example: a phone photo for a website

You have IMG_2041.jpg straight from a phone: 4032 × 3024 pixels. It will be shown in a blog post column 1080 pixels wide.

MeasureOriginalResized to 1080 wide
Dimensions4032 × 30241080 × 810
Pixels12,192,768874,800
Share of original pixels100%7.2%
Memory once decoded (4 bytes per pixel)about 48.8 MBabout 3.5 MB

The height comes from the ratio: 3024 / 4032 = 0.75, and 1080 × 0.75 = 810. Resizing alone discards 92.8% of the pixels, none of which the reader would ever see at that column width. That is a far bigger saving than any quality slider can give you on the full-size file.

The steps: resize to 1080 wide, which downloads as PNG data; then run that file through the compressor at 80% to get a JPEG; check it full screen; and if it is still over a limit, try 70%. Always compress from the best copy you have, not from a file that was already compressed. For a strict cap, the step-by-step guide to getting an image under 100 KB goes further.

If the same image is going inline as Base64, the arithmetic continues: a 150 KB file becomes a string of roughly 200 KB, because Base64 turns every 3 bytes into 4 characters.

Converting JPG to PNG does not restore quality

A common belief is that saving a JPG as PNG "upgrades" it. It does not. PNG is lossless, so it preserves the JPG exactly as it is now, artifacts included, in a bigger file. Convert JPG to PNG when you need to edit the image repeatedly without further loss, or when a tool only accepts PNG. The JPG to PNG guide covers when that is worth it.

The reverse matters more. Converting a PNG logo with transparency to JPG fills the transparent areas with a solid color, typically black. If you need a smaller file and want to keep the transparency, convert it to WebP instead.

A privacy side effect

Re-encoding through the converter, resizer or compressor drops metadata such as the camera model and GPS location. That is useful before posting a photo taken at home. If you need to keep that information, keep the original file.

Open the image converter →

Frequently asked questions

What is the best image format for a website?

WebP for most photos and graphics, since it is small and supports transparency. Use PNG for screenshots or diagrams with fine text if WebP shows artifacts, and JPG where a platform does not accept WebP.

Why did my WebP download as a PNG?

Some browsers, notably Safari, may not be able to encode WebP and hand back a PNG instead. Try the conversion in Chrome, Edge or Firefox, and check the downloaded file's type.

Can I convert HEIC to JPG in Chrome?

Not with this converter, because Chrome cannot decode HEIC. Open the page in Safari on a Mac, iPhone or iPad, or change your iPhone camera settings to save in the Most Compatible format.

Does compressing an image change its dimensions?

No. The compressor keeps the same width and height and only re-encodes the pixels as JPEG. To change dimensions, use the resizer.

How much compression is too much?

Look at the result at full size. Blocky patches in smooth areas such as skies, or halos around edges and text, mean the quality is too low; go back one step.