Cubic Bezier Curve Generator
WM-113Set the two control points of a cubic-bezier() curve, or pick a preset, and see the curve drawn from the same numbers as the CSS. Copy the timing function or a full transition.
Runs in your browser. Nothing is uploaded.
Curve
Curve and CSS
| cubic-bezier() | cubic-bezier(0.25, 0.1, 0.25, 1) |
|---|---|
| Keyword with the same curve | ease |
| transition shorthand | transition: transform 600ms cubic-bezier(0.25, 0.1, 0.25, 1); |
| Progress at 25% of the time | 0.409 |
| Progress at 50% of the time | 0.802 |
| Progress at 75% of the time | 0.96 |
CSS
.element {
transition-property: transform;
transition-duration: 600ms;
transition-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1);
} How to use it
- Pick a preset, or leave it on Custom and enter the four numbers.
- Keep both X values between 0 and 1. Y values can go outside that range for an overshoot.
- Set the duration in milliseconds.
- Press Copy to take the CSS, or copy the cubic-bezier() value from the results.
Reading the curve
The curve runs from (0, 0) at the start to (1, 1) at the end. The horizontal axis is time and the vertical axis is progress. The two red points are the control points that bend the curve. A steep section means the animation moves fast there. Y values below 0 or above 1 make the animation go past its start or end and come back, a common bounce or anticipation effect.
What the progress rows tell you
The progress rows solve the curve exactly at 25, 50 and 75 percent of the time and show how far along the animation is at each point. For the ease curve, the middle of the time is already about 80 percent of the way through. When the numbers equal linear, ease, ease-in, ease-out or ease-in-out, the matching keyword is shown, which you can use instead.
Error messages and what to do
| Message | What it means | Fix |
|---|---|---|
Point 1 X must be between 0 and 1. | An X value is outside the range CSS allows. | Enter an X value from 0 to 1. |
Duration must be between 50 and 10000. | The duration is outside the supported range. | Enter a whole number of milliseconds from 50 to 10000. |
Questions people ask
Why must the X values be between 0 and 1?
X is time, and CSS requires the two control point X values to stay within 0 and 1 so the animation never runs backward in time. Browsers ignore a cubic-bezier with an X outside that range.
What do the four numbers in cubic-bezier mean?
They are x1, y1, x2 and y2: the coordinates of the two control points. The start (0, 0) and end (1, 1) are fixed, so you only set these two points.
What is the default easing in CSS?
The default timing function is ease, which is cubic-bezier(0.25, 0.1, 0.25, 1). It starts fast and slows toward the end. The ease preset here fills in exactly those numbers.
How do I make a bounce or overshoot?
Use a Y value above 1 for the second point, or below 0 for the first. The back presets do this, and the drawing grows taller to show the part of the curve outside 0 to 1.
Can I use the same curve in animations?
Yes. The same cubic-bezier() value works as animation-timing-function and as transition-timing-function. The code here uses it in a transition, and you can copy the value into an animation.
What is the difference between ease-in and ease-out?
Ease-in starts slowly and speeds up, so it suits things leaving the screen. Ease-out starts fast and slows down, so it suits things arriving. Ease-in-out does both.
About this tool
A CSS cubic-bezier(x1, y1, x2, y2) curve runs from (0, 0) to (1, 1) with two control points. X is time and must stay between 0 and 1; Y is progress and may go below 0 or above 1 for a back-and-forth overshoot. The drawing is made from the same four numbers as the CSS, with the control points in red. The progress rows solve the curve exactly for the time shown, so they show how far along the animation is. The easing presets are common curves; the keyword row is shown only when the curve equals linear, ease, ease-in, ease-out or ease-in-out.