Animation Timing Generator

Create CSS animation timing properties including duration, delay, iteration count, and easing functions.

Animation Settings

Preview

CSS Code

Animation Property
animation: example 1s ease 0s 1 normal none;
Keyframes Example
@keyframes example {
  0% {
    transform: translateX(0);
    opacity: 0;
  }
  100% {
    transform: translateX(200px);
    opacity: 1;
  }
}

What Is CSS Animation Timing?

CSS animation timing controls exactly how an element moves through its keyframe states over time. The animation shorthand property lets you define every aspect of a web animation in a single line, specifying six core parameters: duration, timing function, delay, iteration count, direction, and fill mode. Getting these parameters right is the difference between a polished, professional interface and a janky, distracting one.

The animation timing generator assembles all six parameters into a ready-to-paste CSS rule. Instead of memorising the exact property order or hunting through documentation, you adjust sliders and dropdowns and the generator outputs syntactically correct CSS instantly. You can also preview the animation live before copying the code into your project.

Understanding timing is especially important for user experience. Research in motion design consistently shows that animations faster than 200 ms feel snappy and responsive, while animations between 300 ms and 500 ms convey smoothness without impatience. Animations above 1 second are best reserved for decorative, attention-grabbing effects rather than functional UI feedback. The delay parameter gives you fine control over when an animation starts relative to when its element appears in the DOM, enabling staggered entrances for lists, dashboards, and hero sections.

By combining timing functions such as ease-in-out with alternate direction and a fill mode of both, you can create looping effects that hold their start and end state — perfect for loading indicators, pulsing badges, and infinite carousels — all without a single line of JavaScript.

CSS Animation Shorthand Formula

animation: [name] [duration]s [timing-function] [delay]s [iteration-count] [direction] [fill-mode];

Where:

  • name= Keyframe name to animate (e.g., 'example')
  • duration= How long one animation cycle takes, in seconds (0.1–5)
  • timing-function= Easing curve: linear, ease, ease-in, ease-out, ease-in-out, or cubic-bezier(x1,y1,x2,y2)
  • delay= Wait time before the animation starts, in seconds (0–3)
  • iteration-count= Number of cycles; 0 maps to 'infinite'
  • direction= Playback direction: normal, reverse, alternate, or alternate-reverse
  • fill-mode= How styles apply outside the animation: none, forwards, backwards, or both

Timing Functions and Easing Curves

The timing function (also called an easing function) is the most nuanced parameter in the animation shorthand. It defines the rate of change of the animation over time — not just how fast it goes, but how it accelerates and decelerates. CSS provides five named keywords and an unlimited range of custom cubic Bézier curves.

Keyword cubic-bezier Equivalent Best Use
linear cubic-bezier(0, 0, 1, 1) Progress bars, countdowns
ease cubic-bezier(0.25, 0.1, 0.25, 1) General-purpose default
ease-in cubic-bezier(0.42, 0, 1, 1) Elements leaving the screen
ease-out cubic-bezier(0, 0, 0.58, 1) Elements entering the screen
ease-in-out cubic-bezier(0.42, 0, 0.58, 1) Looping, alternating animations

When none of the five keywords gives you the exact feel you want, switch to Custom Bezier mode and dial in the four control-point values (x1, y1, x2, y2). The x values must stay between 0 and 1, but the y values can go below 0 or above 1 to create overshoot — the characteristic "bouncy" effect seen in the Bounce preset (cubic-bezier(0.68, -0.55, 0.265, 1.55)).

Direction, Fill Mode, and Iteration Count

Three parameters work together to define the lifecycle of repeated animations: direction, fill-mode, and iteration count.

Direction controls which way each cycle plays:

  • normal — every cycle plays forward (0% → 100%)
  • reverse — every cycle plays backward (100% → 0%)
  • alternate — odd cycles play forward, even cycles play backward; this gives a natural back-and-forth without a hard jump
  • alternate-reverse — starts backward, then alternates

Fill mode answers "what happens before the animation starts and after it ends?"

  • none — the element returns to its original styles before and after the animation
  • forwards — the element retains the final keyframe styles after the animation ends; useful for slide-in effects where you want the element to stay in its final position
  • backwards — the element immediately applies the first keyframe styles during the delay period
  • both — combines forwards and backwards; the most comprehensive option for most entrance animations

Iteration count specifies how many times the animation cycles. Setting it to 0 in this generator maps to the CSS keyword infinite, which makes the animation loop forever — essential for loading spinners, pulsing indicators, and ambient background effects. Values greater than 1 allow precise repeated plays, such as 3 shakes for an invalid form field.

How to Use the Animation Timing Generator

The animation timing generator is designed for a fast, visual workflow. Here is the typical process for creating a polished CSS animation from scratch:

  1. Start with a preset. The Fade In, Bounce, Slide, and Pulse presets cover the most common animation patterns. Click one to instantly load its duration, timing function, and direction. Use it as a starting point rather than building from zero.
  2. Adjust the Duration slider. Drag left for snappier UI feedback (0.1–0.3 s), or right for dramatic entrance animations (0.8–2 s). The live preview updates in real time.
  3. Set a Delay if the animation should pause before starting — for example, 0.2 s so the element renders before moving, or staggered delays on multiple elements.
  4. Choose your Timing Function. For most UI elements ease-out looks natural on entry; ease-in-out works well for looping effects. Switch to Custom Bezier if you want overshoot or a spring-like feel.
  5. Set Direction and Fill Mode. For a one-shot entrance, use normal direction with forwards fill mode so the element stays at its destination. For a loop, use alternate with infinite iterations.
  6. Click Play Animation to see a real preview in the browser, then click Copy next to the Animation Property output to paste it directly into your stylesheet.

The generator also outputs a complete @keyframes example block you can customise. Replace translateX and opacity with any CSS properties relevant to your design — scale, rotate, background-color, or complex filter effects.

Animation Performance and Accessibility Best Practices

Smooth animations depend on the browser's rendering pipeline. CSS properties that trigger only the compositor layer — primarily transform and opacity — are the most performant because the browser can handle them on the GPU without recalculating layout or paint. Avoid animating width, height, top, left, or margin in performance-critical contexts, as these trigger expensive layout reflows on every frame.

Adding will-change: transform, opacity to an element before its animation starts can hint to the browser to promote it to its own compositor layer ahead of time, reducing first-frame jitter. Remove the property once the animation completes to free GPU memory.

Accessibility is equally important. The prefers-reduced-motion media query allows users who experience motion sickness or vestibular disorders to opt out of animations at the OS level. Always wrap non-essential animations in a check:

@media (prefers-reduced-motion: reduce) {
  .animated-element {
    animation: none;
  }
}

For animations that convey state changes (loading complete, error, success), provide an equivalent non-animated indicator — an icon, colour change, or ARIA live region — so screen-reader users and reduced-motion users receive the same information. Good animation design enhances the experience for everyone without excluding anyone.

Worked Examples

Fade-In Button on Page Load

Problem:

Create a CSS animation for a call-to-action button that fades in over 0.5 seconds with an ease-in curve, no delay, plays once, and stays visible after finishing.

Solution Steps:

  1. 1Set Duration to 0.5s (or use the Fade In preset).
  2. 2Set Timing Function to ease-in.
  3. 3Set Delay to 0s, Iteration Count to 1, Direction to normal.
  4. 4Set Fill Mode to forwards so the element stays at 100% opacity after the animation ends.
  5. 5The generator outputs: animation: example 0.5s ease-in 0s 1 normal forwards;

Result:

animation: example 0.5s ease-in 0s 1 normal forwards;

Bouncy Card Entrance with Delay

Problem:

A product card should slide in with a spring-like bounce using a custom cubic-bezier, start 0.2 seconds after the page loads, play once, and stay in its final position.

Solution Steps:

  1. 1Click the Bounce preset to load the cubic-bezier(0.68, -0.55, 0.265, 1.55) timing function and 0.6s duration.
  2. 2Switch Timing Function to Custom Bezier and verify x1=0.68, y1=-0.55, x2=0.265, y2=1.55.
  3. 3Set Delay to 0.2s.
  4. 4Set Iteration Count to 1, Direction to normal, Fill Mode to both.
  5. 5Generator outputs: animation: example 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.2s 1 normal both;

Result:

animation: example 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.2s 1 normal both;

Infinite Pulsing Loading Indicator

Problem:

A loading badge should pulse continuously with an ease-in-out curve, no delay, alternating direction so it smoothly expands and contracts without a jump cut.

Solution Steps:

  1. 1Click the Pulse preset, which sets duration to 1s, timing to ease-in-out, direction to alternate.
  2. 2Confirm Iteration Count is 0 (which the generator converts to 'infinite').
  3. 3Set Delay to 0s, Fill Mode to none (the loop handles all states).
  4. 4Generator outputs: animation: example 1s ease-in-out 0s infinite alternate none;
  5. 5Apply to your element and add a @keyframes block that scales from 1 to 1.1 and back.

Result:

animation: example 1s ease-in-out 0s infinite alternate none;

Quick Slide with Short Delay

Problem:

A dropdown menu item should slide in quickly over 0.3 seconds with an ease-out curve, after a 0.5-second stagger delay, once, staying at its final position.

Solution Steps:

  1. 1Set Duration to 0.3s, Timing Function to ease-out.
  2. 2Set Delay to 0.5s to create a stagger effect when used with sibling elements at increasing delays.
  3. 3Set Iteration Count to 1, Direction to normal, Fill Mode to forwards.
  4. 4Generator outputs: animation: example 0.3s ease-out 0.5s 1 normal forwards;

Result:

animation: example 0.3s ease-out 0.5s 1 normal forwards;

Tips & Best Practices

  • Keep UI feedback animations under 300 ms — anything slower feels sluggish to users performing repeated actions.
  • Prefer animating 'transform' and 'opacity' over 'left', 'top', or 'width' to avoid triggering layout reflow and maintain 60 fps.
  • Add '@media (prefers-reduced-motion: reduce) { animation: none; }' to respect users who experience motion sensitivity.
  • Use 'fill-mode: both' for entrance animations with a delay — it prevents the element from flashing its default styles during the wait period.
  • The 'alternate' direction with 'ease-in-out' timing creates the smoothest looping effect because velocity naturally reaches zero at both endpoints.
  • For a spring or bounce feel, set the y control points of cubic-bezier outside the 0–1 range — try cubic-bezier(0.68, -0.55, 0.265, 1.55).
  • Test your animation at both 0.5× and 2× speeds in browser DevTools to make sure it looks intentional rather than accidental at any speed.
  • Stagger list item animations by adding incremental delays (0.05–0.1 s per item) for a polished cascade entrance effect.

Frequently Asked Questions

When you set Iteration Count to 0, the generator maps it to the CSS keyword <code>infinite</code>. This means the animation loops forever without stopping. It is the standard approach for loading spinners, pulsing badges, and any ambient motion effect that should continue as long as the element is visible. In CSS, you can also write <code>animation-iteration-count: infinite</code> directly, but this generator handles the conversion for you.
Use <strong>forwards</strong> when you only care that the element holds its final keyframe styles after the animation ends — useful for a simple entrance effect with no delay. Use <strong>both</strong> when there is also a delay and you want the element to immediately adopt its initial keyframe styles during the wait period (what <em>backwards</em> does) in addition to holding the final styles afterward. For most entrance animations, <em>both</em> is the safest default.
A cubic-bezier easing curve is defined by two control points — P1 (x1, y1) and P2 (x2, y2). The x values represent time (must be between 0 and 1), and the y values represent the animation progress. Setting y values outside the 0–1 range creates overshoot or undershoot, which produces spring and bounce effects. For example, y1=-0.55 in the Bounce preset makes the animation briefly reverse before shooting forward, creating the characteristic elastic snap.
Yes. With <em>alternate</em> direction, one forward play and one backward play together constitute two iterations. So if you set iteration count to 4 with alternate direction, the element travels forward twice and backward twice. If you set it to 3, it goes forward, backward, then forward again and stops, leaving the element at its 100% keyframe position.
Flickering at the start usually means the element's normal styles conflict with the 0% keyframe. Setting <strong>fill-mode: backwards</strong> or <strong>both</strong> forces the browser to apply the initial keyframe values during the delay period, preventing a visual jump. Another cause is layout thrashing — animating properties like <code>width</code> or <code>top</code> instead of <code>transform: translateX()</code> — which forces the browser to recalculate layout on every frame.
Yes. You can apply the same shorthand to multiple properties by listing them in a @keyframes block, as the generator's keyframe example shows with both <code>transform</code> and <code>opacity</code>. If you need different timing for each property, you can comma-separate multiple animation values: <code>animation: moveX 0.5s ease, fadeIn 0.3s linear;</code>. Each comma-separated value applies to a different @keyframes name.
Use the Delay field in this generator to produce the CSS for a single item, then apply incremental delays to siblings using CSS custom properties or the <code>:nth-child</code> selector. For example: <code>.item:nth-child(2) { animation-delay: 0.1s; }</code> and <code>.item:nth-child(3) { animation-delay: 0.2s; }</code>. In frameworks like React, pass an index-based inline style to compute the delay dynamically.

Sources & References

Last updated: 2026-06-05

💡

Help us improve!

How would you rate the Animation Timing Generator?

<>

Editorial Note

MyCalcBuddy Editorial Team

This page is maintained as an educational calculator reference.

Source

Formula Source: Standard Mathematical References

by Various

UpdatedLast reviewed: May 2026
CheckedFormula checks are based on standard references and internal QA review.