WebToolsPlanet
css Tools

CSS Keyframe Animator

Build CSS @keyframe animations visually — configure transforms, opacity, and timing with a live preview.

Last updated: March 25, 2026

Client-Side Processing
Input Data Stays on Device
Instant Local Execution

Find this tool useful? Support the project to keep it free!

Buy me a coffee

What is CSS Keyframe Animator?

CSS @keyframe animations enable complex, multi-step animated sequences entirely in CSS — no JavaScript required for the animation logic. Unlike CSS transitions (which animate between two states triggered by events like :hover), @keyframe animations can have unlimited intermediate steps, run automatically on page load, loop infinitely, run in reverse, pause, and be controlled with JavaScript's animation API (element.getAnimations()).

A @keyframe animation is defined by two parts: the @keyframes rule (defining what happens at which percentage of the animation timeline) and the animation property on the element (binding the keyframes to the element and configuring duration, timing, delay, and repeat count). Getting the timing function (ease, ease-in-out, cubic-bezier) right is crucial for making animations feel natural rather than mechanical. This visual builder lets you experiment with all of these properties simultaneously and watch the live preview update as you go.

How to Use CSS Keyframe Animator

1

Enter a name for your animation in the Name field (e.g., "slideInLeft")

2

The timeline starts with "from" (0%) and "to" (100%) — click "Add Keyframe" to insert intermediate stops

3

For each keyframe, select the CSS properties to animate: transform (translateX, scale, rotate), opacity, background-color

4

Set the animation timing properties: duration, delay, timing-function, iteration-count, direction

5

Watch the live preview element animate in real time

6

Copy the full generated @keyframes block and animation CSS shorthand for use in your stylesheet

Common Use Cases

  • Creating a loading spinner that rotates infinitely (animation: spin 1s linear infinite)
  • Building a smooth "fade in from below" entrance animation for page sections on scroll
  • Designing a pulsing "attention" animation for a CTA button using scale and opacity
  • Animating a skeleton loading screen shimmer effect using background-position @keyframes
  • Creating a typewriter text reveal effect using CSS width animation
  • Building a bouncing notification badge using translateY and cubic-bezier for natural feel
  • Designing a page transition that slides new content in from the right on route change
  • Creating a card flip animation combining perspective, rotateY @keyframes, and backface-visibility

Example Input and Output

A smooth "fade in and slide up" entrance animation for hero content:

Keyframe Configuration
Animation Name: fadeSlideUp
Keyframes:
  0%:   opacity: 0, transform: translateY(30px)
  100%: opacity: 1, transform: translateY(0)

Animation Properties:
  duration: 0.6s
  timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94)
  fill-mode: both
  delay: 0.1s
Generated CSS
@keyframes fadeSlideUp {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-content {
  animation: fadeSlideUp 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.1s both;
}

Client-Side Processing

All animation previews and CSS generation run locally in your browser. No animation configurations are sent to our servers.

Performance Tip

Always animate transform and opacity, not width, height, top, left, or background-color for performance-sensitive animations. Transform and opacity changes are handled by the GPU compositor thread and do not cause layout recalculation (reflow) or repaint, making them buttery smooth even on mobile devices and lower-end hardware.

Prefers-Reduced-Motion

Always respect the prefers-reduced-motion media query for accessibility. Wrap complex animations in @media (prefers-reduced-motion: no-preference) { ... } so users with vestibular disorders, migraines, or motion sensitivity have a still, distraction-free experience. Animations critical to understanding UI state can use a simple opacity fade as an alternative.

Frequently Asked Questions

What is the difference between CSS transitions and CSS animations?
CSS transitions animate between two states in response to a trigger (hover, class change, focus). They have a from and to state only. CSS animations use @keyframes and can have unlimited steps, run automatically without a trigger, loop, run in reverse, and be paused via JavaScript. Transitions are simpler; animations are more powerful.
Which CSS properties can be animated with @keyframes?
Most visual CSS properties can be animated: opacity, transform (translate, scale, rotate, skew), colors (color, background-color, border-color), width/height (use sparingly — causes layout recalculation), box-shadow, border-radius, and filter. For best performance, animate only opacity and transform — these are handled by the GPU compositor and don't cause layout or paint operations.
What CSS animation timing functions are available?
Built-in: ease (default, starts fast, slows down), ease-in (slow start), ease-out (slow end), ease-in-out (slow both ends), linear (constant speed). Custom: cubic-bezier(x1, y1, x2, y2) for full control. steps(n, direction) for instant frame-by-frame animation (useful for sprite sheet animation or typewriter effects). Use cubic-bezier.com to visually design custom easing curves.
What does animation-fill-mode: both do?
animation-fill-mode controls what styles are applied before and after the animation. "none" (default): the element returns to its pre-animation styles after finishing. "forwards": holds the final keyframe styles after finishing. "backwards": applies the first keyframe styles immediately during the delay period. "both": applies backwards during delay and forwards after completion. For most entrance animations, "both" is the correct value.
How do I trigger an animation only when an element enters the viewport?
CSS cannot trigger animations based on scroll position alone. Use the Intersection Observer API in JavaScript: create an observer that watches for an element entering the viewport, then adds a CSS class that includes the animation property. Keep the animation defined in CSS; only use JavaScript to apply/remove the trigger class.
How do I pause a CSS animation with JavaScript?
Use the Web Animations API: element.getAnimations() returns an array of running animations. Call animation.pause() and animation.play() to pause and resume. Alternatively, toggle a CSS class that sets animation-play-state: paused — this is simpler and doesn't require JavaScript interaction with the animation timeline.

How This Tool Works

The keyframe timeline is represented as an array of state objects, each containing a percentage and a map of CSS properties to values. The live preview renders a demo element and applies the fully constructed animation property to it — the browser's own CSS animation engine runs the preview. On each change, the @keyframes rule and animation shorthand are regenerated from the state array by serializing each keyframe's property map and merging the animation timing settings.

Technical Stack

Browser-native CSS @keyframesWeb Animations APIReact timeline stateClient-side only