CSSMar 17, 2026 Β· Updated Oct 13, 2026 Β· 4 min read

How to Create CSS Easing Curves and Animations

Easing curves control how animations accelerate and decelerate. The difference between a cheap-feeling animation and a polished one is almost always the easing β€” linear motion feels robotic, while a well-chosen curve feels natural and intentional. CSS gives you full control over easing with cubic-bezier().

🎬
Try the Easing Wizard
Free, no signup
β†’
DG
Derek Giordano
Designer & Developer
In this guide
01Built-In Easing Keywords02Custom Easing with cubic-bezier()03Common Custom Curves04Worked Example: How Far Along Is Each Curve?05Keyframe Animations with Easing06Animation Performance

Built-In Easing Keywords

CSS provides five easing keywords: ease (the default, cubic-bezier(0.25, 0.1, 0.25, 1): a quick rise that is 80% complete at the halfway point, then a long slow finish), linear, ease-in (slow start β€” suits exits), ease-out (fast start, gentle stop β€” suits entrances) and ease-in-out (slow at both ends β€” suits motion between two on-screen positions). There are also step-start, step-end and steps() for frame-by-frame changes, and linear() for curves cubic-bezier cannot draw.

Custom Easing with cubic-bezier()

cubic-bezier() defines a custom easing curve with four control points:

πŸ’‘ Tip
Animating width, height, top or left makes the browser redo layout, and usually paint, on every frame. Google’s web.dev animation guide recommends keeping animations to transform and opacity where you can, so they stay on the compositing stage; check with the Performance panel in your browser’s dev tools.
transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);

The four values are x1, y1, x2, y2 β€” the positions of two control handles on a timing curve. x values must be between 0 and 1; y values can exceed this range for bounce or overshoot effects. The Easing Wizard lets you drag control points visually and see the resulting motion in real time.

Common Custom Curves

Material Design 3 standard: cubic-bezier(0.2, 0, 0, 1). Material 3's own token files call the older cubic-bezier(0.4, 0, 0.2, 1) "legacy" β€” that is Material 2's "standard" curve, which is slow to start rather than an ease-out. Back (overshoot) in-out: cubic-bezier(0.68, -0.55, 0.27, 1.55) dips about 9% below the start and overshoots the end by about 9% before settling β€” an overshoot, not a bounce. Snappy entrance: cubic-bezier(0, 0.55, 0.45, 1). Note that cubic-bezier(0.25, 0.1, 0.25, 1), often labeled an "Apple-style spring" online, is simply the CSS ease keyword and has no spring at all.

Worked Example: How Far Along Is Each Curve?

We solved each curve numerically (the CSS Easing definition of cubic-bezier) and read off how much of the movement is done at a quarter, half and three quarters of the duration (script in our test folder, October 13, 2026):

Curve25% of time50%75%
ease41%80%96%
ease-out38%69%91%
ease-in-out13%50%87%
Material 2 standard (0.4, 0, 0.2, 1)24%78%96%
Material 3 standard (0.2, 0, 0, 1)61%88%98%
Back in-out (0.68, βˆ’0.55, 0.27, 1.55)βˆ’8%60%109%

Two practical points. The newer Material 3 curve front-loads the motion (61% done after a quarter of the time), which is why interfaces that adopt it feel faster at the same duration. And curves that finish early, like ease and both Material curves, look complete well before the duration ends, so a 400ms transition with them can often be shortened without looking abrupt.

For a real bounce or spring β€” several oscillations β€” cubic-bezier is not enough, because it can only overshoot once in each direction. The linear() function takes a list of points and draws any curve through them; MDN lists it in Chrome 113, Firefox 112 and Safari 17.2. Generators turn spring physics into a linear() list.

Keyframe Animations with Easing

For complex multi-step animations, use @keyframes with animation-timing-function:

@keyframes slideIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.element {
  animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

The easing applies to the entire animation. For different easing at different stages, set animation-timing-function within individual keyframe blocks.

Animation Performance

Animate only transform and opacity β€” these properties are GPU-accelerated and don't trigger layout recalculation. Animating width, height, margin, padding, top, or left forces the browser to recalculate layout on every frame, causing jank. If you need to animate size, use transform: scale() instead of width/height. Always respect prefers-reduced-motion by wrapping animations in @media (prefers-reduced-motion: no-preference).

Frequently Asked Questions

What is a CSS easing curve?+
An easing curve controls the acceleration of a CSS transition or animation. It determines whether motion is linear, starts slow, ends slow, or bounces. Custom curves use the cubic-bezier() function.
What is the best easing for UI animations?+
For elements entering the screen, an ease-out shape: fast start, gentle stop. Material Design 3's standard curve, cubic-bezier(0.2, 0, 0, 1), is a strong ease-out (61% of the motion done in the first quarter of the time). The older cubic-bezier(0.4, 0, 0.2, 1), Material 2's standard and now called "legacy" in Material 3's tokens, is better for elements moving between two on-screen positions.
How do I create a bounce animation in CSS?+
A single overshoot needs only cubic-bezier with y values outside 0–1, such as cubic-bezier(0.68, -0.55, 0.27, 1.55), which overshoots by about 9%. A true bounce with several rebounds needs the linear() easing function (Chrome 113+, Firefox 112+, Safari 17.2+) or keyframes with a separate timing function per segment.
Try it yourself

Use the Easing Wizard β€” free, no signup required.

⚑ Open Easing Wizard
DG
Derek Giordano
Written by the creator of Ultimate Design Tools. BA in Business Marketing.
⚑ Try the free CSS Transition Playground β†’