← Cubic Bezier Playground

Cubic Bezier Playground: Practical Tips and Common Mistakes

Reviewed by the OnlineFree.app team · Updated

Key points

  • cubic-bezier() takes four numbers: two control points that shape how a transition accelerates, decelerates and settles.
  • Only y values may exceed the 0–1 range; an x1 or x2 outside it makes the whole declaration invalid in browsers.
  • Overshoot curves only read as bouncy on properties that can visibly pass their end value, such as transform.
  • The reverse of cubic-bezier(x1, y1, x2, y2) is cubic-bezier(1 − x2, 1 − y2, 1 − x1, 1 − y1).
  • Test a curve at the duration and distance you will actually ship, not at the playground's default.

What the four numbers in cubic-bezier() mean

The four values inside the parentheses describe the shape of an easing curve: cubic-bezier(x1, y1, x2, y2) gives the coordinates of two control points on a curve that always starts at (0, 0) and ends at (1, 1). The x axis is time as a fraction of the duration, the y axis is progress toward the final value, and the two anchors are fixed at the start and end.

The CSS Easing Functions specification constrains x1 and x2 to the 0–1 range, because time cannot run backwards inside a transition. The y values have no such limit, which is exactly how overshoot and spring-style curves are built: the progress value climbs past 1 and then settles back to it.

Because the two control points move independently, a curve can be strongly asymmetric — slow to start and fast to finish, or the reverse. That asymmetry is the reason to leave ease-in-out behind. Cubic Bezier Playground plots the same four numbers you paste into your stylesheet, so you never have to eyeball a curve from the numbers alone.

Start from a preset, then drag the handles

The tool ships presets so you are not staring at a blank grid: linear, ease, ease-in, ease-out and ease-in-out, plus three shapes that are much harder to guess by hand — snappy at cubic-bezier(0.4, 0, 0.2, 1), overshoot at cubic-bezier(0.34, 1.56, 0.64, 1) and spring-ish at cubic-bezier(0.22, 1.2, 0.36, 1). Choosing one snaps both control points onto the curve.

Dragging a handle afterwards flips the select back to custom. That behaviour is deliberate: you keep the preset's shape as a starting point, but the tool stops claiming you are still on a named curve. A curve that is one tick away from snappy is not snappy, and the label should not imply otherwise.

In practice, snappy is a solid default for elements that appear and disappear — menus, toasts, drawers — because it accelerates quickly and lands softly. The two overshoot presets are the ones worth experimenting with, since their y values above 1 are the entire point.

Why does my overshoot curve look flat?

Because the property you are animating clamps at its end value. Opacity is the clearest case: an interpolated value of 1.2 is rendered as 1, so cubic-bezier(0.34, 1.56, 0.64, 1) applied to opacity behaves like an odd-looking ease-out with no bounce at all. Transform properties such as translate and scale do show the overshoot, because passing the target and returning is visible geometry.

Width sits in between. It can overshoot in principle, but animating it forces layout work on every frame, so a springy width animation usually reads as jank rather than bounce. Prefer scale or translate when you want the curve to be felt.

If a curve looks right in the playground and wrong in production, compare the property you previewed with the property you shipped. The preview property selector exists for exactly that check: switch it to opacity, width or transform and watch the same four numbers behave differently.

Duration and distance change how a curve feels

A timing function is relative, not absolute. It distributes progress across whatever duration and distance you give it, so the same curve stretched over 1200 ms will feel sluggish and over 120 ms will feel abrupt. The tool's duration field runs from 50 ms to 5000 ms in 10 ms steps and defaults to 400 ms; treat that default as a starting point for testing, not a recommendation.

Distance matters just as much. Moving 8 pixels in 400 ms reads as almost instantaneous, while the identical transition over 400 pixels reads as slow. Test near the distance your interface actually uses, otherwise you are tuning a motion nobody will see.

The generated snippet uses the duration from the field, so whatever you preview is what you copy. That consistency is the main reason to shape the curve here rather than tweaking milliseconds in a stylesheet and reloading.

Mistakes that break easing in production

The most common is an out-of-range x value. A hand-typed cubic-bezier(1.2, 0, 0.8, 1) is invalid, and browsers drop the declaration rather than clamping it, so the element silently falls back to the default ease. The playground clamps x while you drag and lets y overshoot freely, which mirrors what the spec permits.

The second is a missing duration unit. Writing transition: transform 0.4 cubic-bezier(0.4, 0, 0.2, 1) is invalid because 0.4 has no unit, so the transition-duration falls back to 0s and nothing animates. Use 400ms or 0.4s.

The third is reusing an entry curve for the exit. An element that eases out as it appears usually wants the mirrored curve as it leaves. The reverse of cubic-bezier(x1, y1, x2, y2) is cubic-bezier(1 − x2, 1 − y2, 1 − x1, 1 − y1) — so ease-out, cubic-bezier(0, 0, 0.58, 1), reverses to cubic-bezier(0.42, 0, 1, 1), which is ease-in.

Finally, applying one timing function to transition: all. Different properties have different visual weight, and a curve that suits a transform often feels wrong on a color or an opacity fade. Declare them separately.

Copy the snippet and verify it in context

The output is a drop-in block such as .my-element { transition: transform 400ms cubic-bezier(0.4, 0, 0.2, 1); }, with the values you actually dragged. For keyframe work, move the same cubic-bezier() into animation-timing-function or the animation shorthand; it is the same easing function in both places.

Everything runs in the browser tab. No curve is uploaded, no account is created, and nothing is retained after you close the page, which matters if you are tuning an unreleased interface. The trade-off is that you must copy the value before you leave.

Once the CSS is in your stylesheet, confirm the motion with the browser's animation inspector rather than trusting your eyes at full speed, and check it on a slower machine or a throttled CPU. When you want other browser-only utilities for the rest of the build, the free online tools on OnlineFree.app run on the same no-signup, no-upload model. For the underlying syntax and edge cases, the MDN reference for cubic-bezier() is the most reliable companion to the playground.

Frequently asked questions

Is the Cubic Bezier Playground free, and does it store my curves?

Yes, it is free and runs entirely in your browser. Dragging control points, changing duration and copying the snippet all happen locally, with no account and no upload. Because nothing is saved server-side, your curve will not be there when you return, so copy the cubic-bezier() value or the full snippet into your stylesheet before closing the tab.

Can cubic-bezier() values go above 1 or below 0?

Only the y values can. The CSS easing specification requires x1 and x2 to stay between 0 and 1, because the x axis represents time and a transition cannot run backwards. Browsers reject a value like cubic-bezier(1.2, 0, 0.8, 1) outright. The y1 and y2 values are unbounded, which is how overshoot curves work, and the playground clamps x for you while letting y pass 1.

Does the same cubic-bezier() work for CSS animations?

Yes. cubic-bezier() is a timing function, so it fits animation-timing-function and the animation shorthand exactly as it fits transition-timing-function. The difference is scope: in a transition it shapes one property change, while in a keyframe animation the timing function applies to each keyframe segment unless you override it inside an individual keyframe block.

What duration should I use with a custom easing curve?

There is no universal number. The Cubic Bezier Playground's duration field spans 50 ms to 5000 ms and defaults to 400 ms, but the right value depends on distance and element size — the same curve reads as snappy over a few pixels and slow over a few hundred. Test the duration you intend to ship, on the property you intend to animate.

How do I reverse an easing curve for the exit animation?

Mirror both control points: the reverse of cubic-bezier(x1, y1, x2, y2) is cubic-bezier(1 − x2, 1 − y2, 1 − x1, 1 − y1). So ease-out, cubic-bezier(0, 0, 0.58, 1), becomes cubic-bezier(0.42, 0, 1, 1), which is ease-in. Dragging the handles into that mirrored position in the playground is usually faster than doing the arithmetic by hand.

References

Try Cubic Bezier Playground free — no sign-up, works in your browser
Open the tool →

More free tools

Step-by-step guides in our blog & guides.

محول Pdf الى وورد Morocco End Of Service Benefits Calculator Password Generator With Words Css Gradient Generator Online Image Compressor Target Size Kb Free Coupon Maker Printable Generatore Qr Code Gratis Per Sempre مولد الصوت بالذكاء الاصطناعي Free 401 K Calculator Free Unit Converter