How to Make a GIF Loop Forever
- New GIF from video: convert it in the tool above. Every GIF it makes has loop count 0, so it repeats forever.
- Existing GIF: run
gifsicle --loopcount=forever input.gif -o output.gif, or use an online loop-count editor and set the count to 0 (infinite). - FFmpeg: add
-loop 0to the GIF output. It is also FFmpeg’s default for GIF.
| Stored in the GIF | Plays in current browsers | How to set it |
|---|---|---|
| Loop count 0 | Forever | FFmpeg -loop 0, gifsicle --loopcount=forever |
| No loop extension | Once | FFmpeg -loop -1, gifsicle --no-loopcount |
| Loop count 1 | Twice | -loop 1, --loopcount=1 |
| Loop count N | N + 1 times | -loop N, --loopcount=N |
GIF Loop Basics
The GIF format supports configurable loop behavior through the NETSCAPE2.0 Application Extension, added after the original GIF89a specification:
- Loop count 0: infinite loop (plays forever). This is the default for most GIFs.
- Loop count 1: one repeat after the first play, so most browsers show the animation twice.
- Loop count N: N repeats after the first play (N + 1 plays in total). Maximum value is 65,535.
- No extension: play once. This is the only reliable way to get a single play.
When to Use Each Setting
| Loop Setting | Use Case | Examples |
|---|---|---|
| Infinite (0) | Continuous animations | Social media, memes, web content, messaging |
| Play once (no loop count) | One-shot animations | Presentations, tutorials, instructions |
| 2–3 times | Attention without annoyance | Email marketing, banner ads |
Browser Behavior Differences
The loop count is not part of the original GIF89a specification. It comes from a Netscape extension, and apps have interpreted it in different ways:
- Chrome/Edge: loop count N means the animation plays a total of N+1 times (initial play plus N repeats). So loop=1 plays twice.
- Firefox: current versions follow the same rule, so loop=1 also plays twice.
- Safari and other apps: current Safari follows the same rule, but some image viewers and chat apps count N as total plays or ignore the count.
So loop=1 plays twice in current browsers, and possibly once in an older viewer. For a single play everywhere, leave the loop extension out. For infinite looping (loop=0), all browsers behave identically.
Practical tip: If you need exactly-once playback, remove the loop extension (gifsicle --no-loopcount or FFmpeg -loop -1). To make the end feel deliberate, give the last frame a longer delay.
How to Change Loop Count
When Creating a New GIF
In FFmpeg, use the -loop flag:
-loop 0— infinite loop (default)-loop 1— one repeat (plays twice)-loop 3— three repeats (plays 4 times)-loop -1— no loop extension: plays once
Modifying an Existing GIF
Use gifsicle to change the loop count without re-encoding:
gifsicle --loopcount=0 input.gif > infinite.gifgifsicle --no-loopcount input.gif > play_once.gif
Loop Count for Email Marketing
For email GIFs, loop count has special importance:
- Infinite loops are distracting: a constantly moving GIF can annoy subscribers, especially in professional contexts
- Play 2–3 times: catches attention initially, then stops. Use a loop count of 1 or 2 for that.
- Older Outlook for Windows ignores loops entirely: it only shows the first frame regardless of loop settings
- Design for both states: the GIF should look good both while animating and after stopping on the last frame
Why Isn’t My GIF Looping?
- It has no loop extension or a small loop count. Set the count to 0 with gifsicle or a loop editor.
- The app turned it into a video. Many social apps convert GIFs to MP4 and use their own loop rules. For Discord, see how to make a Discord GIF that stays under the size limit and loops in chat.
- Older Outlook for Windows shows only the first frame, so nothing moves at all.
- It has only one frame. A single-frame GIF is a still image; there is nothing to loop.
- The loop jumps. If the last frame does not lead into the first, viewers see a cut. Trim where the motion matches, or append the clip reversed (a “boomerang”) with FFmpeg’s
reversefilter.