← All Articles
Tutorial

After Effects Expressions for Beginners: A Practical Guide

After Effects Expressions for Beginners: A Practical Guide

If you've used After Effects for any amount of time, you've probably heard the word "expressions" thrown around. Maybe you've copy-pasted one from a forum without fully understanding it. Maybe you've avoided them entirely.

I avoided them for years. Then I learned a few basics and it fundamentally changed how I work. Expressions let you automate repetitive animation tasks, link properties together, and create dynamic motion that would take forever to keyframe manually.

Here's the practical intro I wish I had when I started.

What Are Expressions?

An expression is a small piece of JavaScript-based code you apply to any animatable property in After Effects. Instead of setting keyframes, you write logic that controls the value. Alt/Option-click any stopwatch to add one.

5 Starter Expressions Every Motion Designer Should Know

1. Wiggle

The classic. Adds random, organic movement to any property. You can link the frequency and amplitude to a Slider Control for more precise control over the values.

wiggle(3, 25)

2. Time Remap to Slider Control

Link your time remap to a slider control for precise, keyframeable control over playback. This is incredibly useful when you want to scrub through a precomp's timeline using a single slider value.

thisComp.layer("Controller").effect("Time")("Slider")

3. Math.round for Integers

Use Math.round() to get whole numbers instead of decimals. This is great for animating text with typewriter effects - connect a slider to a text source and round the value so it counts up in clean integers.

Math.round(effect("Slider Control")("Slider"))

4. Loop Animation

Turns a set of keyframes into an infinite loop. Use "cycle" to repeat the keyframes exactly, or "offset" to continue the animation progressively (each loop picks up where the last one left off).

loopOut("cycle")
loopOut("offset")

5. Vertically Align Text

A simple expression to vertically center text layers, no matter the font or size. Apply this to your text layer's **Anchor Point** property (press A to reveal it). For a deeper dive, check out the full article on vertically aligning text in After Effects.

a=sourceRectAtTime();
[0,a.top+a.height/2]+value

Start by applying expressions to properties you'd normally keyframe. If you find yourself copying the same keyframes across 20 layers, that's an expression opportunity.

Check out my free tools

Built for motion designers - render calculators, timecode converters, and more.

View Tools

Let's talk

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