CSS Animation Generator
Choose one of 16 CSS effects, set timing and repetition, then copy keyframes or select the shorthand. A preset click or Replay starts the preview.
Animation Properties
Names are normalized for valid, consistent CSS; your draft stays intact. Exported name:
Preview
Initially static. A preset or Replay starts the demo; changes restart an enabled demo.
Reduced motion suppresses this square. Export needs destination-specific controls; this is not page conformance.
CSS code
Choose one of 16 CSS effects, set timing and repetition, then copy keyframes or select the shorthand. A preset click or Replay starts the preview.
Method and limits
Method and limits
Fixed keyframes are paired with duration, delay, iterations, direction, timing and fill. Exported @keyframes and animation references share one normalized identifier. Preview keyframes use a private name.
The square does not measure performance or certify accessibility. Exported CSS adds neither pause controls nor reduced-motion rules automatically; integrate these at the destination. Browser support and finite replay need destination testing.
The selected generator creates CSS from in-page controls. Copy requests clipboard access; refusal leaves selectable output. This does not verify other site traffic, storage or whole-page data handling.
CSS Animation Generator
Generate CSS animations instantly with our visual animation builder. Choose from 16 built-in presets including bounce, shake, pulse, fade, slide, rotate, flip, swing, rubber band, jello, heartbeat, flash, and zoom. Customize every animation property: duration, delay, iteration count, direction, timing function, and fill mode. Copy production-ready CSS code.
Copied
Copy failed. Select the result and copy it manually.
Popular Tools
About CSS Animation Generator
Choose one of 16 CSS effects, set timing and repetition, then copy keyframes or select the shorthand. A preset click or Replay starts the preview.
Fade In with duration 2s, delay 1s and one iteration outputs opacity 0 → 1, animation-duration: 2s, animation-delay: 1s and iteration-count: 1. forwards keeps the final frame; none restores the base style.
CSS generator method; no dated external dataset. Test the destination integration.
Use Cases
How to use
Choose Fade In, Bounce, Rotate, Zoom In or another effect; all 16 identifiers remain available.
Set duration from 0.1 to 5 seconds and delay from 0 to 3 seconds; Replay starts the square and Pause stops its progress.
Choose 1, 2, 3, 5 or infinite iterations and normal, reverse, alternate or alternate-reverse.
Set timing and fill, then enter a name; spaces become hyphens and reserved or digit-leading names receive animation-.
Compare shorthand and full CSS, copy @keyframes with .animated-element, then test destination motion controls and reduced-motion behavior.
Pro Tips
- Ease varies cycle speed; linear keeps it constant. Fill controls styles before or after a cycle, not repetitions.
- Infinite repeats until stopped. Assess automatic and interaction motion separately; WCAG 2.3.3 concerns disabling nonessential interaction motion.
- The duration slider stops at 5 seconds and steps in tenths. For anything slower, copy the code and edit the animation-duration value by hand; nothing else has to change.
- Pair alternate with an iteration count of 2 to get a there-and-back movement that ends where it started. With infinite and normal the element jumps back to the first keyframe on every loop.
Troubleshooting
The pasted CSS does nothing on my page.
The rule targets the class .animated-element, which probably does not exist in your markup. Either add that class to the element or rename the selector in the pasted code. The @keyframes block above it must stay, because the animation-name refers to it.
The element snaps back to its starting position when the animation ends.
That is the default fill mode none: outside its running time the element uses its normal styles. Set Fill mode to forwards so it keeps the last keyframe, or to both if it should also adopt the first keyframe during the delay.
Frequently Asked Questions
Your draft stays editable. “two words” becomes two-words in both rule and references. Choose a name unique to the destination stylesheet.
No. This intentionally triggered preview offers pause and respects reduced motion; exported CSS needs its own integration. Automatically moving information lasting over 5 seconds alongside other content may need pause/stop/hide under WCAG 2.2.2. Other motion, flashing and page requirements remain.
Declare a @keyframes rule with the states you want, then point an element at it with the animation properties. This generator does both: pick a preset, set duration, delay, iteration count, direction, timing function and fill mode, and copy the CSS code panel, which contains the @keyframes block plus an .animated-element class.
It decides how the element looks outside the animation's running time. none, the default, leaves the element with its normal styles. forwards keeps the last keyframe once the animation ends, backwards applies the first keyframe during the delay, and both does the two together.
ease starts slowly, speeds up and slows down again, which is why it is the CSS default; linear moves at one constant speed from start to finish. Switch the Timing function dropdown between them and watch the preview square: on a rotate preset the difference is very visible.
Set Iteration count to infinite, which is the value this generator starts with. The dropdown also offers 1, 2, 3 and 5. In the copied CSS this becomes animation-iteration-count: infinite, and in the shorthand it is the fifth value on the line.
Wrap the animation in a media query. Paste the generated code, then add @media (prefers-reduced-motion: reduce) { .animated-element { animation: none; } } so people who have asked their system for less movement do not get it. The generator does not add that rule for you.
animation: myAnimation 1s ease 0s infinite normal none;
bounce, shake, pulse, fadeIn, fadeOut, slideInLeft, slideInRight, slideInUp, rotate, flip, swing, rubberBand, jello, heartBeat, flash, zoomIn.
Performance depends on the animated properties, element and surrounding page. Measure the destination rather than inferring speed from this square.
Test the generated styles in the destination browser, page and input devices; this preview does not establish compatibility.