2026-07-02 · Calc-Tools Editor

Image Format Converter: JPG vs PNG vs WebP vs GIF Guide

Converting an image is rarely just a matter of changing the extension. What actually changes is the entire set of encoding rules: how pixels are stored, how color is described, whether transparency and animation can be expressed at all, and which information travels alongside the pixels. Choosing badly rarely means "a slightly larger file". It usually means text in a screenshot grows colored fringes, a transparent logo picks up a white box against a dark background, or a portrait shot on a phone arrives sideways on someone else's laptop.

This guide is not about which button to press. It gives a selection path you can follow: four questions that narrow the format down to one, then a look at what conversion irreversibly changes, and finally the cases where the right decision is not to convert at all. All file sizes quoted here are typical values; real results depend on image content and encoder settings.

1. Six Formats, Six Problems They Were Built to Solve

These formats are not versions of one another. They are answers given in different decades to different problems, and knowing why each was created supports better decisions than memorizing a parameter table.

JPEG (standardized in the early 1990s by the international standards body together with the ITU-T; the name is the abbreviation of the Joint Photographic Experts Group) assumes that neighboring pixels in a photograph are highly correlated. It transforms the image into frequency components and quantizes away most of the high-frequency ones. That trade of detail for size was the first large-scale success of lossy compression, and it is exactly why JPEG is poor at sharp line art and flat-color graphics: for those images, the discarded high frequencies are the entire content.

PNG (mid-1990s) was designed as a response to the patent dispute surrounding the compression algorithm used by GIF. Its brief was "lossless, transparent, and free of licensing encumbrance". It preserves every pixel, which is why photographs stored as PNG balloon in size, but its transparency is a true alpha channel that can express partial opacity.

GIF (introduced by CompuServe in the 1980s) combines a 256-color palette with dictionary compression. Its animation support keeps it alive for short loops, but its transparency is a single bit: a pixel is either fully transparent or fully opaque. Rounded corners and soft shadows therefore turn into hard jagged edges when converted to GIF.

WebP (introduced by Google around 2010, reusing intra-frame coding from its video codec family) offers both lossy and lossless modes and inherits alpha and animation, which makes it the broadest modern format available today.

AVIF (derived from the AV1 codec of the open media alliance) compresses more efficiently and supports higher bit depths, at the cost of noticeably longer encoding time.

SVG is not the same kind of thing at all. It records instructions for how to draw, such as shapes, paths and text, rather than what color each pixel is, so it stays sharp at any scale. That also means it cannot serve as a conversion target for photographs. Tracing a photo into SVG usually produces a larger file that looks like an approximation, which is the classic directional mistake in format selection.

2. Four Questions That Narrow the Choice to One

Selection feels difficult mainly because the questions are asked in the wrong order. The workable order is: first, is this a photograph or a graphic? Second, does it need transparency? Third, does it need animation? Only then ask about the compatibility floor. The first two questions eliminate most candidates, and the last two only decide among what remains. The typical failure from reversing the order is deciding early that WebP is the obvious answer, then discovering the file has to be handed to an older system that cannot open it.

Question 1 Photo or graphic Photo → lossy JPEG / WebP Question 2 Transparency Needed → PNG / WebP with alpha Question 3 Animation Needed → animated WebP / AVIF, GIF as fallback Question 4 Compatibility floor Legacy targets → JPEG / PNG fallback Asked in this order, the four questions usually leave one candidate; reversing them causes rework
Figure 1: The four-question order for format selection. A negative answer at one step decides whether the next question still needs asking.

Applied to real scenarios, "first choice" does not always mean "the only usable option". Once an image leaves the browser, the second choice is often the one that actually works:

ScenarioFirst choiceSecond choicePitfall to avoid
Photographs inside a web pageLossy WebPJPEGStoring as PNG for "lossless" quality: much larger and no better looking
Archiving camera or phone originalsOriginal format or high-quality JPEGPNG only if lossless is requiredRe-saving JPEG repeatedly, losing one generation each time
Screenshots, charts and text-heavy imagesPNGLossless WebPConverting to JPEG, which adds colored fringes around text
Icons and logos with transparencyPNG or WebP with alphaSVG when the source is already vectorJPEG drops transparency; GIF keeps only one-bit transparency
Short looping animationsAnimated WebP or AVIFGIFGIF has only 256 colors, so gradients and shadows band
E-commerce hero images and print deliveryHigh-quality JPEG or PNGWhatever the printer specifiesSending a web-compressed file to print, short on both resolution and color
Icon and line art that must scale freelySVGHigh-resolution PNGTracing a photograph into SVG: larger file, approximate result

WebP appears most often in the first-choice column, which reflects its coverage of lossy, lossless, transparency and animation at once. What matters more is the last column. The cost of a mistake is usually far higher than the bytes saved: a reprint, a rejected upload, or a client who cannot open a file all cost more than a few hundred kilobytes.

3. What Conversion Actually Changes

There are two kinds of conversion. Lossless re-encoding only swaps the container, leaving pixel values identical. Lossy re-encoding re-quantizes and discards information according to the encoder's judgement. Either way, the data listed below can disappear quietly, and none of it can be recovered from the output file afterwards.

ConversionUsually preservedLost or alteredTypical symptom
JPEG to PNGPixel values and compositionNothing, but no detail is added eitherFile grows several times larger and is mistaken for "sharper"
PNG to JPEGDimensions and overall lookAlpha channel and some metadataTransparent areas become white or black blocks; bright fringes on dark backgrounds
Lossy to lossy, such as JPEG to lossy WebPDimensions and general appearanceAnother generation of high-frequency detailBlock artifacts and mosquito noise accumulate with each pass
Animated image to a static formatThe first frameAll later frames and loop settingsThe animation survives as a single still image
24-bit color to GIFOutline and compositionColor count and partial transparencyGradients band and rounded edges turn jagged
Photo with metadata to a stripped exportPixelsColor profile, capture data, orientation flagWide-gamut photos look washed out; portrait shots arrive sideways
Print-oriented CMYK image for the webThe file opens normallyFaithful color renderingBrowsers generally do not render print color spaces correctly, so colors look wrong

Two categories in that table are routinely underestimated. The first is metadata. Lost capture settings are merely a pity, but a lost orientation flag turns a portrait photo sideways, and a lost ICC profile drains the color out of a wide-gamut image. Neither changes the pixel count, yet both change whether the result looks right. The second is partial transparency. An alpha channel can express values such as 50 percent opacity, while GIF transparency is strictly on or off; once the anti-aliased edge of a rounded icon is forced into those two states, a hard outline appears.

4. Three Worked Examples

Example 1: a logo with transparency. A 240 by 240 circular logo saved as PNG is a typical 18 KB, with fully transparent corners. After conversion to JPEG, every transparent pixel must be written with a definite color, and what that color is depends on the converter: most tools fill white, while some carry over the RGB value hiding behind the transparency and produce black. Either way a square appears where the circle used to be. The file does get smaller, a typical 6 KB or one third of the original, but the moment the artwork sits on anything other than a white background, that square edge shows. The correct exit for keeping transparency is lossy WebP at a typical 9 KB, about half the original, or simply staying with PNG.

Example 2: an interface screenshot. A 1200 by 800 image at 24-bit color holds 1200 x 800 x 3 = 2,880,000 bytes of pixel data uncompressed, roughly 2.75 MB. The same screenshot saved as PNG is a typical 480 KB, about 1/5.9 of the raw data, because flat areas and repeated letter shapes give dictionary compression plenty to work with. Converted to JPEG at quality 85 it becomes a typical 120 KB, which is 25 percent of the PNG, or about 75 percent saved, and roughly a 23-fold reduction against the raw pixels. The numbers look excellent, and the price is colored fringing along every letter: JPEG lowers the resolution of the color channels, so black text on white picks up red and blue edges once you zoom in. For screenshots, charts and images with text, PNG or lossless WebP remains the first choice.

Example 3: what 256 colors really means. A 24-bit image can represent 16,777,216 colors. The GIF palette holds 256, which is 0.0015 percent of that. It explains why gradients and portraits band visibly when saved as GIF, and why the same animation converted to animated WebP or AVIF looks smoother as well as smaller. The value of GIF is compatibility, not image quality.

All three examples point to the same conclusion: size, quality and compatibility cannot all be optimal at once, and the real job of conversion is deciding which one to give up. If bytes still need to come down, reducing dimensions to the actual display width usually beats further tweaking of encoder settings; see image resize and crop practices for that step.

5. Compatibility Done Properly: Fallbacks, Not Either/Or

Framing the decision as "WebP or JPEG" is too narrow. Recent browsers broadly support WebP, and AVIF support has been spreading across newer versions, but outside the browser there is a much wider world: image viewers, office suites, upload and transcoding pipelines on social platforms, and print workflows. Their support for newer formats is noticeably thinner, and you cannot control those environments or ask them to upgrade.

The standard approach on the web is to offer several sources for one image. Put the newer format first as a <source> element, optionally declaring type="image/webp", and finish with a JPEG or PNG as the fallback address on the <img> element. The browser takes the first format it understands and falls back when it understands none, all without a single line of JavaScript. Newer browsers get the smaller file, older environments still see a picture.

Two rules apply to fallbacks. First, every file inside one <picture> element must come from the same export of the original, never from re-encoding an already compressed JPEG into WebP, which stacks a second loss on top of the first without earning the size benefit. Second, CSS background images have no fallback mechanism at all, so be more conservative there, or accept the slightly larger JPEG. Inline base64 images are a similar case: they have neither fallback nor independent caching, leaving no room for trial and error, as the trade-offs in image to Base64 explain.

6. When Not to Convert

Conversion has a cost, and in the situations below the right decision is to leave the file alone:

SituationWhy conversion hurtsWhat to do instead
A master file kept for archivingThe original is the only source every later export comes fromStore it in its native format and export derivatives from it
A working file that will be edited againEach lossy save costs a generation, and the damage becomes visible after several roundsKeep working copies as PNG or lossless WebP and convert once, at delivery
A file going to a print housePrinters have their own requirements for resolution and color spaceDeliver what the printer specifies, usually not a web-compressed file
Scans of invoices or contractsCompression artifacts interfere with reading digits, stamps and signaturesUse a lossless format and keep enough resolution
Files already within their size budgetAnother pass saves little and adds a generation of lossLeave them and spend the effort on the images that actually exceed the limit
A hope that the image will look sharperLossless formats only preserve the pixels that exist; they cannot restore lost detailGo back to the original file or reshoot, rather than converting again

7. Frequently Asked Questions

After converting PNG to JPEG, why do transparent areas become white or black blocks instead of no background?
Because JPEG has no alpha channel, so every pixel must be written with a definite color. Transparent pixels usually still carry an RGB value underneath, often black or white, and a converter either keeps that value or substitutes its own fill color, which is why results vary between tools. To control the outcome, composite the transparent area onto a chosen background color before converting; for web assets, pick the same color as the page.
Will converting a photo to PNG make it sharper?
No. Lossless in PNG means no further loss is added; it cannot recover detail already discarded inside a JPEG. A typical JPEG to PNG conversion multiplies the file size several times over while the picture stays exactly as it was.
Is AVIF ready to use now?
Recent browsers support it and its compression is usually better than WebP, but support is narrower, software outside the browser is more likely to fail on it, and encoding takes noticeably longer. A safe approach is to treat it as a progressive enhancement on the web while keeping WebP or JPEG as the fallback.
Why does a photo end up sideways on my computer after conversion?
Phone cameras usually do not rotate pixels; they write an orientation flag and leave the rotation to the viewer. If a conversion drops that flag, or rewrites pixels using the wrong orientation, the photo arrives sideways. Before batch converting, check how the export handles metadata retention and automatic rotation.
Is one format per image enough on a website?
For browsers alone, one modern format is usually sufficient. The same image, however, gets copied into documents, chat windows and upload forms, where support is much thinner. For assets reused over time, keep a JPEG or PNG alongside the modern format and let multiple source declarations pick the winner.

8. Three Common Misconceptions

Misconception 1: conversion equals optimization. Conversion only changes the encoding; it does not automatically make a file smaller or sharper. PNG to PNG does not shrink anything, and JPEG to PNG does not improve quality. Content type, pixel count and encoder settings decide the size, and format is only one variable among them.

Misconception 2: standardizing everything on one format. Photographs and graphics want almost opposite things from an encoder. Photographs tolerate lost detail in exchange for high-frequency compression, while screenshots and icons need every pixel correct and happen to contain enormous repetition. Forcing everything to JPEG destroys text edges and transparency; forcing everything to PNG inflates photographs several times over. Choose per content type instead.

Misconception 3: assuming the extension describes the contents. A .jpg file may hold a CMYK color space meant for print, progressive encoding, or no metadata at all. Renaming a .png to .jpg does not turn it into a JPEG; it only confuses the software that opens it, and on some platforms the file is rejected as corrupt.

9. Five Practical Recommendations

Once the selection path becomes routine, format stops being a recurring argument: content type decides the encoding approach, transparency and animation decide the candidate list, and compatibility decides whether a fallback is needed. What remains is size tuning, which belongs to the compression step covered in the complete image compression guide. To convert a specific file and compare the results, the image format converter runs entirely in the browser.

Online Format Converter

Free to use, no download required

Use Format Converter Now

Tools