# Cubic Bezier Generator

URL: https://hifreetools.com/developer/cubic-bezier-generator

> Build and visualize CSS cubic-bezier() easing curves with four control values, a live curve preview, ready-made presets, and one-click copyable output.

## Quick answer

A cubic-bezier generator turns four numbers (x1, y1, x2, y2) into a CSS cubic-bezier() timing function and draws the matching easing curve. The X values must stay between 0 and 1, while Y values may exceed that range to create bounce or anticipation. Copy the result straight into transition-timing-function or animation-timing-function.

The curve is a parametric cubic Bezier with fixed endpoints P0 = (0, 0) and P3 = (1, 1) and two adjustable control points P1 = (x1, y1) and P2 = (x2, y2). For a parameter t from 0 to 1, the point is B(t) = (1-t)^3·P0 + 3(1-t)^2·t·P1 + 3(1-t)·t^2·P2 + t^3·P3. The X axis represents animation progress (time) and the Y axis represents the eased output. CSS requires x1 and x2 to lie in [0, 1] so the curve is a valid function of time, but y1 and y2 are unbounded, which is how overshoot easings like back-out are made. The tool clamps X inputs to [0, 1], leaves Y free, plots the curve and its control handles in an SVG, and emits cubic-bezier(x1, y1, x2, y2) with trailing zeros trimmed.

## Examples

- The built-in ease curve: x1=0.25, y1=0.1, x2=0.25, y2=1 → cubic-bezier(0.25, 0.1, 0.25, 1)
- Symmetric ease-in-out: x1=0.42, y1=0, x2=0.58, y2=1 → cubic-bezier(0.42, 0, 0.58, 1)
- Linear (no easing): x1=0, y1=0, x2=1, y2=1 → cubic-bezier(0, 0, 1, 1)
- Overshoot / back-out with y beyond 1: x1=0.34, y1=1.56, x2=0.64, y2=1 → cubic-bezier(0.34, 1.56, 0.64, 1)

## FAQ

**What is a cubic-bezier() function in CSS?**
It is a timing function that defines how a transition or animation speeds up and slows down. You supply four numbers, cubic-bezier(x1, y1, x2, y2), which place two control points between the fixed start (0,0) and end (1,1) of the curve. The shape of that curve determines the easing.

**Why must x1 and x2 stay between 0 and 1?**
The X axis represents time, which must move forward monotonically from 0 percent to 100 percent. Keeping x1 and x2 in [0, 1] guarantees the curve is a valid function of time. Values outside that range make the declaration invalid and CSS ignores it.

**Can y1 and y2 be greater than 1 or negative?**
Yes. Y values are intentionally unbounded. A y value above 1 makes the element overshoot its target and spring back, while a negative y value makes it pull back before moving forward (anticipation). This is the standard way to build bounce easings.

**How do the keywords ease, ease-in, and ease-out map to cubic-bezier?**
ease is cubic-bezier(0.25, 0.1, 0.25, 1), ease-in is cubic-bezier(0.42, 0, 1, 1), ease-out is cubic-bezier(0, 0, 0.58, 1), ease-in-out is cubic-bezier(0.42, 0, 0.58, 1), and linear is cubic-bezier(0, 0, 1, 1). Selecting a preset in this tool loads these exact values.

**Where do I paste the generated value?**
Use it as the value of transition-timing-function or animation-timing-function, for example transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1). You can also use it directly inside the transition shorthand after the duration.

**Does this tool send my values to a server?**
No. The curve is drawn and the CSS string is generated entirely in your browser with JavaScript and inline SVG. Nothing is uploaded, so it works offline and keeps your work private.

**Why does my curve go above or below the box?**
That happens when a Y control value is negative or above 1. The preview pads the drawing area so this overshoot is visible. It is valid CSS and produces a spring or anticipation effect, not an error.


## Sources

- [MDN Web Docs - easing-function (cubic-bezier)](https://developer.mozilla.org/en-US/docs/Web/CSS/easing-function)
- [W3C CSS Easing Functions Level 1](https://www.w3.org/TR/css-easing-1/)

Runs in the browser; nothing is uploaded. Cite as: HIFreeTools, "Cubic Bezier Generator", https://hifreetools.com/developer/cubic-bezier-generator
