# Easing curves you can feel

Source: https://websgeek.com/easing-functions-visualization
Publisher: WebsGeek (https://websgeek.com), updated 2026-11-25

By the end you will read an easing curve as speed, see how often your browser samples it, and know why ease-out suits entering and ease-in suits leaving.

## Time in, progress out

An easing function maps how much of an animation's time has passed to how far the animation has moved. On its graph, time runs left to right and progress runs bottom to top, so a steep stretch is fast motion and a flat stretch is slow motion. In CSS you set it with `transition-timing-function` or `animation-timing-function`, as a keyword such as `ease-out` or as a `cubic-bezier()`, `steps()` or `linear()` function.

A graph on its own is hard to feel. The panel below moves a box with the curve you pick, then plots what the box actually did: its position on top and its speed underneath.

> Interactive demo: Press a keyword (try it on the page).

Press a keyword. Each small dot is one frame. On every `requestAnimationFrame` the script reads the box's real position with `getComputedStyle()` and plots it against the elapsed time, so the dots are the browser's own output, not a drawing of what it should do. The readout counts them and measures the gap between frames. A 1.2 second run leaves about 72 dots on a 60Hz screen and about 144 on a 120Hz one. The browser never draws your curve. It samples it once per frame, and a faster screen simply samples it more often.

The teal line in the lower chart is speed: the change in position between two frames divided by the time between them, shown as a multiple of linear speed. Speed is what you actually feel. Worked out from its control points, `ease` starts gently, at about 0.4× linear speed, then peaks at about 2.3× only 21% of the way into the time and spends most of the duration landing. `ease-out` is already at its top speed, 1.72×, on the first frame. `ease-in` arrives at that same 1.72×, which is why it seems to hit a wall. Your measured peaks will usually read a little lower than the math, because each speed point is the average over one frame interval, which flattens the peak.

## Five keywords, one race

Every CSS keyword curve starts at 0, ends at 1 and takes exactly the duration you give it. The curves differ only in how they spend that time. The quickest way to compare them is to start five boxes at once.

> Interactive demo: Same distance, same duration (try it on the page).

All five boxes cross the line together. `linear` holds one speed, which looks mechanical. `ease-in` starts slowly and is still at full speed when it stops. `ease-out` leaves fast and glides in. `ease-in-out` is symmetric, slow at both ends. `ease` is the default for both transitions and animations.

The snapshot is where the real finding is. Worked out from the control points, at half time `ease` has covered 80% of the distance, `ease-out` 68%, `ease-in-out` exactly 50% and `ease-in` 32%. Your readout should land within a point or two, slightly high, because it fires on the first frame after the halfway mark. So the default is not a balanced curve. `ease-out` leads for only about the first fifth of the time, because it starts at full speed while `ease` starts at 0.4× linear. After that, `ease` overtakes it and stays ahead.

**The keywords are named cubic-bezier() curves.**

```
.menu {
  transition: transform 300ms ease-out;
}

/* ease        = cubic-bezier(0.25, 0.1, 0.25, 1) */
/* ease-in     = cubic-bezier(0.42, 0, 1, 1)      */
/* ease-out    = cubic-bezier(0, 0, 0.58, 1)      */
/* ease-in-out = cubic-bezier(0.42, 0, 0.58, 1)   */
/* linear gives the same output as
   cubic-bezier(0, 0, 1, 1)                       */
```

**One level deeper.** Easing changes progress, never duration. On each frame the browser divides the elapsed time by the duration to get a number from 0 to 1, passes it through the timing function, and uses the result to blend between the start and end values. When you animate only `transform` and `opacity`, browsers can do this on the compositor thread, so a busy main thread does not make the curve stutter. Inside `@keyframes`, the timing function applies to each segment between two keyframes, not to the animation as a whole.

## Drag your own curve

Each keyword is a cubic Bézier curve: it starts at (0, 0), ends at (1, 1) and bends toward two control points in between. `cubic-bezier(x1, y1, x2, y2)` gives the coordinates of those two points. Here you can move them and race the result against a keyword.

> Interactive demo: Drag the handles, then race the reference (try it on the page).

Drag either handle, or focus one and use the arrow keys, with Shift for bigger steps. When you let go, your box runs on the top track and a teal reference box runs underneath at the same moment. **Compare** cycles the reference through the keywords. A curve judged on its own is hard to read. Next to `ease`, you feel at once whether yours starts harder or lands softer. The second readout freezes both boxes at half time and measures overshoot on your track in pixels.

Try **back out**. A handle above the top line pushes the box past the end mark before it settles. From its control points, `cubic-bezier(0.34, 1.56, 0.64, 1)` peaks at 1.098, so the box overshoots by about 10% of the distance at about 57% of the time. The readout converts that into pixels on your screen, which is the number to check when an overshoot might collide with a neighbor. **anticipate** puts a handle below the bottom line, so the box backs up first. The y values can go anywhere. The x values must stay between 0 and 1, and the handles here will not cross that boundary.

**Copy CSS** gives you a complete transition with this curve and the duration from the next section. **Copy agent prompt** gives the same values as one sentence for a coding agent.

**One level deeper.** A Bézier curve is drawn by a hidden parameter that runs from 0 to 1, not by time. To find the progress at a given moment, the browser first finds the point on the curve whose x equals that moment, then reads its y. If x could leave the 0 to 1 range, the curve could fold back on itself, and one moment would have two progress values. With x locked, x only ever increases, so a short search always finds a single answer. Browser engines typically use a few Newton-Raphson steps with bisection as a fallback. The version below uses plain bisection.

**Turning cubic-bezier() into a function of time.**

```
// One axis of the curve, with fixed end points 0 and 1
const axis = (s, a, b) =>
  3 * (1 - s) * (1 - s) * s * a + 3 * (1 - s) * s * s * b + s * s * s;

const cubicBezier = (x1, y1, x2, y2) => time => {
  let lo = 0, hi = 1, s = time;
  for (let i = 0; i < 20; i++) {      // find s where x(s) = time
    s = (lo + hi) / 2;
    if (axis(s, x1, x2) < time) lo = s; else hi = s;
  }
  return axis(s, y1, y2);              // progress at that moment
};

const easeOut = cubicBezier(0, 0, 0.58, 1);
easeOut(0.5); // how far along at half time
```

## Duration, and the trip back

A curve has no speed of its own. The duration sets the speed, and it changes the feel more than most curve tweaks do. Drag the slider, then press Open and Close a few times. At the short end the box is simply there. Around 200 to 400ms it feels quick but readable. Push further and the same curve starts to feel like waiting. Those labels are judgments, not a standard: a large panel crossing the screen needs more time than a small badge.

> Interactive demo: Open, then close before it lands (try it on the page).

Now press Close while the box is still on its way. The readout reports where you caught it and how long the return really took in your browser. In **CSS transition** mode, the CSS Transitions specification tells the browser to shorten the return in proportion to the distance already covered. Caught at 46% of a 300ms trip, the box should come back in about 140ms. Switch to **animate() again**, the common pattern of starting a fresh `element.animate()` from the current position, and the same 46% takes the full 300ms, so a quick undo crawls. **reverse()** plays the running animation backward, so the return costs exactly the time already spent.

**One level deeper.** The teal trace is the box's measured speed, forward above the line and backward below it, with a dashed mark where you pressed Close. Pick `ease-in-out`, open, and close halfway in CSS mode. The trace falls from its peak straight to zero and then climbs again: the box stalls before it heads back. A reversed transition is a new transition, and it starts its timing function from time zero, so its speed resets. With `ease-out` the reset goes the other way. The return starts at its top speed, often faster than the box was moving forward, so it snaps back. Only `reverse()` keeps the speed continuous, because it walks back along the same curve. If people toggle a control often, as with hover menus and accordions, test the interruption, not just the full trip.

**A toggle that reverses smoothly mid-trip.**

```
let anim = null, open = false;

button.addEventListener('click', () => {
  open = !open;
  if (anim?.playState === 'running') {
    anim.reverse();   // same curve, backward, from here
    return;
  }
  anim?.cancel();     // drop the finished one so fills don't pile up
  anim = panel.animate(
    [{ translate: '0 100%' }, { translate: '0 0' }],
    { duration: 300, easing: 'ease-out', fill: 'both',
      direction: open ? 'normal' : 'reverse' }
  );
});
```

Each finished animation with `fill: 'both'` keeps its end value applied, so the code cancels the old one before starting the next. Note that `direction: 'reverse'` plays the `ease-out` curve backward, so the close behaves like `ease-in`. That is the pairing section 6 recommends for leaving.

The tuned snippet inside the panel combines the curve from section 3, this duration, the separate enter and exit curves from section 6 and the reduced-motion block from section 7. The exit runs at three quarters of the entrance duration.

## Steps, springs and linear()

`steps(n, position)` does not glide at all. It splits the time into `n` equal intervals, holds one value in each, and jumps between them. The position keyword decides where the jumps fall.

> Interactive demo: Three ways to jump (try it on the page).

Set a step count and press Run. `jump-end`, the default, also written `end`, holds at 0 first and reaches 1 only when time runs out. `jump-start`, also written `start`, jumps the moment the animation begins. `jump-both` jumps at both ends, which makes `n + 1` jumps around `n` held values. A fourth option, `jump-none`, holds exactly 0 first and exactly 1 last, and needs at least two steps. Use steps for things that really are discrete: sprite-sheet frames, a blinking cursor, a ticking clock hand.

**An eight-frame spinner with steps().**

```
.spinner {
  animation: spin 800ms steps(8) infinite;
}

@keyframes spin {
  to { rotate: 1turn; }
}
```

Some shapes no `cubic-bezier()` can draw. Its progress can cross the end line at most twice, so it can overshoot once but never swing back a second time. `linear()` takes a list of points and joins them with straight lines, and with enough points it follows any curve, including a spring.

> Interactive demo: Tune a spring, then race the closest Bézier (try it on the page).

The panel simulates a spring with the stiffness and damping you set, one step per millisecond, until it settles. It keeps only the points it needs to stay within 0.002 of the true curve and writes them out as a `linear()` value. The top lane runs that value. The teal lane runs the closest `cubic-bezier()` the page found by searching a grid of control points. Lower the damping and watch the point count, the string length and the gap between the two lanes grow: the Bézier overshoots once and then just settles, while the spring keeps swinging.

The first readout is not from a support table. It is what `CSS.supports()` returned in your browser just now. Chrome and Edge 113, Firefox 112 and Safari 17.2 added `linear()`. Older browsers drop a declaration with a value they do not understand, so put a `cubic-bezier()` fallback declaration first. A spring that has to carry the speed of your hand still needs script, as in [elastic toggles](https://websgeek.com/elastic-toggles).

**Generate a spring linear() at build time.**

```
function springToLinear(k = 170, c = 12, step = 16) {
  let x = 0, v = 0;
  const pts = ['0'];
  for (let ms = 1; ms <= 3200; ms++) {
    v += (k * (1 - x) - c * v) / 1000;   // pull minus friction
    x += v / 1000;
    if (ms % step) continue;             // keep one point per step
    const done = Math.abs(1 - x) < 0.001 && Math.abs(v) < 0.05;
    pts.push(done ? '1' : String(+x.toFixed(3)));
    if (done) return { duration: ms, easing: `linear(${pts.join(', ')})` };
  }
  pts[pts.length - 1] = '1';
  return { duration: 3200, easing: `linear(${pts.join(', ')})` };
}
```

## Ease out to arrive, ease in to leave

Motion guidelines keep landing on the same rule. Elements entering the screen use ease-out, and elements leaving use ease-in. Both lanes below use the same durations. Only the curves are swapped, and the readout measures the result.

> Interactive demo: Show and hide both cards (try it on the page).

Press Show and watch the left card. It arrives at speed and spends its last moments settling, so it seems to answer the click straight away. The right card dawdles at the start, which reads as lag, then slams into place. Press Hide: on the left the card lingers for a beat and then accelerates away, while on the right it rushes off and then crawls through the last few pixels. Slow motion makes each phase clear.

The readout records when each card got within 2px of its final spot, and the result is less flattering than the rule suggests. On a trip of about 40px, keyword `ease-out` gets within 2px only at roughly 83% of the duration, against about 97% for `ease-in`. What `ease-out` wins is the first half: half the distance in about a third of the time. Turn on **Strong ease-out** to enter with `cubic-bezier(0.16, 1, 0.3, 1)`. The card is within 2px at about 44% of the time, and the rest of the duration is motion too small to notice. If you want an entrance that is readable early, the stronger curve does more than a shorter duration.

**Different curves for opening and closing.**

```
.menu {
  opacity: 0;
  translate: 0 8px;
  transition: opacity 200ms ease-in, translate 200ms ease-in; /* leaving */
}

.menu.open {
  opacity: 1;
  translate: 0 0;
  transition-duration: 300ms;
  transition-timing-function: ease-out; /* arriving */
}
```

**One level deeper.** The browser picks the transition from the style the element is changing to. When `.open` is added, the new style's `transition` properties apply, so the entrance uses `ease-out`. When `.open` is removed, the base rule applies, so the exit uses `ease-in`. That is why the arriving curve lives in the `.open` rule. If the element also has to leave the layout when it closes, [fading out of display: none](https://websgeek.com/css-transition-display-none) covers the extra step.

## Motion people can switch off

Some people feel dizzy or sick when things move on screen, and operating systems let them ask for less motion. CSS exposes that choice as the `prefers-reduced-motion` media query. Reduced motion does not have to mean no feedback. Keep the change of state and drop the travel.

> Interactive demo: Show the card with and without motion (try it on the page).

Press Show and Hide with the switch off, then turn it on and try again. With reduced motion the card fades in place. The change of state is just as clear, and nothing slides across your view. If your system already asks for reduced motion, the switch is locked on and follows the real setting.

**Keep the fade, drop the movement, in CSS.**

```
@media (prefers-reduced-motion: reduce) {
  .menu, .menu.open {
    translate: none;
    transition: opacity 200ms linear;
  }
}
```

**The same choice for script-driven animation.**

```
const calm = matchMedia('(prefers-reduced-motion: reduce)').matches;

card.animate(
  calm
    ? [{ opacity: 0 }, { opacity: 1 }]
    : [{ opacity: 0, translate: '0 24px' }, { opacity: 1, translate: '0 0' }],
  { duration: calm ? 200 : 300, easing: calm ? 'linear' : 'ease-out' }
);
```

Easing never replaces focus management or announcements. If a panel opens, move focus to it or announce it exactly as you would without animation. Keep controls usable while things move: a button that ignores clicks until an animation finishes feels broken. For confirmations that need to be seen and heard, see [a save you can see land](https://websgeek.com/a-save-you-can-see-land).

**When to use it.** Use ease-out for anything that appears or responds to a press, and a strong one when it must be readable early. Use `ease-in` for things being dismissed. Use `ease-in-out` for elements that move between two places in view, such as a reordered card. Use `linear()` for springs and bounces that run on their own, with a `cubic-bezier()` fallback first. Use `linear` for continuous motion such as a spinner, and `steps()` for discrete frames. For toggles people reverse mid-way, use `reverse()` or check the stall and snap in section 4.

**When not to.** Do not reach for a custom curve to fix a duration problem; try a shorter time first. Never use `ease-in` on something entering, because it reads as lag. Keep strong overshoot away from frequent or serious UI, such as menus opened all day or error messages: a bounce is charming once and tiring by the tenth time. And skip animation entirely when a change is instant by nature, such as text appearing as you type.

## Quick answers

**What is an easing function?**
An easing function maps how much of an animation's time has passed to how far the animation has moved. On its graph, time runs left to right and progress runs bottom to top. A steep stretch means fast motion and a flat stretch means slow motion. In CSS you set one with transition-timing-function or animation-timing-function, using a keyword, cubic-bezier(), steps() or linear().

**What is the difference between ease-in and ease-out?**
ease-in starts slowly and is still at full speed when it stops, so it seems to hit a wall. ease-out leaves fast and glides to a stop. Entering elements usually use ease-out because it covers most of the distance early, about half of it in a third of the time, so the element seems to answer at once. The keyword ease-out still spends most of its duration landing, so if the element must be readable early, use a stronger curve such as cubic-bezier(0.16, 1, 0.3, 1). Leaving elements use ease-in, so they linger for a moment and then accelerate out of the way.

**How does cubic-bezier() work in CSS?**
cubic-bezier(x1, y1, x2, y2) defines a curve from (0, 0) to (1, 1) that bends toward two control points. The x values represent time and must stay between 0 and 1, so each moment has exactly one progress value. The y values can go outside that range. Above 1 makes the element overshoot and settle back, and below 0 makes it back up before starting.

**What does steps() do in a CSS animation?**
steps(n, position) splits the duration into n equal intervals, holds one value in each and jumps between them instead of gliding. jump-end, the default, holds at 0 first and reaches 1 only at the very end. jump-start jumps the moment the animation begins, jump-both jumps at both ends, and jump-none holds exactly 0 first and 1 last. Use it for sprite frames, cursors and spinners.

**What is the default easing in CSS?**
The default timing function for both CSS transitions and animations is ease, which equals cubic-bezier(0.25, 0.1, 0.25, 1). It starts gently, at about 0.4× linear speed, accelerates to a peak of about 2.3× near 21% of the time, and spends most of the duration landing. It reaches 80% of the distance at half time. Like every keyword curve, it starts at 0, ends at 1 and takes exactly the duration you set. Easing changes progress, never duration.

---
This is the text version of "Easing curves you can feel" from WebsGeek. The original page has live, interactive demos: https://websgeek.com/easing-functions-visualization
When you use or quote this, cite: Easing curves you can feel, WebsGeek, https://websgeek.com/easing-functions-visualization
