How to loop in After Effects

Last Updated: July 10, 2026

As with most things in After Effects, there are numerous ways to go about creating a loop and this will largely depend on what it is you’re trying to loop.

Quick answer: To loop keyframes in After Effects, alt-click (Option-click on Mac) the stopwatch next to any animated property and type loopOut("cycle"). Your animation will now repeat endlessly to the end of the composition. To loop video footage instead, select the clip in the Project panel, click Interpret Footage, and set the Loop value under Other Options.

That’s the short version. Below we’ll walk through every method in full — from simple keyframe loops and all four loopOut styles, to looping compositions, looping video, building a truly seamless loop, and finally exporting your loop as a GIF or video. Everything works in the latest 2025/2026 versions of After Effects as well as older releases.

With that in mind, here’s everything this guide covers:

  1. How to loop keyframes (position, rotation, scale, and more) using the loop expression.
  2. The four loopOut styles: cycle, pingpong, offset, and continue.
  3. loopIn vs loopOut, and looping by time instead of keyframes.
  4. How to loop an After Effects composition using the loop expression.
  5. How to loop a video in After Effects.
  6. How to create a perfect seamless loop.
  7. How to export and render your loop (GIF or video).
  8. Looping in After Effects FAQ.

How to loop keyframes in After Effects using the loop expression

This is perhaps the most simple way to loop in After Effects.

Let’s say you have two keyframes on the position property of a shape layer that moves the layer from top to bottom.

If you want this animation to loop all you have to do is alt-click the stopwatch next to the position property:

Extend composition after effects

This will bring up the expression box, you then need to type the following loop expression after effects nicely provides for us (watch out for the capital O):

loopOut("cycle");

Now, with this loop expression applied, when the time marker reaches your last keyframe and moves past it, the keyframe animation will loop endlessly until the end of your composition.

The great thing about this loop expression is that you can use it on pretty much every keyframed property, not just the position. So if you want After Effects to loop through a scale animation on a layer, just apply the same loop expression to your scale keyframes. It works on rotation, opacity, effect sliders, mask paths — almost anything you can keyframe.

If you’d like to go deeper on this and other time-savers, we keep a growing library of handy After Effects expressions you can copy and paste straight into your projects.

The four loopOut styles: cycle, pingpong, offset, and continue

The handy thing about the loopOut expression is that it takes a “type” argument, and there are four of them. Most people only ever use cycle, but the others solve very specific problems and are worth knowing.

1. cycle

The cycle example above restarts your animation from the first keyframe — it cycles through all the keyframes in the order you’ve placed them, then jumps back to the start and goes again.

loopOut("cycle");

2. pingpong

Let’s say that when your animation reaches the end keyframe, you want it to reverse back through the animation to the first keyframe and then start again. In this case, instead of writing “cycle” you can use the aptly named pingpong option:

loopOut("pingpong");

Imagine a game of ping pong being played, the ball goes back and forth between the two players. This is exactly what happens to your animation keyframes — After Effects loops the animation back and forth between the start keyframe and the last keyframe.

3. offset

The offset option is the secret to endless movement. Instead of snapping back to the first keyframe like cycle does, offset adds the total value change of your keyframes onto the end each time it repeats.

loopOut("offset");

Picture a layer that moves 200px to the right between two keyframes. With cycle it teleports back to the start and moves right again. With offset it keeps travelling right, 200px at a time, forever — perfect for continuously scrolling backgrounds, marching patterns, conveyor belts, and endlessly climbing counters.

4. continue

The continue option is the odd one out — it doesn’t repeat your keyframes at all. Instead it looks at the velocity of your last keyframe and keeps the animation moving in that same direction and speed indefinitely.

loopOut("continue");

So if your layer was rotating at a certain speed when it hit the final keyframe, continue will keep it spinning at that exact speed. There are no repeats — just smooth, ongoing motion extrapolated from where your animation left off. It’s great for spins, drifts, and steady momentum.

loopIn vs loopOut, and looping by time

Everything above uses loopOut, which loops the keyframes that come after your keyframed section, out towards the end of the composition. There’s an identical companion expression called loopIn that does the opposite — it loops the segment before your first keyframe, back towards the start of the comp.

loopIn("cycle");

loopIn accepts all the same styles (cycle, pingpong, offset, continue), so you can pre-roll an animation as well as post-roll it.

Looping only some of your keyframes: both expressions take an optional second number that tells After Effects how many keyframe segments to include in the loop. For example, loopOut("cycle", 1) loops only the last segment (the final two keyframes), while the default of 0 means “use all keyframes.”

Looping by time instead of keyframes: if you’d rather loop a set number of seconds rather than a number of keyframes, use the duration variants:

loopOutDuration("cycle", 2);

That loops the last 2 seconds of the animation. There’s a matching loopInDuration() too. These are handy when your timing is more important than your keyframe count.

That’s how to loop keyframes in after effects, now let’s look at how to loop a composition in After Effects:

How to loop an After Effects composition using the loop expression

Looping precomps or compositions in After Effects can also be done using the loopOut expression mentioned above. It does however require a couple more steps like so:

First, you need to have your composition inside another composition (if you’ve precomped layers in your composition then this will already be done for you.)

The next step is to enable time remapping, to do this select your composition layer, right click the layer and choose Time > Enable Time Remapping.

This will bring up a new property on your layer called Time Remap along with two keyframes: one at the start of your composition and one at the end.

Important: your composition may be longer than the animation you want to loop, if this is the case you need to do the following:

  • Move the time marker to the point at which you want the animation to loop
  • Click the keyframe button on the Time Remap property to create a new keyframe
  • DELETE the last keyframe on the Time Remap property

The next step is to alt-click the stopwatch on the Time Remap property and add the loopOut expression, again depending on the type of loop you want to happen you can use either:

loopOut("cycle") - to restart your loop from the first keyframe

Alternatively, use:

loopOut("pingpong") - to reverse through the animation back to the first keyframe

This will then loop your composition animation.

Common problems when looping compositions:

There's a single black frame at the end of the loop.

When this happens all you have to do is move the time marker to the last keyframe of your composition, move one frame back and create a new keyframe, then delete the old last keyframe.

My animation disappears after one loop

If this happens, chances are you need to extend the layer. To do this move your mouse to the outpoint of your composition layer then click and drag it along the timeline like so:

Extend composition after effects

Now we’ve seen how to loop keyframes and how to loop compositions in After Effects. Next, we’ll look at how to loop video in After Effects:

How to loop video in After Effects.

Looping video in after effects can be done in multiple ways, you can just use the loop expression method for looping compositions in After Effects that’s mentioned above however there is a much much simpler option.

Here’s how to loop video footage in After Effects the easy way without using any loop expressions:

Step 1. Import your video into After Effects

Double click the project panel and find the video file you want to import into After Effects.

Step 2. Click Interpret footage

With your footage selected in the Project panel, click the “Interpret footage” icon in the bottom left hand corner:

interpret footage after effects project panel

Step 3. Set the loop count

At the very bottom of the interpret footage pop-up there’s an Other Options panel, you’ll notice there’s an option for Loop.

Change the number from 1 to any number you want to loop by, 20 or 100, you can always change this later if you find the looped footage isn’t long enough!

loop options footage after effects

How to create a perfect seamless loop

Getting an animation to loop is one thing — getting it to loop seamlessly, with no visible jump or stutter at the join, is what separates a polished loop from an amateur one. Here’s how to nail it.

Match your first and last keyframe

For a cycle loop to be seamless, the value at your last keyframe needs to match the value at your first keyframe. If a layer starts at position X and ends somewhere else, you’ll see it snap back on every repeat. Copy your first keyframe and paste it as the final keyframe so the start and end line up exactly.

Avoid duplicating the join frame

A common cause of a tiny hitch is having the same frame play twice — once as the last frame and once as the first frame of the next cycle. If your loop feels like it “hiccups,” move your final keyframe one frame earlier so the loop point isn’t held for two frames.

Use pingpong when a match is impossible

If you genuinely can’t make the start and end match (for example, complex organic motion), loopOut("pingpong") sidesteps the problem entirely — because it reverses, the join is always seamless by definition.

Ease your keyframes consistently

Seamless loops also depend on velocity. If your first keyframe eases in but your last keyframe stops abruptly, the motion won’t flow across the loop point. Match the easing at the start and end so speed carries smoothly through the join.

How to export and render your loop

Once your loop is working, you’ll usually want to export just one clean cycle — not ten repeats baked into a long file.

Set your work area to one cycle

Trim your composition (or the work area, using B and N to set the in and out points) to the length of a single loop. When the file is played back on a loop by a browser, social platform, or video player, it will repeat perfectly.

Export as a video

Add your comp to the render queue (Composition > Add to Render Queue) or send it to Media Encoder for an MP4. For web and social, MP4/H.264 loops are far smaller and smoother than GIFs.

Export as a looping GIF

If you specifically need a GIF, send the comp to Adobe Media Encoder and choose the Animated GIF format — GIFs loop by default in most browsers. Keep the dimensions and colour count modest to control the file size.

Looping in After Effects — FAQ

Why won't my loop expression work?

The most common reasons are: your layer or composition isn’t long enough (extend the layer’s outpoint so there’s room for the loop to play), you only have a single keyframe (you need at least two), or there’s a typo — remember it’s a capital O in loopOut.

How do I loop without keyframes?

Use loopOut("continue") to keep motion going based on your last keyframe’s velocity, or use a wiggle() expression for procedural, keyframe-free movement. Both live alongside our other After Effects expressions.

What's the difference between loopOut and loopIn?

loopOut repeats your keyframes forward to the end of the composition; loopIn repeats them backward to the start of the composition. They share the same four styles.

How do I loop a GIF in After Effects?

Import the GIF, then either use the Interpret Footage > Loop method described above, or precompose it and apply loopOut("cycle") to a Time Remap property.

How do I make my loop seamless?

Match your first and last keyframe values, avoid holding the join frame twice, keep the easing consistent, or use loopOut("pingpong") when the values can’t match. See the seamless loop section above.

Can I loop audio in After Effects?

Yes — the Interpret Footage > Loop count works on audio files too, or you can duplicate and butt the audio layers end to end on the timeline.

And there we have it — every practical way to loop keyframes, compositions, video, and audio in After Effects, plus how to make your loop seamless and export it. Bookmark this one and experiment with the different loopOut styles; each one unlocks a slightly different kind of motion.

Start saving time in After Effects

Made by Loop creates After Effects resources that help
motion designers like you save time.

View our time saving scripts for After Effects