CSS Portal

CSS Keyframe Animation Generator

The CSS Animation Generator is a free online tool that allows you to create and generate CSS animations without having to write any code. It provides a simple and intuitive interface for creating and customizing animations, and it also includes a library of pre-made animations that you can use as a starting point.

To use the CSS Animation Generator, simply select the animation type in the form below. You can then customize the animations duration, timing function, and other settings. Once you're happy with the animation, the CSS code will automatically be generated you can generate so you can code and paste it into your website.

The CSS Animation Generator is a great tool for beginners and experienced web developers alike. It's a quick and easy way to add animations to your website without having to learn the complex syntax of CSS animations.

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!
CSS Keyframe Animation Generator
Animation Settings
1s
Live preview active
2 keyframes
Timing Function
cubic-bezier(0.42,0,0.58,1)
Animation Presets
Keyframes
Editing Keyframe
0%
Preview
Color:
Scrubber 0.00s
Generated CSS
CSS

          
✓ Copied to clipboard!
If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!

About the CSS Animation Generator

Visual Timeline Editor

Click the timeline bar to add a keyframe at any percentage, or drag existing stops to reposition them. Each keyframe is colour-coded so you always know which stop you're editing. Tick marks at 0%, 25%, 50%, 75% and 100% keep you oriented.

Live Preview & Scrubber

Watch your animation play on a square, circle, text, or card shape. The scrubber lets you pause and drag through any frame - it uses the CSS animation-delay negative-offset technique to freeze the element at the exact moment you choose.

Timing Functions

Choose from 8 visual easing presets, dial in a custom cubic-bezier() with an interactive drag canvas, or configure stepped animations with fine control over step count and jump term. The active easing is applied to the preview immediately.

Rich Property Control

Add over 50 CSS properties per keyframe, grouped into categories like Transform, Colors, Box Model, Typography, SVG, and Filters. Numeric properties show a slider with a live number input. Transform sub-functions like translateY, rotateZ and scale are handled individually for precise control.

Clean Code Output

The generated CSS is always valid and production-ready. Multiple transform sub-functions are combined into a single transform: declaration. Toggle between pretty-printed and minified output, copy to clipboard, or download a .css file directly.

Import Existing CSS

Already have a @keyframes block? Paste it into the Import modal and the tool will parse every stop, decompose transform functions back into editable sub-properties, and restore animation settings like duration, easing and iteration count.

What are CSS Keyframe Animations?

CSS keyframe animations let you define style changes at specific points along an animation timeline. The browser interpolates between those states to produce fluid motion. An @keyframes rule names the animation and lists stops - each stop is a percentage (or the keywords from / to) paired with a set of CSS declarations. Eight animation-* properties then attach the keyframes to an element and control duration, delay, easing, repetition, direction, and fill behaviour.

Why use a visual generator?

Writing keyframe CSS by hand is repetitive and hard to iterate on - you save, refresh, and squint at the result every time you tweak a value. A visual editor closes that loop: changes appear in the preview instantly, the scrubber lets you inspect any frame in isolation, and the bezier canvas gives you tactile control over easing that no amount of cubic-bezier() trial-and-error can match.

GPU-accelerated properties

For smooth 60 fps animations, stick to transform and opacity. These properties are handled by the compositor thread and don't trigger layout or paint. Animating width, height, top, or left forces layout recalculation on every frame. When you need to move something, use translateX / translateY instead of positional properties.

Easing and cubic-bezier curves

The timing function shapes how a property value changes over the duration of each keyframe interval. ease starts slow, accelerates, then decelerates - it works for most UI animations. Spring and snap presets use custom cubic-bezier() values that produce an overshoot or quick-settle feel. For stepped animations, steps(n) divides the transition into discrete jumps, useful for sprite-sheet effects or typewriter text. To create your own cubic-bezier, please check out our Cubic-Bezier Generator.

Browser support

All modern browsers - Chrome, Firefox, Safari, and Edge - support unprefixed CSS animations. The -webkit- prefix was dropped from Safari in version 9 and is no longer needed for any supported browser. You can use the output from this tool without any modification for audiences on current operating systems.

prefers-reduced-motion

Users who have enabled the "reduce motion" system preference expect animations to be toned down or removed. Wrap your @keyframes usage in a @media (prefers-reduced-motion: no-preference) query, or provide an instant transition fallback inside @media (prefers-reduced-motion: reduce). This small step makes your animations inclusive without sacrificing the experience for everyone else.

CSS Properties Used:

Frequently Asked Questions

What is a CSS keyframe animation?

A CSS keyframe animation lets you define style changes at specific points along an animation timeline, with the browser smoothly interpolating between those states. A @keyframes rule names the animation and lists stops - each stop is a percentage (or the keywords from / to) paired with CSS declarations. The animation property (or individual animation-* properties) then attaches those keyframes to an element and controls duration, delay, easing, repetition, direction, and fill behaviour.

What is the difference between CSS animations and CSS transitions?

CSS transitions trigger automatically when a property value changes - for example when a user hovers over a button - and interpolate between the old and new value in a single step. CSS animations are more powerful: they run independently of state changes, can loop, reverse, and define multiple intermediate keyframe stops, and can start automatically when the page loads without any user interaction. Use transitions for simple hover or focus effects, and animations for anything involving multiple stages, looping, or auto-play behaviour.

What does animation-fill-mode do?

animation-fill-mode controls what styles are applied to an element before the animation starts and after it ends. none (the default) means the element returns to its original styles outside the animation period. forwards keeps the styles from the last keyframe applied after the animation finishes. backwards applies the styles from the first keyframe during the delay period before the animation starts. both combines the behaviour of forwards and backwards.

What is animation-direction and what are the options?

animation-direction controls the order in which keyframes play on each iteration. normal plays from 0% to 100% every cycle. reverse plays from 100% back to 0%. alternate plays forwards on odd iterations and backwards on even ones, producing a smooth back-and-forth effect. alternate-reverse does the same but starts by playing backwards on the first iteration.

How do I make a CSS animation loop infinitely?

Set animation-iteration-count: infinite on the element. You can also use the shorthand - for example animation: spin 2s linear infinite - where infinite is the iteration count value. If you want the animation to loop a specific number of times rather than forever, replace infinite with any positive number, including decimal values like 1.5 to play one and a half cycles.

What is the difference between animation-delay and a negative animation-delay?

A positive animation-delay pauses the animation for the specified time before it starts playing, which is useful for staggering multiple animations. A negative delay, such as animation-delay: -1s, starts the animation immediately but as if it had already been playing for that amount of time - so with a 2-second duration, a -1s delay starts the animation halfway through its first cycle. Negative delays are commonly used to offset looping animations so they feel more natural and less synchronised.

Which CSS properties are best to animate for performance?

For smooth 60fps animations, stick to transform and opacity. These properties are handled by the compositor thread and do not trigger layout recalculation or repaint on every frame. Animating properties like width, height, top, left, margin, or padding forces the browser to recalculate layout on every frame, which is significantly more expensive. When you need to move an element, use translateX or translateY instead of changing positional properties.

What is a cubic-bezier timing function in CSS animations?

A cubic-bezier() function defines a custom easing curve that controls how an animation accelerates and decelerates over time. It takes four values - x1, y1, x2, y2 - representing the control points of a cubic Bézier curve between (0,0) and (1,1). The named easing keywords are all shortcuts: ease is equivalent to cubic-bezier(0.25, 0.1, 0.25, 1), linear is cubic-bezier(0, 0, 1, 1), and ease-in-out is cubic-bezier(0.42, 0, 0.58, 1). Custom curves allow effects like overshooting, springing, or snapping that the named keywords cannot produce.

What does animation-play-state do?

animation-play-state lets you pause and resume a CSS animation without resetting it. Setting it to paused freezes the animation at its current point in the timeline. Setting it back to running resumes from where it stopped. This is commonly used with JavaScript to toggle animations on user interaction - for example pausing a looping background animation when a modal opens, then resuming when it closes.

How should I handle animations for users who prefer reduced motion?

Use the @media (prefers-reduced-motion: reduce) media query to tone down or remove animations for users who have enabled the "reduce motion" setting in their operating system. A common approach is to wrap all animation declarations in @media (prefers-reduced-motion: no-preference) so they only apply when the user has no motion preference, or to override animation-duration to an extremely short value like 0.01ms inside the reduce query. This makes your animations inclusive without removing them entirely for everyone else.

Do CSS animations work in all browsers?

Yes. All modern browsers - Chrome, Firefox, Safari, and Edge - support unprefixed CSS animations fully. The -webkit- prefix was dropped from Safari in version 9 and is no longer needed for any currently supported browser. CSS animations generated by this tool are production-ready and can be used without modification for any audience on a current operating system.

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!