After Effects toolkit

    Expressions, ready to copy.

    Short lines of code that automate motion and give you precise control — search, then paste straight into an After Effects property.

    125 of 125 expressions

    EssentialsScale

    Aspect ratio lock

    Keep width and height proportional when scaling

    EssentialsOpacity

    Auto Fade In & Out

    Make a layer appear and disappear by using an expression to define the duration.

    EssentialsOpacity

    Auto-fade out before layer ends

    Layer fades to 0 opacity in the final N seconds

    EssentialsRotation

    Bounce on rotation

    Create two key points and use this rotational bounce expression. I'd like to thank School of Motion for this script. For more details on this specific bounce expression, please visit their website.

    EssentialsScale

    Bounce on scale

    Here's a cool way to give your layer the bouncy effect of jelly or gelatin.

    Essentialsany numeric property

    Clamp

    Prevent a value going out of bounds

    Essentialsa single Position axis or Rotation (time * 90 = 90 deg/sec)

    Constant motion

    Continuous movement without keyframes

    EssentialsAny keyframed property

    Control the number of repetitions of your loop

    Very useful when you have an end to your "loopOut".

    EssentialsAny property of a stacked layer

    Create a delay

    The "Delay" function can be used to create a delay of a certain number of frames.

    EssentialsAny keyframed property

    Create a loop

    This expression is the best way to loop an animation, as it loops both the animation input and the output.

    Essentials

    Ease remap

    Smooth mapped range with ease-in and ease-out

    EssentialsOpacity

    Fade in on comp start

    Layer fades from 0 to 100 opacity over a set duration

    Essentialsany keyframed property

    Inertia bounce

    Physical overshoot and settle after each keyframe

    Essentials

    Linear remap

    Map one value range onto another

    EssentialsAny property

    Loop a Wiggle

    Expression to be copied into the property you wish to "wiggle".

    Essentials

    Loop in

    Loop keyframes before the in-point

    Essentials

    Loop in + out combined

    Seamless infinite loop in both directions

    Essentials

    Loop out

    Loop animation keyframes from the out-point

    Essentials

    Loop out (continue)

    Extrapolate velocity beyond the last keyframe

    Essentials

    Loop out (pingpong)

    Loop that reverses direction each cycle

    Essentials

    Loop path

    Loop keyframes seamlessly - works where loopOut can't

    EssentialsPosition on a duplicate layer

    Mirrored position

    Flip a layer symmetrically across the comp centre

    Essentials

    Posterize time

    Force a lower frame rate on any property

    Essentials

    Posterize time + loop

    Looping animation with forced low frame rate

    EssentialsPosition for jittery hand-held feel, or Rotation for shaky camera

    Posterize time + wiggle

    Choppy frame-stepped wiggle

    EssentialsOpacity

    Random blinking

    Very useful and quick to create a "neon" effect. An expression to copy into your opacity property. Simply set the opacity of the affected layer to 50% and paste the following expression:

    EssentialsScale, Opacity, or any property

    Random value (seeded)

    A stable random number that doesn't flicker each frame

    EssentialsOpacity

    Safe opacity wiggle

    Wiggle opacity without going negative

    EssentialsPosition

    Sin Curve

    Expression to be copied into the property to which you wish to apply a deformation with a sine curve.

    Essentialsany keyframed or expression-driven property

    Smooth (reduce jitter)

    Smooth out jittery tracking or noisy data

    Essentials

    Wiggle

    Random shake on any property

    EssentialsPosition or Rotation

    Wiggle + Loop combined

    Wiggle that reseeds per segment

    EssentialsAny numeric property

    Wiggle between two values

    Expression that works on number value properties.

    EssentialsPosition

    Wiggle on X or Y

    Limits the wiggle to a single dimension. This expression concerns only X to affect Y change the last line to [ value[ 0 ],w[ 1 ] ].

    Text & CountersAnchor Point

    Center anchor point vertically on text

    Ensure that the anchor point is always vertically centered on a text layer.

    Text & CountersSource Text

    Comp name

    Display the composition name as text

    Text & CountersSource Text

    Currency

    Prefix a counter with a currency symbol

    Text & Counters

    ETA countdown (MM:SS)

    Count down from a set number of seconds

    Text & CountersSource Text

    Frame number

    Display the current frame as an integer

    Text & CountersSource Text

    Get the date

    The expression for the current date gives you immediate access to today's value.

    Text & Counters

    Granular increment (0.01)

    Scale down a slider to hundredths precision

    Text & Counters

    Hundredths counter (1.00)

    Display a slider value to 2 decimal places

    Text & CountersSource Text

    Leading zeros (001)

    Pad a number to a fixed digit width

    Text & CountersSource Text on a numeric value layer

    Odometer (commas)

    Format large numbers with comma separators

    Text & CountersSource Text

    Percentage

    Append a % sign to a counter

    Text & CountersSource Text

    Random character scramble

    Randomly cycle through characters - glitch effect

    Text & CountersSource Text

    Slider (whole number)

    Drive a text counter from a Slider Control

    Text & Counters

    SMPTE timecode

    Full HH:MM:SS:FF timecode display

    Text & CountersSource Text

    Source name

    Display the layer's own name as text

    Text & CountersSource Text

    Timer / animated timecode

    Expression to copy into your text source.

    Text & CountersSource Text

    Typewriter effect

    Expression to paste into your text source.

    Text & Counters

    Typewriter substring

    Reveal text character by character

    Text & Countersits Opacity

    Typing cursor blink

    Blinking | cursor to pair with a typewriter reveal

    Text & CountersSource Text

    Uppercase all

    Force text to display in uppercase

    Shape & LayoutSize and Anchor Point of a shape

    "Bounding box" for a text

    Here's the expression to automatically resize a text box in After Effects, which should save you a lot of time. The first expression must be applied to the size of your rectangle shape, while the second must be added to the anchor point of your rectangle shape.

    Shape & LayoutScale on a text layer

    Auto-fit scale (long translations)

    Shrinks text to fit a max width

    Shape & LayoutSize on a Rectangle path

    Auto-size text box

    Rectangle that automatically matches text width and height

    Shape & LayoutOffset of a Repeater

    Center your form repeat

    Copy this expression into the offset attribute of your repeat on your shape layer. It automatically centers the repeat on the middle shape. Bonus: duplicate your repeat and reverse the axis to create a grid.

    Shape & LayoutPosition

    Circular orbit

    Layer orbits continuously around a centre point

    Shape & LayoutPosition on every layer

    Index spacing (auto-stack)

    Automatically distribute layers in a vertical column

    Shape & LayoutStroke Width

    Maintain stroke width (non-uniform scale)

    Correct stroke width even with non-uniform scale

    Shape & LayoutStroke Width

    Maintain stroke width (uniform scale)

    Keep stroke width consistent when scaling

    Shape & LayoutPosition on all layers

    Multi-column auto-stack

    Distribute layers into a grid of rows and columns

    Shape & LayoutPosition

    Obtain the composition's center and scale

    Use the "Composition width and height" expression to center and scale a layer.

    Shape & LayoutEnd

    Percentage ring (trim paths)

    Circular fill driven by a slider

    Shape & LayoutRectangle Size

    Progress bar fill

    Rectangle width driven by a 0-100 slider

    Shape & LayoutScale

    Pulse (rhythmic scale beat)

    Rhythmic scale pulse synced to a frequency

    Shape & LayoutOpacity

    Safe zone warning

    Pulses the layer if it gets too close to the comp edge

    Shape & LayoutSize on a Rectangle path

    Smart background with padding

    Shape that wraps tightly around text with adjustable padding

    Shape & LayoutPosition

    Snap to grid

    Constrain a layer's position to a pixel grid

    Shape & LayoutPosition

    Spiral outward

    Layer traces an expanding spiral path

    Master ControllersOpacity

    Checkbox visibility

    Toggle layer visibility on/off from a master null

    Master ControllersAny property

    Checking a property with a checkbox

    Use this expression for a property you want to be able to "check".

    Master Controllersany Fill/Stroke Color

    Global colour link

    One colour swatch controls every layer that references it

    Master Controllers

    Global position link

    Drive a layer's position from a null in another comp

    Master Controllersany numeric property

    Global slider link

    Single slider drives a value across every linked layer

    Master Controllers

    Multi-switch (index router)

    Keyframe a single slider to switch between multiple states

    Master ControllersPosition on child

    Parented position compensation

    Track a parent layer's position in a child's local space

    Master ControllersOpacity

    Show/Hide layer with drop-down list

    Apply to a layer's opacity property. Change the layer name to begin with [1,2,3] to match the drop-down parameter.

    Master ControllersPosition or use result as driver in other expressions

    World position (null parent offset)

    Get a layer's true world position regardless of parenting

    Advanced RigsPosition

    Attach a 2D position to a 3D Null

    A small, powerful and versatile expression for wide-ranging possibilities.

    Advanced RigsOpacity

    Blink

    Hard on/off blink using a sine wave threshold

    Advanced RigsOpacity

    Fade a layer according to distance from the camera

    Simply apply this script to the opacity of your layer, and the layer will fade as it approaches the camera. This code is useful when you want to simulate depth of field and control when your layers should fade.

    Advanced RigsOpacity on follower layers

    Ghost trail - opacity

    Followers fade progressively down the chain

    Advanced RigsPosition on all follower layers

    Ghost trail - position

    Layers follow a leader with a cascading delay

    Advanced RigsScale on follower layers

    Ghost trail - scale

    Scale follows a leader with a cascading delay

    Advanced RigsRotation

    Ignore "parent" layer rotation

    A small expression to add to the rotation of the "child" layer to ignore the rotation of the "parent".

    Advanced RigsRotation

    Look at (face target)

    Layer rotates to always face a target null

    Advanced RigsPosition

    Magnet (LERP)

    Layer is attracted toward a null with adjustable strength

    Advanced RigsScale

    Matrix wave (scale)

    Wave ripples across a grid of layers from a master null

    Advanced RigsOpacity

    Proximity trigger (opacity)

    Layer appears when a trigger null gets close enough

    Advanced RigsScale

    Proximity-based scale

    Layer grows as an attractor null moves closer

    Advanced RigsPosition Y or Rotation

    Rubik row shift

    Rows shift in staggered waves

    Advanced RigsFill Color

    Sample image (colour picker)

    Sample a pixel colour from a video layer dynamically

    Advanced RigsPosition or Rotation on multiple layers

    Seeded random wiggle (per layer)

    Each layer gets a different but stable wiggle

    Advanced RigsPosition alongside keyframes

    Spring follow (physics)

    Layer chases keyframes with real mass, stiffness and damping

    Advanced Rigs

    Stagger delay by index

    Same animation plays offset across multiple layers automatically

    Advanced RigsPosition or Opacity

    Strobe / glitch on beat

    Choppy strobe or glitch displacement

    Advanced RigsAny property

    Trigger expression on marker

    Automate actions based on the position of markers in the composition.

    Advanced RigsRotation on a layer with animated Position keyframes

    Velocity-based rotation

    Layer banks automatically to face its direction of travel

    Data & FinanceSource Text

    Animated number delta (+12% / -8%)

    Show positive/negative change with automatic +/- sign

    Data & FinanceFill Color

    Color heatmap (value-based)

    Bar fill colour changes automatically based on its value

    Data & FinanceSource Text

    Currency formatter ($1,000,000)

    Format large numbers with symbol and comma separators

    Data & Financebar Size property

    Dynamic bar height (slider linked)

    Bar shape height driven by a slider on a master null

    Data & Financenumeric property

    Rolling average (smooth slider)

    Average slider value over recent frames to remove spikes

    Data & FinanceSource Text

    Shorthand number (1.2M / 50K)

    Auto-switch between B, M, K and full number

    Data & FinancePosition on a dot layer

    Sparkline dot position

    Move a dot along a data axis driven by a slider

    Data & FinanceRectangle Size

    Stacked area fill (normalised)

    Drive fill height as a fraction of a total for stacked charts

    IsometricFill Color on extruded shape layers

    ISO depth shading

    Progressively darken extruded layers for realistic ISO shading

    IsometricPosition on all duplicates

    ISO extrude offset

    Stack duplicate layers to create isometric depth

    IsometricScale

    ISO full SSR expression (top)

    Top face scale as a pure expression

    IsometricScale

    ISO left face (SSR)

    Scale and rotate a layer into the left isometric plane

    IsometricScale

    ISO right face (SSR)

    Scale and rotate a layer into the right isometric plane

    IsometricScale

    ISO top face (SSR)

    Scale and rotate a layer into the top isometric plane

    IsometricPosition

    ISO Z-height movement

    Move a layer up and down the isometric vertical axis

    Audio & MusicScale

    Audio reactor (scale)

    Layer scale reacts to the amplitude of an audio layer

    Audio & MusicScale

    Beat sync pulse (BPM, no audio)

    Sharp scale pulse on every beat - no audio layer needed

    Audio & MusicScale

    Left/right channel isolator

    Separate left and right audio channels drive different axes

    Audio & MusicFill Color

    Note-to-colour mapper

    MIDI-style 0-127 slider maps to a full colour spectrum

    Audio & MusicPosition on a row of identical layers

    Waveform offset per layer

    Row of layers ripples like a sound waveform

    B2B & TransportRotation on arrow layer

    Compass heading (north arrow)

    Arrow rotates dynamically to point from A to B

    B2B & Transportthe Offset property

    Dashed line animator

    Animated flowing dashes along a stroke path

    B2B & Transport

    Network node connection line

    Line dynamically stretches and rotates between two nodes

    B2B & Transportdot Position

    Route progress dot

    Dot moves between two points based on a progress slider

    B2B & TransportSource Text on a text layer on the same animated object

    Speed readout (pixel velocity)

    Displays a layer's actual movement speed in px/s

    Learn expressions

    Useful references