← Back to Tools

AE Expression Snippets

Copy-paste After Effects expressions for wiggle, loop, bounce, rotation, and more. Adjust parameters and copy to clipboard with one click.

9 expressions

Wiggle

Adds random oscillation to a property value.

wiggle(5, 50)

Where to apply: Any Property

Time to Frames

Converts current time to frame number.

timeToFrames(time, 1 / thisComp.frameDuration)

Where to apply: Any Property

Random

Generates a random value between min and max.

random(0, 100)

Where to apply: Any Property

Gauss Random

Generates random values with a Gaussian (bell curve) distribution.

gaussRandom(0, 50)

Where to apply: Any Property

Typewriter Effect

Reveals source text one character at a time.

txt = value;
len = Math.round(linear(time, 0, 3, 0, txt.length));
txt.substring(0, len)

Where to apply: Source Text

RGB to Hex Color

Defines a color using hex values (converted to 0-1 range).

hexToRgb("#FF5733")

Where to apply: Any Color Property

Endless Rotation

Continuously rotates a layer at a constant speed. Multiply time by degrees per second.

time * 360

Where to apply: Rotation

Loop

Loops keyframed animation continuously. Choose a loop type below.

loopOut("cycle")

Where to apply: Any Keyframed Property

Bounce Animation

Creates a bouncing effect after the last keyframe.

n = 0;
if (numKeys > 0) {
  n = nearestKey(time).index;
  if (key(n).time > time) n--;
}
if (n == 0) {
  t = 0;
} else {
  t = time - key(n).time;
}
if (n > 0 && t < 1) {
  v = velocityAtTime(key(n).time - thisComp.frameDuration / 10);
  amp = 0.06;
  freq = 3;
  decay = 5;
  value + v * amp * Math.sin(freq * t * 2 * Math.PI) / Math.exp(decay * t);
} else {
  value;
}

Where to apply: Any Keyframed Property

How to Use Expressions in After Effects

To add an expression to any property in After Effects, hold Alt (Windows) or Option (Mac) and click the stopwatch icon next to the property. This opens the expression editor where you can type or paste code that controls the property's value dynamically.

Expressions use JavaScript-based syntax and give you programmatic control over animation properties without manually keyframing every value. They're especially useful for repetitive motion, procedural animation, and linking properties together.

Common Use Cases for AE Expressions

Motion designers use expressions to automate wiggle effects, create seamless loops, build typewriter animations, and drive complex motion systems. The wiggle expression alone is one of the most used tools in After Effects, adding organic randomness to position, scale, rotation, or any other property. Loop expressions eliminate the need to copy and paste keyframes, while time-based expressions create continuous animations that never stop.

Expressions vs Scripts in After Effects

Expressions are applied directly to individual properties and run every frame during playback. Scripts, on the other hand, are standalone programs that run once to perform batch operations, generate layers, or automate workflows. Both use JavaScript, but expressions are embedded in the timeline while scripts run from the Scripts menu or ScriptUI panels.

Tips for Writing Better Expressions

Start simple and build complexity gradually. Use variables to make your expressions readable and adjustable. Link expressions to Slider Controls for keyframeable parameters that are easy to tweak. When troubleshooting, check the expression error message at the bottom of the composition panel - it usually points to the exact line causing issues.

After Effects expressions can do incredible things, but remembering the syntax for every single one is a waste of brainpower. This AE Expression Snippets tool gives you a curated library of the most useful expressions, ready to copy and paste into your projects.

Each snippet includes the expression code, a description of what it does, adjustable parameters where applicable, and a label showing exactly which property to apply it to in After Effects. No guessing, no digging through forums.

The collection covers the expressions motion designers actually use on a daily basis: wiggle for organic movement, loopOut for seamless cycles, time-based rotation for continuous spin, bounce-back for overshoot effects, typewriter reveal for text animations, and more. Each one is tested and production-ready.

For expressions with parameters like wiggle frequency and amplitude, you can adjust the values directly in the tool and see the updated code instantly. This is faster than tweaking values manually in After Effects, especially when you are experimenting with different settings.

The search function lets you find what you need quickly. Looking for a loop expression? Type "loop" and get every variant. Need something for opacity? Search and filter.

Whether you are a beginner learning expressions for the first time or a senior motion designer who just needs a quick reference, this tool saves you from memorizing syntax or bookmarking Stack Overflow threads. Built by a motion designer who got tired of rewriting the same expressions on every project.

More tools

Explore the full collection of free design and motion utilities.

View All Tools

Let's talk

Available for product videos, animation systems, creative direction, and workshops.