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
Check these values
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.
Your result
How it was worked out
How to use this tool
- Choose the kind of easing: a cubic-bezier curve, a CSS keyword, steps(), a Penner equation or a spring.
- Enter its numbers. For cubic-bezier you can start from a keyword in Start from a CSS keyword.
- Choose Draw the curve. The result shows the curve, the values over time and the CSS to copy.
- 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:
| 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.