PNG to GIF Converter
- The picture is mapped onto at most 256 colours, so smooth gradients break into bands or dither patterns. A picture that already uses 256 or fewer keeps every one exactly.
- The Exif data, the colour profile and anything else the original carried are not passed on: the picture is decoded to plain pixels and a new file is written from them.
- A GIF pixel is either clear or opaque. A pixel less than half opaque (alpha below 128) becomes clear, and any other partly clear pixel is laid onto #FFFFFF, so a soft edge turns hard.
- An animated PNG comes through as one picture — the image the format names as its default, or the first frame where it names none.
- Writes at most 256 colours and one clear entry, and refuses a picture larger than 16,000,000 pixels.
Needs JavaScript. Runs only here.
This page turns a PNG into a GIF on your own machine. Every conversion on this page runs in your browser. The picture is read, drawn and written on your own machine, and the file is not sent to a server.
Going the other way? Convert GIF back to PNG →
How do you convert a PNG to a GIF?
A GIF holds at most 256 colours and one fully clear entry. Writing a PNG as a GIF maps its colours onto that palette and turns every soft edge into a hard one.
A PNG with more than 256 colours is reduced to a palette of 256, so smooth gradients break into bands or dither patterns; one with fewer keeps them exactly. Partly transparent pixels cannot survive: GIF stores one fully clear colour and nothing in between.
- Choose the PNG file you want to convert. It is read inside this page, on your own machine.
- Pick the colour that partly clear pixels are laid onto. A pixel less than half opaque becomes fully clear instead, and this page starts at #FFFFFF.
- Leave dithering on for photographs and gradients, or turn it off for flat graphics. A picture with 256 colours or fewer keeps every colour either way.
- Select Convert to GIF. The palette is chosen and the file is written by this page, in your browser, because no browser has a GIF writer of its own.
- Download the GIF. Nothing has been sent anywhere, so the file is ready as soon as it is written.
PNG to GIF trades colours and soft edges for a palette, so to convert between image formats without losing either, compare the other pairs.
What Changes From PNG to GIF
PNG to GIF reduces the picture to at most 256 colours and dithers where it has to. Partly transparent pixels cannot survive, because GIF has one clear palette entry and no shades between.
Each row below is one property of the picture: what it is in the PNG, what it becomes in the GIF, and whether it survives the trip. Convert a file and the same rows fill in with the measurements from your own picture.
| Property | In the PNG | In the GIF | Verdict |
|---|---|---|---|
| Dimensions | as the file has them | as the file has them | kept |
| Colour model and bit depth | RGB with alpha, 8 bits per channel | palette indices, at most 256 colours; each colour in the table is 8 bits per channel | changed |
| Alpha channel | present, with any level of transparency | one clear entry: alpha below 128 becomes clear, other partly clear pixels are laid onto #FFFFFF | changed |
| Colours used | up to 16,777,216 | at most 256; a picture with 256 or fewer keeps every one | lost |
| Animation frames | 1, or several — PNG can carry an animation | 1 — the format’s default image, or the first frame where it names none | changed |
| Metadata (Exif, ICC) | present in the file | dropped — a new file is written from pixels | lost |
| Compression | lossless, deflate | variable-length-code LZW over palette indices | changed |
| File size | the file you chose | depends on the picture — both sizes print once you convert | changed |
the pixels survive; the colours beyond the palette and the Exif data do not.
Going Back to PNG
Converting back does not restore what this step dropped, so convert the GIF result back to PNG only when you need a PNG file.
The change above runs one way — go back from GIF to PNG writes a new file, not the original.
What Travels With the Picture
What the two formats are, and what the browser does with a picture on the way between them. None of this depends on which PNG you bring.
How PNG and GIF Are Defined
| Property | PNG | GIF |
|---|---|---|
| Compression | lossless - deflate with a sliding window of at most 32768 bytes (compression method 0) | variable-length-code LZW over palette indices; the coding step is exactly invertible, so nothing is lost after the picture has been reduced to the palette |
| Alpha channel | yes - a full alpha channel on colour types 4 and 6; a tRNS chunk gives a transparent colour key on types 0 and 2 and per-entry alpha on type 3 | none - one palette entry may be marked transparent and is skipped when drawn |
| Animation | yes - APNG is normative in the Third Edition, using the acTL, fcTL and fdAT chunks | yes - several images in one data stream, each preceded by a Graphic Control Extension whose Delay Time is in hundredths of a second. Looping is not part of the specification. |
| In one sentence | PNG stores a picture without losing anything: the specification defines lossless as reconstructing the original data exactly, bit for bit. It carries an alpha channel, and since the Third Edition it can carry frame-based animation as well. | A GIF draws every pixel from a colour table of at most 256 entries. Transparency is one of those entries marked clear, so a pixel is either wholly transparent or wholly opaque. |
- A PNG file begins 89 50 4E 47 0D 0A 1A 0A.
- A GIF file begins 47 49 46 38 39 61 ("GIF89a") or 47 49 46 38 37 61 ("GIF87a").
- PNG is defined by PNG Specification (Third Edition), W3C Recommendation 24 June 2025; the Second Edition is ISO/IEC 15948:2004. The Third Edition is not itself an International Standard..
- GIF is defined by Graphics Interchange Format Version 89a (CompuServe, 1990).
PNG, GIF, WebP and ICO can carry transparency; JPEG cannot, because the standard defines no alpha channel, and a bitmap written here is opaque. Converting to a format without transparency fills the clear areas with a background colour.
A GIF holds at most 256 colours at a time. A picture with more than that is mapped onto the palette, which is why smooth gradients come out banded or dithered.
GIF transparency is a single palette entry marked clear. A pixel is either wholly transparent or wholly opaque, so a soft edge that fades out cannot survive the conversion.
PNG allows bit depths of 1, 2, 4, 8 and 16, and five colour types: greyscale, truecolour, indexed-colour, and each of greyscale and truecolour with alpha. Not every depth is legal for every type.
Drawing an animated GIF or WebP takes a single picture from it - the image the format names as its default, or the first frame where there is none - so the converted file holds one picture and not the animation.
Converting a picture back to the format it came from does not return the original file. Whatever a step discarded stays discarded, and the return trip writes a third file.
The browser decodes the picture to plain pixels and writes a new file from them, so the Exif data, the colour profile and anything else the original carried are not passed on.
No browser writes GIF from a canvas. A GIF has to be built in JavaScript: the colours reduced to a palette, dithered where the picture needs it, and coded with LZW.
Drawing an animated image onto a canvas uses the image the format names as its default, or the first frame where the format names none. The other frames are not reachable this way.
This site writes GIF files itself. A picture that uses 256 colours or fewer, counting one for transparency when any pixel is clear, keeps every colour exactly; a picture with more is reduced to 256 by median cut, which groups the colours where the picture has them and uses the average of each group.
Where the palette has to reduce a picture, this site spreads each pixel's colour error onto the pixels to its right and below it (Floyd-Steinberg dithering), which trades bands for fine grain. Dithering is on by default and can be switched off, and a picture that already fits the palette is never dithered.
A GIF written here has one clear palette entry. A pixel with alpha below 128 out of 255 becomes that clear entry, and any other partly clear pixel is laid onto the background colour, #FFFFFF unless you change it.
This site refuses to write a GIF from a picture larger than 16,000,000 pixels, such as 4,000 x 4,000, and says so before decoding it, so that reducing the colours cannot lock up the browser tab.
When Should Dithering Be Off?
Leave it on for photographs and gradients
A photograph or a soft gradient has far more shades than the palette. Without dithering, neighbouring shades land on the same entry and the picture breaks into flat bands. With it, the leftover error is scattered as fine grain, which the eye reads as the missing shade.
Turn it off for graphics that nearly fit
A logo, a chart or a screenshot with few colours usually fits the palette, and then nothing is dithered either way. When one does not quite fit, dithering sprinkles specks across areas that should be flat, and plain nearest-colour mapping looks cleaner.
It changes the file size too
Dithered pixels rarely repeat, and GIF compression works by finding repeats, so the same picture usually makes a larger GIF with dithering on than with it off.
Common Mistakes
- Expecting soft shadows to stay soft. A GIF pixel is clear or opaque, so a fading edge is cut hard against the background colour you pick.
- Expecting an animation. This page writes the one picture the browser hands it, so the GIF has one frame.
- Keeping the GIF as your only copy. Colours the palette dropped do not come back when you convert it again.
Frequently Asked Questions
What happens to a PNG's soft transparent edges in a GIF?
They become hard. A pixel less than half opaque turns fully clear, and any other partly clear pixel is laid onto the background colour, #FFFFFF unless you change it. Pick the colour of the page the GIF will sit on.
Can converting a PNG to GIF make it animate?
No. This page writes the one picture the browser hands it, so the GIF has one frame, even from an animated PNG. An animation needs several frames and their delays in one file, which this page does not assemble.
Why does the GIF look grainy or banded?
Because the PNG had more colours than a GIF can hold. With dithering on, the difference shows as grain; with it off, as bands. A picture of 256 colours or fewer shows neither, because every colour is kept exactly.
Does a logo with few colours lose anything as a GIF?
Not its colours: a picture of 256 colours or fewer keeps every one exactly and is never dithered. It can still lose soft edges, because GIF has no partial transparency, and it loses any Exif data.
You can, but the round trip is not the file you started from: the GIF to PNG direction.
Related Conversions
The rest of the family sits on the rest of the image converters.