5 Powerful Expressions That Make After Effects Animations Effortless
Here's a question every motion designer quietly wrestles with: why spend forty minutes manually tweaking keyframes when four lines of code can do it in four seconds?
After Effects Expressions are JavaScript-based commands you attach to layer properties — position, scale, opacity, source text — and they literally tell your layers how to behave on their own. No plugin. No third-party tool. Just native AE power that most beginners walk right past.
In this guide, we're cutting straight to the five expressions that deliver the most visible impact with the least learning curve. Whether you're building social media content, corporate explainers, or full broadcast packages, these will change your workflow permanently.
The Bounce Expression
Best for: Scale · Position · RotationNothing communicates energy like a good bounce. When an element lands and physically rebounds, viewers feel it — it communicates weight, speed, and intention all at once. Doing this manually means stacking ease curves until your eyes glaze over.
The Bounce Expression reads your existing keyframes and automatically adds oscillating damping physics after the last keyframe fires. All you have to do is create two keyframes (say, moving a box from left to right), paste the expression on that property, and watch it come alive.
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 = .06; // bounce height freq = 3; // oscillations per second decay = 5.0; // how fast it settles value + v * amp * Math.sin(freq * t * 2 * Math.PI) / Math.exp(decay * t); } else { value; }
| Variable | What it controls | Suggested range |
|---|---|---|
| amp | Height of each rebound | 0.02 – 0.15 |
| freq | How many bounces occur | 2 – 6 |
| decay | How quickly it settles | 3.0 – 8.0 |
The Wiggle Expression
Best for: Position · Rotation · OpacityWiggle is arguably the most used expression in the entire After Effects ecosystem — and with good reason. It introduces randomized, perpetual movement to any property, which is perfect for simulating a handheld camera feel, making floating UI elements breathe, or adding organic instability to stagnant compositions.
The syntax is elegantly simple: wiggle(frequency, amplitude). Two numbers, infinite creative applications.
wiggle(1, 50); // wiggle(frequency, amplitude) // frequency = times it changes per second // amplitude = how far it moves (in pixels)
For a slow, dreamy camera drift, use wiggle(0.5, 20). For intense shaky-cam handheld energy, push it toward wiggle(8, 80). If you want to confine the wiggle to only horizontal movement, wrap it in an array: [wiggle(2,30)[0], value[1]].
Squash & Stretch Expression
Best for: Scale (on icons, shapes, text layers)Squash and stretch is one of the 12 classic principles of animation, and it exists because our eyes instinctively read volume preservation as physical reality. When an object squashes on impact and stretches on release, our brains register it as real. This expression automates that physics for you.
Apply it to the Scale property of any layer. It works especially well on app icons, bullet points, logo reveals, and UI button states.
maxDev = 13; // max pixel deviation spd = 30; // speed of oscillation decay = 1.0; // how fast it calms down t = time - inPoint; x = scale[0] + maxDev * Math.sin(spd * t) / Math.exp(decay * t); y = scale[0] * scale[1] / x; [x, y];
[x, y] output requires a 2-value dimension.
Increase spd for faster, more elastic wobble. Increase decay to shorten how long it jiggles. Tweak maxDev to control how extreme the squash/stretch ratio gets.
Motion Tail Expression
Best for: Position (with duplicated layers)This one feels like actual magic the first time you see it work. The Motion Tail creates a cascading stream of echoes that trail behind a moving object — the same technique used in energy burst effects, racing speed lines, and ghost-trail logo reveals.
The setup requires two steps and one duplication pass. First, animate your lead layer's position normally. Then apply the expression below to the Position property of that layer (and all its duplicates), and a separate opacity expression to fade them out naturally.
delay = 5; // frames of delay between each echo d = delay * thisComp.frameDuration * (index - 1); thisComp.layer(1).position.valueAtTime(time - d);
opacityFactor = .75; // falloff per layer (0–1) Math.pow(opacityFactor, index - 1) * 100;
Once both expressions are applied, duplicate the layer with Ctrl+D / Cmd+D around 5–8 times. Each copy automatically reads the lead layer's position at a staggered delay, while the opacity expression makes each successive echo progressively fade out.
opacityFactor below 0.6 for a faster fade that feels more like a speed blur. Increase delay to 10+ frames for a ghost-trail feel with longer persistence.
Auto Timer Expression
Best for: Text Layer → Source TextNeed a live countdown or count-up clock in your video — one that auto-syncs to your composition's timeline without a single keyframe? This expression builds a fully formatted HH : MM : SS : MS timer that updates every frame automatically.
Create a new Text Layer and apply the expression directly to the Source Text property (hold Alt/Option and click the stopwatch icon). The timer starts ticking the moment your composition plays from frame zero.
// Break time into readable units var hour = Math.floor((time / 60) / 60); var min = Math.floor(time / 60); var sec = Math.floor(time); var mili = Math.floor(time * 60); // Clean up overflow values if (mili > 59) { mili = mili - sec * 60; } if (mili < 10) { mili = "0" + mili; } if (sec > 59) { sec = sec - min * 60; } if (sec < 10) { sec = "0" + sec; } if (min >= 59) { min = min - hour * 60; } if (min < 10) { min = "0" + min; } if (hour < 10) { hour = "0" + hour; } // Output formatted string hour + ' : ' + min + ' : ' + sec + ' : ' + mili;
time with (yourDuration - time) where yourDuration is your target in seconds — e.g., for a 60-second countdown use (60 - time).
Style your text layer with a monospace or bold display font to make the numbers pop. Because the expression updates on every single frame, you get a perfectly smooth, broadcast-accurate timer with zero manual keyframing.
Start Using Expressions Today
Every one of these five expressions is copy-paste ready and works in After Effects CS6 through the current Creative Cloud release. Start with Wiggle — it's the gentlest entry point — and work your way through to Motion Tail once you're comfortable reading what the code is doing.
↑ Back to expressions