A bounce expression adds natural overshoot to any animation without extra keyframes. You animate a layer from A to B with two keyframes, paste the expression, and After Effects adds the wobble or the bounce for you. It is one of the most searched expressions, because it makes UI, text and logos feel physical in seconds.
Below are the two bounce expressions motion designers use most, ready to copy, with a plain-English explanation of every value. Both are free to use in personal and commercial projects.
📋 Table of Contents
Which bounce do you need?
- Inertial bounce (overshoot). The layer shoots past its final value and wobbles back, like a spring. Use it for pop-ups, buttons, text and icons.
- Bounce back. The layer hits its final value and bounces off it, like a ball hitting the floor. Use it for drops, landings and falling objects.
1. Inertial bounce expression (overshoot)
Alt-click (Option-click on macOS) the stopwatch of the property you animated, for example Scale or Position, and paste:
// Inertial bounce (overshoot) – paste on any keyframed property
amp = 0.06; // how far it overshoots
freq = 3.0; // wobbles per second
decay = 6.0; // how fast it settles
n = 0;
if (numKeys > 0) {
n = nearestKey(time).index;
if (key(n).time > time) n--;
}
t = (n > 0) ? time - key(n).time : 0;
if (n > 0 && t < 1) {
v = velocityAtTime(key(n).time - thisComp.frameDuration / 10);
value + v * amp * Math.sin(freq * t * 2 * Math.PI) / Math.exp(decay * t);
} else {
value;
}
What the values do
- amp controls how far the layer overshoots. 0.03 is subtle, 0.06 is lively, 0.1 is cartoonish.
- freq sets how many wobbles happen per second. 2 to 4 looks natural.
- decay sets how fast the wobble dies out. Higher values settle faster. 5 to 8 suits UI animation.
The expression only acts for one second after each keyframe and uses the speed of your animation to scale the overshoot. A fast move overshoots more than a slow one, which is exactly how real objects behave.
2. Bounce back expression
Use this one when something should land and bounce, for example a logo dropping into frame. Animate Position from above the frame to its resting place, then paste on Position:
// Bounce back (like a ball hitting the floor) – paste on Position or Scale
e = 0.7; // elasticity: 0 = no bounce, 1 = never stops
g = 5000; // gravity: higher = faster, smaller bounces
nMax = 9; // maximum number of bounces
n = 0;
if (numKeys > 0) {
n = nearestKey(time).index;
if (key(n).time > time) n--;
}
if (n > 0) {
t = time - key(n).time;
v = -velocityAtTime(key(n).time - 0.001) * e;
vl = length(v);
if (value instanceof Array) {
vu = (vl > 0) ? normalize(v) : [0, 0, 0];
} else {
vu = (v < 0) ? -1 : 1;
}
tCur = 0;
segDur = 2 * vl / g;
tNext = segDur;
nb = 1;
while (tNext < t && nb <= nMax) {
vl *= e;
segDur *= e;
tCur = tNext;
tNext += segDur;
nb++;
}
if (nb <= nMax) {
delta = t - tCur;
value + vu * delta * (vl - g * delta / 2);
} else {
value;
}
} else {
value;
}
What the values do
- e (elasticity) is how much energy is kept after each bounce. 0.5 gives a heavy object, 0.8 a rubber ball.
- g (gravity) controls how quickly each bounce falls back. Raise it for small, fast bounces.
- nMax caps the number of bounces so the layer always comes to rest.
This approach is based on the classic bounce and inertia expressions shared by Dan Ebberts, whose motionscript.com examples are still the reference for expression-driven motion.
Control the bounce with sliders
Editing numbers inside the expression gets old fast. Add three Slider Controls to the layer (Effect > Expression Controls > Slider Control), rename them Amplitude, Frequency and Decay, and use this version. Set Amplitude to about 6, Frequency to 3 and Decay to 6 to start:
// Same inertial bounce, controlled by three Slider Controls on the layer
amp = effect("Amplitude")("Slider") / 100;
freq = effect("Frequency")("Slider");
decay = effect("Decay")("Slider");
n = 0;
if (numKeys > 0) {
n = nearestKey(time).index;
if (key(n).time > time) n--;
}
t = (n > 0) ? time - key(n).time : 0;
if (n > 0 && t < 1) {
v = velocityAtTime(key(n).time - thisComp.frameDuration / 10);
value + v * amp * Math.sin(freq * t * 2 * Math.PI) / Math.exp(decay * t);
} else {
value;
}
Now you can tune the bounce from the Effect Controls panel, or expose the sliders in a template with Essential Properties.
Where to use a bounce expression
- Scale for pop-in buttons, icons, stickers and subscribe button animations.
- Position for cards, notifications and lower thirds sliding in.
- Rotation for swinging signs, bells and pendulum moves.
- Text animators, where a little overshoot makes words feel alive.
Save it as a preset
Once you like the settings, select the property with the expression and choose Animation > Save Animation Preset. Next time, double-click the preset in Effects & Presets and the bounce is applied in one step.
Troubleshooting
- Nothing happens. The property needs at least two keyframes. The bounce starts after a keyframe, so check that the layer actually moves into it.
- The layer jumps instead of bouncing. Your keyframes are too close together. Leave at least half a second after the last keyframe.
- Error on Position. If Position uses Separate Dimensions, apply the expression to X Position and Y Position separately.
- The overshoot is too strong. Lower amp, or soften the ease on the last keyframe so the arrival speed drops.
- Expression errors after opening an old project. Check File > Project Settings > Expressions. Both expressions work with the JavaScript and the Legacy ExtendScript engines.
Want more? See our After Effects expression examples, the expressions guide for beginners and animation easing explained. For ready-made animation that already feels this good, browse the widget templates in the library.