Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4791 pages

Free tool · Developer tools

CSS cubic bezier generator

Pick a curve or type the four control point numbers and the CSS cubic bezier generator gives you the cubic-bezier() value, a graph and a live test. The default cubic-bezier(0.25, 0.1, 0.25, 1) is the ease keyword and reaches 80.2% of the move at half the time.

  • Free
  • No sign-up
  • Runs in your browser

By Maaz Zindani · Updated

Your easing

cubic-bezier(0.25, 0.1, 0.25, 1)the same curve as the ease keyword

cubic-bezier(0.25, 0.1, 0.25, 1) transition: transform 300ms cubic-bezier(0.25, 0.1, 0.25, 1); animation-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1);
  • 80.2% done at half the time
  • Stays between 0% and 100%
  • 300 ms long
Done at 25% of the time
40.9%
Done at 50% of the time
80.2%
Done at 75% of the time
96.0%
Highest point
none
Progress over time
TimeAtProgressA 300 px move
0%0 ms0.0%0 px
10%30 ms9.5%28.4 px
20%60 ms29.5%88.6 px
30%90 ms51.3%154 px
40%120 ms68.3%204.8 px
50%150 ms80.2%240.7 px
60%180 ms88.5%265.6 px
70%210 ms94.1%282.2 px
80%240 ms97.6%292.7 px
90%270 ms99.4%298.3 px
100%300 ms100.0%300 px

How to use the CSS Cubic Bezier Generator

  1. Choose a curve in Start from a curve, or type x1, y1, x2 and y2.
  2. Set the Duration in milliseconds.
  3. Press Play to watch a block move with your curve, and read the graph and the table.
  4. Press Copy cubic-bezier() or Copy CSS lines and paste the result into your stylesheet.

How does a cubic bezier easing curve work?

A cubic bezier easing curve is a smooth line from the point (0, 0) to the point (1, 1). Along the bottom runs time, from the start of the animation to its end. Up the side runs progress, from the starting value to the final value. The curve shows how far the animation has got at each moment, and a steeper part means faster movement.

Two control points set the shape. They are written as four numbers, x1, y1, x2 and y2, in cubic-bezier(x1, y1, x2, y2). Both x values must be from 0 to 1, and CSS drops a declaration that breaks this rule. The y values can be anything, which lets a curve go above 1 or below 0.

The default cubic-bezier(0.25, 0.1, 0.25, 1) is the ease keyword. At 10% of the time it has done 9.5% of the move, at 50% it has done 80.2%, and at 90% 99.4%. For a 300 px move that is 240.7 px at the halfway point. The table shows the whole curve in steps of 10%.

Progress of cubic-bezier(0.25, 0.1, 0.25, 1) over 300 ms
TimeAtProgressA 300 px move
0%0 ms0.0%0 px
10%30 ms9.5%28.4 px
20%60 ms29.5%88.6 px
30%90 ms51.3%154 px
40%120 ms68.3%204.8 px
50%150 ms80.2%240.7 px
60%180 ms88.5%265.6 px
70%210 ms94.1%282.2 px
80%240 ms97.6%292.7 px
90%270 ms99.4%298.3 px
100%300 ms100.0%300 px

What do the four numbers in cubic-bezier() mean?

The first pair, x1 and y1, is the handle at the start of the curve. The second pair, x2 and y2, is the handle at the end. A long first handle that points up makes a fast start, and a second handle level with the top and to the left of the end point makes a slow end. The keywords are shortcuts for fixed sets of numbers. The table gives the numbers behind each keyword and the progress at a quarter, half and three quarters of the time.

A straight line, cubic-bezier(0, 0, 1, 1), moves at one speed all the way, so progress always equals time.

The four keywords as numbers
KeywordNumbersAt 25%At 50%At 75%
ease(0.25, 0.1, 0.25, 1)40.9%80.2%96.0%
ease-in(0.42, 0, 1, 1)9.3%31.5%62.2%
ease-out(0, 0, 0.58, 1)37.8%68.5%90.7%
ease-in-out(0.42, 0, 0.58, 1)12.9%50.0%87.1%

How do I make an easing curve that overshoots?

Put a y value above 1 to overshoot, or below 0 to pull back first. With cubic-bezier(0.34, 1.56, 0.64, 1) the move passes its end and comes back, peaking at 109.8% before it settles at 100%. With cubic-bezier(0.36, 0, 0.66, -0.56) the move first goes backward to -9.8%, then forward. The table gives progress at five moments for both.

An overshoot suits a small element that should feel springy, such as a menu or a toggle. On a long distance it can leave the screen, so test it with the Play button.

Two curves with a y value outside 0 to 1
TimeOvershoot at the endPull back first
20%70.3%-4.2%
40%103.0%-9.7%
60%109.7%-3.0%
80%104.2%29.7%
100%100.0%100.0%

How do I use the curve in CSS?

Paste the value as the timing function of a transition or an animation. The copy button gives two lines, transition: transform 300ms cubic-bezier(0.25, 0.1, 0.25, 1); and animation-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1); The duration only stretches the curve in time. It does not change its shape, so 300 ms and 3,000 ms give the same graph.

Try the curve on the property you plan to animate, in the browsers and on the devices your visitors use, before you ship it.

Use it with

Questions

What is cubic-bezier() in CSS?

A timing function with four numbers that shape how an animation speeds up and slows down. cubic-bezier(0.25, 0.1, 0.25, 1) is the same as the ease keyword.

Why does CSS ignore my cubic-bezier value?

The x values, the first and third numbers, must be from 0 to 1. A value such as cubic-bezier(1.5, 0, 0.5, 1) is invalid, so the browser drops the declaration.

Can y be above 1 or below 0?

Yes. A y value above 1 gives an overshoot. The curve cubic-bezier(0.34, 1.56, 0.64, 1) reaches 109.8% before it settles at 100%.

What is the difference between ease-in and ease-out?

Ease-in starts slowly and ends fast, with 31.5% done at half the time. Ease-out starts fast and ends slowly, with 68.5% done at half the time.

Does the duration change the curve?

No. The duration sets how long the move takes, and the four numbers set how the speed varies within it.

Does this page send my curve anywhere?

No. The graph, the table and the test run in your browser, and nothing is uploaded.

Sources

The tool's results are computed in your browser by the code on this page, using the sources listed above; the explanations are checked against the tool's own output.