About CSS Animation & Easing Visualizer
This cubic-bezier generator shows how CSS easing functions change the feel of an animation. Play linear, ease, ease-in, ease-out and ease-in-out side by side with bounce, anticipate, expo and Material Design curves, or create a custom cubic-bezier(), then copy the value into your CSS transitions and animations.
How to use it
- 1Drag the cubic-bezier control points (P1, P2) on the interactive graph.
- 2Click Play Animation to preview the motion curve on sample objects.
- 3Copy the `cubic-bezier(x1, y1, x2, y2)` CSS code.
What a timing function does
An animation moves from start to end over a set duration. The timing function decides how fast it moves at each moment: steady, speeding up, slowing down, or overshooting. The same 300 ms movement can feel sluggish, snappy or playful depending only on the easing.
Built-in CSS easings
| Value |
Equivalent |
Feels like |
Good for |
linear |
cubic-bezier(0,0,1,1) |
Mechanical |
Spinners, progress bars, colour cycles |
ease |
cubic-bezier(0.25,0.1,0.25,1) |
Natural default |
General transitions |
ease-in |
cubic-bezier(0.42,0,1,1) |
Slow start, fast finish |
Elements leaving the screen |
ease-out |
cubic-bezier(0,0,0.58,1) |
Fast start, gentle stop |
Elements entering, menus opening |
ease-in-out |
cubic-bezier(0.42,0,0.58,1) |
Smooth both ends |
Moving between two positions |
Reading cubic-bezier()
cubic-bezier(x1, y1, x2, y2) defines two control points of a curve from (0,0) to (1,1). x is time, y is progress. y values above 1 or below 0 make the animation overshoot — the "bounce back" effect: cubic-bezier(0.34, 1.56, 0.64, 1).
Practical guidelines
- Durations: 150–300 ms for small UI changes (buttons, toggles), 300–500 ms for larger panels and modals.
- Enter with ease-out, exit with ease-in.
- Don't animate layout properties like
width or top when you can animate transform and opacity — they are smoother.
- Respect reduced motion: wrap large animations in
@media (prefers-reduced-motion: no-preference) for users who get motion sickness.
Choosing durations that feel right
Easing decides how motion feels; duration decides whether it feels quick or sluggish. Common ranges used in interface design:
| Kind of change |
Typical duration |
| Hover and small state changes (colour, opacity) |
100–200 ms |
| Small elements moving or appearing (tooltips, menus) |
150–250 ms |
| Larger panels, dialogs, drawers |
250–400 ms |
| Full-screen or page transitions |
300–500 ms |
Elements entering the screen usually feel best with ease-out (fast start, gentle stop). Elements leaving often use ease-in, and a little shorter duration, because users care less about something that is going away.
Respect reduced-motion settings
Some people get dizzy or distracted by animation and turn on "reduce motion" in their operating system. Honour it with a media query:
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
Keep essential feedback (a colour change, a focus ring) and drop large movements, parallax and auto-playing loops.
Frequently Asked Questions
What is the default CSS easing?
ease, which equals cubic-bezier(0.25, 0.1, 0.25, 1).
Which easing should I use for a dropdown or modal?
ease-out or a similar decelerating curve, so it appears quickly and settles gently.
What do the four cubic-bezier numbers mean?
They are the x and y coordinates of the curve's two control points. The x values must be between 0 and 1.
How do I make a bounce effect?
Use y values above 1 or below 0 in a cubic-bezier, or use keyframes for multiple bounces.
Does easing work with both transition and animation?
Yes. Use it in transition-timing-function or animation-timing-function.
How long should UI animations be?
Roughly 150–300 ms for small elements and up to about 500 ms for large movements.
What is prefers-reduced-motion?
A setting that some users enable to reduce motion. Use the CSS media query to shorten or remove animations for them.
Can I change the duration in the preview?
Yes. Set the duration in milliseconds before playing.
Explore Related Free Online Tools