How to change a GIF's loop
- Drop a GIF into the box above, or click it to choose one. The page reads the file and tells you how it plays now.
- Choose Loop forever, Play once, Play a set number of times (then type the number), or Stop within 5 seconds.
- Press Save GIF. The result plays below; Play from the start restarts it so you can count the plays.
- Download it. The file name says what you chose, for example
party-loop.giforbanner-3-plays.gif.
The number in a GIF counts repeats, not plays
Whether a GIF loops is not up to the browser or the app showing it; it is a small setting stored near the start of the file. Its number is easy to misread. It does not say how many times the GIF plays: it says how many times to repeat after the first play, and 0 is a special value that means forever. So a loop count of 1 gives two plays, and the only way to get exactly one play is to have no loop setting at all.
We checked this rather than take it from the specification. A four-frame test GIF, 0.8 seconds per play, was saved with each setting and watched frame by frame in Chrome 156 and Microsoft Edge for six seconds:
| Stored in the file | Plays in Chrome and Edge | What this page calls it |
|---|---|---|
| No loop setting | 1, then stops on the last frame | Play once |
| Loop count 1 | 2 | 2 plays |
| Loop count 2 | 3 | 3 plays |
| Loop count 3 | 4 | 4 plays |
| Loop count 4 | 5 | 5 plays |
| Loop count 0 | Still playing when we stopped watching | Loop forever |
That is why this page asks how many times you want the GIF to play and writes the matching number itself. In the test, every choice played exactly as many times as chosen in both browsers.
Odd files we also tested
GIFs made by older or unusual tools sometimes store the setting in a non-standard way. The page recognises these and says so when you drop the file in; saving leaves a single, standard loop setting before the first frame.
- Two loop settings in one file (one saying three plays, a later one saying forever): Chrome and Edge followed the last one and looped forever.
- Loop setting placed after the first frame instead of before it: both browsers still read it.
- The old
ANIMEXTS1.0label instead ofNETSCAPE2.0: both browsers treated it the same way.
Why some GIFs stop after one play
Because nothing told them to loop. The app or code that made the GIF decides whether to write a loop setting, and their defaults differ. Two we checked:
| Made with | Default when you don't choose |
|---|---|
Python's Pillow library 12.3, save_all=True without loop | No loop setting: plays once |
FFmpeg 7.1, plain ffmpeg -i clip.mp4 out.gif | Loop count 0: loops forever |
FFmpeg 7.1 with -loop -1 | No loop setting: plays once |
Design apps usually ask: Photoshop's Save for Web has a Looping Options menu, and our own Images to GIF has a Repeat choice. If a GIF used to loop and stopped after you edited it, the editor dropped the setting; this page puts it back. If it stopped moving entirely, see why a GIF is not moving — a single-frame file has nothing to loop, and the page tells you so.
Stopping a GIF within five seconds
On websites, WCAG success criterion 2.2.2 asks that anything that moves on its own for more than five seconds can be paused or stopped. One way the W3C lists to meet it, technique G152, is a GIF whose plays add up to five seconds or less. Stop within 5 seconds does that arithmetic from the GIF's own frame delays: a 1.2 second animation gets 4 plays (4.8 seconds), a 2.5 second one gets 2, and a 3 second one gets 1. The page shows the total before you save. If a single play is already longer than five seconds, no loop setting can help, and the page says so; the options then are a shorter animation or a pause button on the page.
What saving changes, and what it does not
The loop setting is a block of 19 bytes. Saving removes any loop blocks the file has, writes one new block in the standard place (or none, for Play once), and copies every other byte unchanged. Frames are not decoded or re-encoded, so no colour, transparency or delay can change, and the file size moves by at most 19 bytes per block.
We tested that on thirteen GIFs — our five usual test animations (a transparent emoji, a screen recording, an interface animation, a colour pan and a noisy video clip) plus eight files built to be awkward: no loop setting, a loop count of 3, a comment block, the old label, a late setting, two settings, and a single-frame GIF87a file. Each was saved five ways (1, 2, 3 and 5 plays, and forever). In all 65 results, read back independently, every frame's pixels and every delay matched the original, the stored loop value was the expected one, and apart from the loop block not one byte differed. A GIF that is cut off at the end is kept as it is, missing part included.
Things this page does not do
- Back-and-forth (boomerang) loops. That needs the frames played in reverse and added to the end, which is a different edit.
- Speed. Changing how fast it plays means changing every frame delay. To shorten or slow a clip, convert it with GIF to MP4, change it there, and turn it back with Video to GIF.
- Choosing the frame it stops on. A GIF that stops always rests on its last frame. If that frame looks wrong when it stops, the fix is in the animation itself.
- Forcing an app to obey. Some apps replay GIFs their own way or convert them to video. Test the file in a browser: if it loops correctly there, the file is right.
To make the GIF smaller as well, use Compress GIF, Resize GIF or Crop GIF; all three keep the loop setting you give it here. Your GIF is never uploaded — see where your files go.