Toolvito

Works on this device

Easing Function Visualizer

See how an easing function moves a value from its start to its end. Type a cubic-bezier curve, choose a CSS keyword, a steps() function, a Penner equation or a spring, and get the curve, a value table, the CSS line and a preview you can play and pause.

Enter your values

Type the two control points of cubic-bezier(x1, y1, x2, y2), or choose a CSS keyword from the list.

Your values

From 0 to 1. Both x values must stay in this range.

Below 0 the movement first goes back past the start.

Above 1 the movement goes past the end and comes back.

Used for the time column, the preview and the CSS line.

More options

11 rows give steps of 10% of the time.

Your values are worked out in this browser. They are not sent to a server.

Your result will show here

Fill in the values, then choose Draw the curve.

How to use this tool

  1. Choose the kind of easing: a cubic-bezier curve, a CSS keyword, steps(), a Penner equation or a spring.
  2. Enter its numbers. For cubic-bezier you can start from a keyword in Start from a CSS keyword.
  3. Choose Draw the curve. The result shows the curve, the values over time and the CSS to copy.
  4. Choose Play under Preview of the movement to see a dot move with this easing. Choose Pause to stop it, or move it with the slider.

How the curves are worked out

  • cubic-bezier(x1, y1, x2, y2) is a Bézier curve from (0, 0) to (1, 1) with the control points (x1, y1) and (x2, y2): B(t) = (1 − t)³·P0 + 3(1 − t)²t·P1 + 3(1 − t)t²·P2 + t³·P3. The x values must be from 0 to 1.
  • To find the value at a time x, the tool solves x(t) = x for t with Newton's method starting at t = x (at most 8 steps). If it does not reach the tolerance of 1e-12, it halves the range from 0 to 1 until it does. The value is then y(t).
  • steps(n, jump) follows the step algorithm of CSS Easing Functions Level 1 with exact fractions: jump-end (end) jumps at the end of each step, jump-start (start) at the start, jump-none at neither end and jump-both at both.
  • Penner equations (Robert Penner, 2001) are written with time and value from 0 to 1, as in most code libraries. The tool shows the formula of each one.
  • Spring: mass × acceleration = −stiffness × (value − 1) − damping × speed. The tool uses the exact solution for each damping ratio ζ = damping ÷ (2√(stiffness × mass)).
  • Speed is the slope of the curve: 1 is the steady speed of a linear change.

The CSS keywords

CSS Easing Functions Level 1 defines the keywords as these functions:

CSS easing keywords and their exact functions
Keyword Same as
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 a steady change: the value equals the time
step-start steps(1, jump-start)
step-end steps(1, jump-end)

Worked examples

  • ease at 50% of the time has the value 0.8024: the curve parameter is t = 0.6996, found by Newton's method in 5 steps.
  • ease-in-out at 25% of the time has the value 0.1292, so after a quarter of the time only 12.9% of the change is done.
  • steps(4, jump-end) at 60% of the time has the value 0.5; with jump-start it is 0.75.
  • easeInOutCubic at 25% of the time is 4 × 0.25³ = 0.0625. easeOutBack goes up to 1.1, 10% past the end, before it comes back.
  • A spring with mass 1, stiffness 100 and damping 10 has a damping ratio of 0.5. It swings 16.3% past the end, one swing takes 725.5 ms, and it stays within 0.1% of the end after 1,270.2 ms.

Limits you should know

  • CSS can use cubic-bezier(), the keywords and steps() directly. For Penner equations and springs the CSS line uses linear(), which joins points of the curve with straight pieces; the result says how far it is from the exact curve. Browsers added linear() in 2023, and older browsers ignore it.
  • The spring uses mass, stiffness and damping as in the equation above. Animation libraries name and scale these numbers in different ways.
  • The preview is drawn in this page. It shows the shape of the movement; it is not a frame-exact copy of a browser animation.
  • For the time and frames of a move use the Motion Design Calculator; for the path of a move use the Motion Path Generator.

Related tools