CSS Animation Generator
Visually build @keyframes CSS animations with presets, live preview, cubic-bezier editor, and ready-to-copy CSS, SCSS, and Tailwind output.
Updated
CSS Animation Generator
Visually build @keyframes animations with presets, live preview, and ready-to-copy CSS, SCSS & Tailwind output.
Preset & Name
Timing & Behavior
Keyframes
Live Preview
Generated Code
@keyframes my-animation {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
.my-animation {
animation-name: my-animation;
animation-duration: 1s;
animation-delay: 0s;
animation-iteration-count: 1;
animation-direction: normal;
animation-timing-function: ease;
animation-fill-mode: none;
animation-play-state: running;
}Frequently Asked Questions
What does it do?
Builds @keyframes animations visually. Pick a preset or define keyframe stops, tweak duration/delay/timing/direction, preview live, and copy CSS/SCSS/Tailwind.
Custom cubic-bezier?
Yes. Select cubic-bezier (custom) and a visual curve editor appears with x1/y1/x2/y2 inputs. The resulting value is applied to both the live preview and the generated code.
How accurate is Tailwind output?
Emits a tailwind.config.js snippet extending theme.keyframes/animation for animate-<name> utilities. The raw @keyframes CSS is included as a fallback.
Is the CSS Animation Generator free to use?
Yes, the CSS Animation Generator is 100% free with no registration, no hidden fees, and no usage limits. All processing happens locally in your browser, ensuring complete privacy.
Is my data safe with this tool?
Absolutely. The CSS Animation Generator processes everything client-side in your browser. No data is uploaded to or stored on any server. Your content remains private on your device at all times.
Does the CSS Animation Generator work on mobile devices?
Yes, the CSS Animation Generator is fully responsive and works on smartphones and tablets. You can use it on any device with a modern web browser -- no app download required.
Do I need to create an account to use this tool?
No account or registration is needed. Simply open the CSS Animation Generator in your browser and start using it immediately. There are no sign-up walls or usage restrictions.
What programming languages or formats does this support?
The CSS Animation Generator supports a wide range of popular formats and languages. Check the tool interface for the full list of supported options.
How do I use the CSS Animation Generator?
Simply enter your input in the provided field, adjust any settings to your preference, and the tool will process it instantly. You can then copy the result to your clipboard or download it.
Which browsers are supported?
The CSS Animation Generator works in all modern browsers including Chrome, Firefox, Safari, Edge, and Opera. For the best experience, use the latest version of your preferred browser.
What is the difference between a CSS transition and a CSS animation?
A CSS transition animates a property between two states and only runs in response to a trigger, such as a hover or a class change, moving smoothly from the old value to the new one. A CSS animation uses @keyframes to define many intermediate steps along a timeline and can run on its own as soon as the element loads, loop forever, reverse, or alternate direction. Transitions are best for simple one-off state changes like a button color fade, while animations handle multi-step motion such as a bounce, a spinner, or a sequence that touches several percentages between 0% and 100%. This generator builds the @keyframes route, letting you define each stop, set timing and iteration, preview it live, and copy clean CSS, SCSS, or Tailwind code.
What does animation-fill-mode do and when should I use forwards or both?
By default a CSS animation only styles an element while it is playing; before it starts and after it ends, the element snaps back to its normal styles. The fill-mode property changes that. "forwards" keeps the element on its last keyframe (100%) after the animation finishes, so a fade-in stays visible instead of disappearing. "backwards" applies the first keyframe (0%) during any delay before playback begins, preventing a flash of the un-animated state. "both" combines the two, holding the start frame during the delay and the end frame afterward, which is the safest choice for entrance effects. "none" disables all of this. Pick the wrong mode and your element flickers at the edges of playback. The generator exposes all four values, so you can toggle fill mode and watch the live preview react before copying the code.
How do I make a CSS animation loop forever, like a loading spinner?
Set the iteration count to "infinite" instead of a fixed number. The iteration count tells the browser how many times to play the @keyframes from start to finish; a value of 1 plays once, 3 plays three times, and "infinite" repeats endlessly until the element is removed or the animation is paused. For a smooth, never-ending spinner you also want a "linear" timing function so each rotation runs at a constant speed with no easing at the loop seam, plus a single keyframe that rotates from 0 to 360 degrees. The Spin preset in this generator already wires that up, but you can apply the same infinite count to any preset to create pulsing, wobbling, or breathing effects. Set iteration to infinite, pick linear easing if you need seamless looping, preview it, and copy the result.
What do the four cubic-bezier numbers mean in a CSS timing function?
A cubic-bezier timing function controls how an animation accelerates and decelerates over its duration, and it is defined by two control points written as x1, y1, x2, y2. The x values must stay between 0 and 1 because they represent progress through time, while the y values can go below 0 or above 1 to create overshoot or anticipation effects, like a value that springs past its target before settling. The first point shapes how the motion eases in at the start; the second shapes how it eases out at the end. The familiar named easings are just presets: ease-in is roughly cubic-bezier(0.42, 0, 1, 1), for example. This tool's visual curve editor lets you drag or type all four numbers and redraws the curve and live preview instantly, so you can fine-tune the feel before copying it.
Why does my CSS animation flash or jump back to the start when it ends?
That snap-back happens because, by default, an animation stops styling the element the moment it completes, so the element reverts to whatever its base CSS says. If your 0% keyframe sets opacity to 0 and the element's normal state is also invisible, a finished fade-in will vanish. The fix is animation-fill-mode: use "forwards" so the element holds its 100% keyframe after the animation ends, or "both" to also cover any start delay. A jump at the start of a loop usually means your 0% and 100% keyframes do not match, so the timeline cannot continue seamlessly. The generator helps you catch both problems: set a fill mode, align your first and last stops, and use the Replay button to watch the transition repeatedly until it is clean before copying the CSS.
Related Tools
Free API Tester Online
Test REST APIs with GET, POST, PUT, DELETE requests. Free, fast, and works entirely in your browser with no sign-up required.
Free cURL to Code Converter
Convert cURL commands to code in JavaScript, Python, PHP. Free, fast, and works entirely in your browser with no sign-up required.
Free JSON Schema Generator
Generate JSON Schema from your JSON data automatically. Free, fast, and works entirely in your browser with no sign-up required.
Free HTTP Headers Parser
Parse and analyze HTTP headers from requests and responses. Free, fast, and works entirely in your browser with no sign-up required.
About the CSS Animation Generator
The CSS Animation Generator is a free visual tool for building @keyframes animations without writing the boilerplate by hand. Pick a preset or define your own keyframe stops, dial in the timing, watch it animate live, and copy ready-to-use code in CSS, SCSS, or Tailwind. It is aimed at front-end developers, designers who write a bit of CSS, and anyone who wants a clean micro-interaction — a fade, a slide, a spinner — without memorizing animation syntax.
Everything runs locally in your browser. Nothing you build is uploaded to a server, there is no sign-up, and there are no usage limits. The live preview works by injecting a temporary <style> tag on your own page, so the animation you see is the exact code you copy.
Presets and the keyframe editor
Start from one of 15 built-in presets: Fade In, Fade Out, Slide In (left, right, up, down), Bounce, Pulse, Spin, Shake, Flip, Zoom In, Zoom Out, and Wobble. Each preset loads a set of keyframe stops you can edit freely.
A keyframe stop is a point in the timeline, expressed as a percentage from 0% (start) to 100% (end). For every stop you can set four properties:
- transform —
translateX/Y,scale,rotate,perspective, and any other valid CSS transform. - opacity — a value from 0 to 1 for fades.
- color — the text color at that moment.
- background — the background color at that moment.
Add as many stops as the motion needs with Add Stop, drag each one along the timeline, or delete the ones you do not want. The animation name is sanitized automatically to letters, numbers, hyphens, and underscores (up to 40 characters) so the generated CSS is always valid.
Timing, easing, and the cubic-bezier curve
The same animation feels completely different depending on its timing. The generator exposes every standard CSS animation property:
- Duration from 0.1s to 10s, and delay from 0s to 5s.
- Iteration count — a number, or
infinitefor loops like spinners. - Direction —
normal,reverse,alternate, oralternate-reverse. - Timing function —
ease,ease-in,ease-out,ease-in-out,linear, or a customcubic-bezier. - Fill mode —
none,forwards,backwards, orboth, which controls whether the element holds its first or last frame outside the animation. - Play state — toggle between
runningandpaused.
Choose the custom cubic-bezier option and a visual curve editor appears. A cubic-bezier function is defined by two control points, x1, y1, x2, y2, that bend the ease curve. Edit those four numbers and the curve redraws instantly, with the exact same value applied to both the preview and the exported code.
Live preview and copy-ready output
Test your animation against four preview shapes — a box, a circle, a text label, and a button — so you can judge how it reads on the kind of element you will actually use it on. The Replay button restarts the animation on demand, which is handy for one-shot effects you would otherwise only see once on load.
When the motion looks right, switch the output tab to the format you need:
- CSS — the full
@keyframesblock plus a class with all eight animation properties. - SCSS — the keyframes with duration and delay pulled out into Sass variables.
- Tailwind — a
tailwind.config.jssnippet that extendstheme.keyframesandtheme.animationso you can use ananimate-<name>utility, with the raw@keyframesincluded as a fallback.
Copy any of them to your clipboard with one click, or download the snippet as a .css, .scss, or .js file named after your animation. Because every preset and property maps to standard CSS, the result works in all modern browsers — Chrome, Firefox, Safari, and Edge — with no runtime library required.