Two image files can show almost the same picture yet occupy very different amounts of storage. A photograph saved as JPEG may be much smaller than a PNG version, while a screenshot with text and flat colours can behave quite differently.

The reason is not simply that one format is newer or better. JPEG and PNG are designed to preserve image information in different ways. Understanding that difference makes it easier to choose a format for photos, screenshots, graphics, websites, and files you plan to edit again.

An image file stores more than a grid of visible pixels

A digital image can be thought of as a grid of pixels, with numerical values describing each pixel’s colour. Storing every value directly would often require more space than necessary, so common image formats use compression to represent the same visual information more efficiently.

Compression looks for ways to describe image data using fewer bits. The important question is what the compressor is allowed to discard.

PNG uses lossless compression. After a PNG is decoded, the pixel values represented by the file can be reconstructed exactly. JPEG normally uses lossy compression, which deliberately removes some image information to reduce file size.

That single distinction explains much of their everyday behaviour.

PNG keeps the decoded pixel data exact

PNG first transforms and compresses image data without intentionally throwing away pixel information. When the file is opened again, the decoder can reconstruct the stored pixels exactly.

This works especially well when an image contains predictable patterns. Consider a screenshot with a large white background, repeated interface colours, sharp text, and simple icons. Many neighbouring pixels are identical or closely related, giving lossless compression useful structure to exploit.

The result can be a reasonably compact file while keeping edges and text crisp.

Lossless does not mean that every PNG is small. A detailed photograph contains complex variations in colour and brightness across millions of pixels. Preserving all of that information exactly can require considerably more data than a lossy format needs for a visually similar result.

JPEG trades some image information for smaller files

JPEG was designed with photographic images in mind. Instead of requiring every decoded pixel to match the source exactly, JPEG can represent the image in a form that allows less visually important detail to be stored less precisely.

A simplified way to think about the process is that JPEG separates image information into patterns of brightness and colour, then represents those patterns by their spatial frequencies. During compression, some information can be quantized more aggressively than other information. This is where JPEG becomes lossy.

The encoder is not simply deleting random pixels. It is reducing precision in parts of the image representation so that the remaining data can be stored more efficiently.

That approach works well for many photographs because natural scenes contain gradual changes, texture, shadows, and fine detail. A modest amount of lost precision may be difficult to notice at normal viewing size even though it substantially reduces the amount of data that must be stored.

Why JPEG often struggles with text and sharp graphics

The same strategy that works well for photographs can become visible around hard edges.

Imagine a screenshot containing small black text on a plain white background. The transition from white to black is abrupt. With sufficiently strong JPEG compression, the reconstructed image can develop small distortions around that edge. Text may look slightly fuzzy, and blocks or ringing patterns can appear near high-contrast shapes.

PNG does not introduce this kind of lossy compression artifact because it preserves the stored pixel values exactly.

This is why PNG is often a practical choice for screenshots, diagrams, interface elements, logos, and graphics with flat areas and sharp boundaries. It is not because PNG inherently makes every graphic look better; it is because its lossless design fits content where exact edges matter.

Why a PNG photograph can be much larger

Suppose a phone photo contains leaves, hair, fabric, clouds, reflections, and subtle noise from the camera sensor. Almost every small region contains variations.

PNG must preserve those variations. It can compress repeated or predictable information, but it cannot decide that a tiny colour difference is unimportant and discard it.

JPEG has that option. At a sensible quality setting, it can reduce precision in fine image detail while retaining the overall appearance. The resulting file can therefore be much smaller.

There is no fixed ratio such as “JPEG is five times smaller than PNG.” File size depends on dimensions, image content, encoder settings, metadata, colour representation, and the software creating the file. Two images with the same pixel dimensions can compress very differently.

JPEG quality is a trade-off, not a universal percentage

Many applications expose a JPEG setting labelled quality, sometimes using a scale such as 1 to 100. It is tempting to treat that number as a standardized measurement, but it is not.

Different encoders can interpret the same quality number differently. A setting of 80 in one application does not guarantee the same compression decisions, file size, or visual result as 80 in another.

Within one application, however, lowering the quality setting generally means stronger lossy compression. The file usually becomes smaller, while compression artifacts become more likely to be visible.

The useful question is therefore not “What is the correct JPEG quality number?” but “At what setting does this particular image remain good enough for its intended use?”

A small image viewed on a phone may tolerate more compression than a photograph intended for a large display or later editing.

Re-saving a JPEG can cause additional loss

Opening a JPEG does not by itself damage it. The important step is decoding and then encoding it as JPEG again.

Because JPEG compression is lossy, another save can introduce another round of quantization. Repeated editing and re-saving can gradually add visible artifacts, especially when strong compression is used.

For an image that will go through several editing stages, it can be useful to keep a high-quality original or work in a lossless editing format, then create the final JPEG when a smaller delivery file is needed.

Converting an existing JPEG to PNG does not restore information that the JPEG already discarded. The PNG can preserve the pixels produced by decoding that JPEG, but it cannot reconstruct missing original detail simply because the new container is lossless.

PNG also supports transparency differently

PNG can store an alpha channel, which allows pixels to have varying levels of transparency. This is useful for interface graphics, overlays, icons, and images that need to blend into different backgrounds.

Traditional JPEG does not provide an alpha channel. A JPEG image is therefore normally rectangular with fully opaque pixels.

Transparency alone is not a reason to convert every image to PNG. If a photograph does not need transparency, a photographic format with lossy compression may still be more storage-efficient.

The file extension does not tell you the whole quality story

A .jpg file is not automatically low quality, and a .png file is not automatically high quality.

A carefully encoded JPEG can preserve a photograph extremely well for its intended viewing size. A PNG can preserve its stored pixels exactly but still contain a low-resolution, blurred, or previously compressed source image. The format cannot create detail that was never present.

Image dimensions matter too. A 4000-by-3000 image contains 12 million pixels, while a 1000-by-750 version contains 750,000. Reducing dimensions can have a major effect on file size regardless of format, although the exact reduction depends on the image and compression settings.

So image quality has several separate dimensions: resolution, source quality, compression artifacts, colour handling, and the requirements of the final display or print.

A practical way to choose between JPEG and PNG

For ordinary use, start with the kind of image rather than the file extension you are accustomed to.

JPEG is usually a sensible choice for photographs when smaller files matter and a small amount of irreversible compression is acceptable. Examples include photos shared online, image galleries, and photographic attachments where exact pixel preservation is unnecessary.

PNG is usually a sensible choice for screenshots and graphics with sharp edges when preserving exact stored pixels is useful. It is also appropriate when you need alpha transparency or when a lossless copy is important for the workflow.

These are guidelines rather than absolute rules. A complex PNG can be large, and a heavily compressed JPEG can look poor. Other formats such as WebP, AVIF, and HEIF/HEIC provide additional combinations of features and compression techniques, but JPEG and PNG remain useful for understanding the basic trade-off between lossy photographic compression and lossless image storage.

Smaller is useful only when the image still serves its purpose

Image compression is a balance between storage, transfer time, compatibility, and visual fidelity. JPEG can make photographic images compact by accepting controlled information loss. PNG preserves its decoded pixel data exactly and often suits images whose sharp edges or transparency need that behaviour.

Neither format wins every comparison. Choose JPEG when photographic content can tolerate lossy compression in exchange for a smaller file. Choose PNG when preserving exact pixel values, sharp graphics, or transparency matters more than minimizing storage.

Once you separate what the image contains from how the format compresses it, the large difference between two seemingly identical image files becomes much easier to understand.