Skip to content

Compress a GIF without uploading it anywhere

Shrink an animated GIF with gifsicle, the tool most GIF sites run on their servers, except that here it runs in your browser. Pick a compression strength, drop colours, scale the frame, or name a target size and let the compressor work its way down to it.

  • Lossy compression from gentle to strong
  • Fewer colours per frame
  • Smaller frame size
  • A target in MB, reached step by step
  • The file never leaves your device

How it works

  1. Step 1

    Drop a GIF on the box above, or click it to choose one. Files up to 100 MB work; the limit is your browser’s memory, not a server’s.

  2. Step 2

    Choose a compression strength, and if you like, fewer colours, a smaller frame or a target size in MB. Then press Compress GIF.

  3. Step 3

    Check the preview, read the before and after sizes, and download the compressed GIF. Change a setting and run it again without choosing the file twice.

What each setting does to a GIF

Compression
GIF stores every frame with LZW, which only shrinks runs of identical pixels. The lossy mode lets gifsicle change a pixel slightly when that makes a longer run: Light (--lossy=30) is hard to tell from the original, Balanced (80) adds faint noise in flat areas, Strong (140) is visibly grainy and often half the size. Lossless keeps every pixel and only optimises how frames are stored.
Colours
Each frame of a GIF carries a palette of at most 256 colours. Cutting that to 128 or 64 drops the bits per pixel and makes runs more likely; photographs and gradients band first, flat graphics and text barely change.
Size
Half the width and height is a quarter of the pixels. For a GIF that will be shown smaller than it was made, this is the setting with the biggest effect and no visible cost.
Target size
Give a size in MB and the compressor runs the ladder: your settings first, then stronger lossy compression, then fewer colours, then a smaller frame, stopping at the first result under the target. If nothing gets there, you get the smallest result and a note saying so.
Optimisation
Every run uses gifsicle’s -O2: frames are stored as the difference from the one before, with transparency where nothing changed. Files over 10 MB use -O1, which finishes in a fraction of the time for almost the same result.

Where the bytes go

An animated GIF is a stack of frames, each a palette image compressed with LZW from 1987. There is no motion compensation and no fractional quality setting, so the only levers are the number of frames, the number of pixels in each, the number of colours and how well the frames compress. This tool pulls the last three; cutting frames is a job for the editor that made the GIF.

Why in the browser

gifsicle compiles to WebAssembly and runs at close to native speed, so there is no reason to upload a file, wait in a queue and download it again. Your GIF stays on your device, there is no size limit set by a server, and the tool keeps working with the tab offline once it has loaded.

When a GIF should become a video

For anything longer than a few seconds, or anything with real footage in it, compression has limits that a format change does not. An H.264 MP4 of the same animation is usually five to twenty times smaller than the GIF, at full colour. Convert the GIF to MP4 when the destination plays video.

Frequently asked questions

Is the GIF uploaded?
No. The compressor runs on this page, in your browser, through gifsicle compiled to WebAssembly. The file is read into memory, compressed there, and offered back as a download. Nothing is sent to a server, so there is nothing to delete afterwards.
How much smaller will my GIF get?
It depends on what is in it. Flat graphics and screen recordings with large still areas lose 30 to 70 percent at the Balanced setting. GIFs made from footage or with heavy dithering compress less, because almost every pixel differs from its neighbour; for those, fewer colours or a smaller frame help more than lossy compression.
Will the compressed GIF still loop and keep its timing?
Yes. gifsicle keeps the loop count and every frame’s delay. It only changes how the frames are stored, and with the lossy or colour settings, some pixel values.
What is a good setting for Slack, GitHub or an email?
Start with Balanced and no other change, and look at the preview. If the size still is not where you need it, set a target in MB instead of guessing: Slack previews up to around 5 MB well, many email tools prefer under 1 MB, and the compressor stops as soon as it is under the number you give.
Why did the file get bigger?
A GIF that was already optimised by the tool that made it, or a GIF with a single frame, can come out slightly larger when the Lossless setting rewrites it. Any lossy strength will shrink it. The result tells you the size either way, and the original stays untouched on your disk.
Can it make a GIF from an HTML5 banner or an animation on a page?
No, it compresses an existing GIF. To make one from an HTML5 ad, a CSS or GSAP animation or any web page, RecordHTML records it in a real browser at the size and frame rate you choose, and can write it as GIF, MP4 or WebM.

Need the GIF made, not just made smaller?

RecordHTML records HTML5 banners, CSS animations and web pages in a real Chrome browser and writes them as GIF, MP4 or WebM at exact sizes and frame rates.

10 credits free every month · No card needed

Related