Favorites

CSS <easing-function> Data Type

<easing-function>
CSS Data TypeThis data type is supported by all modern browsers.
Updated 21st November 2026

The <easing-function> data type sets how the speed of a transition or animation changes over time, such as ease-in-out, steps() or cubic-bezier().

Looks like you're using an ad blocker, and that's fine! Ads help keep CSS Portal's generators and references free, so if the site's useful to you, visit our Support page to see other ways to help.

Description

The <easing-function> CSS data type describes how the speed of a transition or animation changes over its duration. Rather than moving at a constant pace, an animation can start slowly and speed up, slow down at the end, overshoot its target or move in steps. It is used by transition-timing-function, animation-timing-function and the transition and animation shorthands.

An easing function maps the progress of time (from 0 to 1) to the progress of the value (usually also from 0 to 1, though it can go beyond). There are three families. The linear keyword and the linear() function join points with straight lines, and linear() can approximate bounces and springs. The ease, ease-in, ease-out and ease-in-out keywords and the cubic-bezier() function produce smooth curves. The step-start and step-end keywords and the steps() function jump between a fixed number of values.

The default for both transitions and animations is ease. In general, ease-out curves feel responsive for elements entering the screen, and ease-in curves suit elements leaving it.

Examples:

.menu {
  transition: transform 300ms ease-out;
}

.loader {
  animation: spin 1s linear infinite;
}

.pop {
  transition: scale 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.clock-hand {
  animation: tick 60s steps(60) infinite;
}

Interactive Demo

Demo Code
HTML Code
<div class="demo-lane">
	<div class="demo-element"></div>
</div>
CSS Code
@keyframes demo-slide {
	from {
		translate: 0;
	}
	to {
		translate: 240px;
	}
}
.demo-lane {
	width: 300px;
	padding: 10px;
	box-sizing: border-box;
	background: #f4f4f4;
	outline: 1px dashed #b0b0b0;
}
.demo-element {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: #f72585;
	animation: demo-slide 2s ease infinite alternate;
	animation-timing-function: linear;
}

Syntax

<easing-function> = <linear-easing-function> | <cubic-bezier-easing-function> | <step-easing-function>

<linear-easing-function> = linear | <linear()>
<cubic-bezier-easing-function> = ease | ease-in | ease-out | ease-in-out | <cubic-bezier()>
<step-easing-function> = step-start | step-end | <steps()>

Values

  • linearConstant speed from start to finish. Equivalent to linear(0, 1).
  • easeStarts quickly, then slows toward the end. The default. Equivalent to cubic-bezier(0.25, 0.1, 0.25, 1).
  • ease-inStarts slowly and speeds up. Equivalent to cubic-bezier(0.42, 0, 1, 1).
  • ease-outStarts quickly and slows down. Equivalent to cubic-bezier(0, 0, 0.58, 1).
  • ease-in-outStarts and ends slowly. Equivalent to cubic-bezier(0.42, 0, 0.58, 1).
  • step-startJumps to the end value immediately. Equivalent to steps(1, jump-start).
  • step-endHolds the start value until the end, then jumps. Equivalent to steps(1, jump-end).
  • linear()A custom piecewise linear easing defined by a list of points.
  • cubic-bezier()A custom curve defined by two control points.
  • steps()A stepped easing with a given number of steps and jump position.

Example

<div class="wrap">
<h1>CSS &lt;easing-function&gt; examples</h1>
<div class="grid">
<div class="card">
<div class="track linear"><span class="ball"></span></div>
<div class="label">linear</div>
</div>
<div class="card">
<div class="track ease"><span class="ball"></span></div>
<div class="label">ease</div>
</div>
<div class="card">
<div class="track ease-in"><span class="ball"></span></div>
<div class="label">ease-in</div>
</div>
<div class="card">
<div class="track ease-out"><span class="ball"></span></div>
<div class="label">ease-out</div>
</div>
<div class="card">
<div class="track bezier"><span class="ball"></span></div>
<div class="label">cubic-bezier(0.34, 1.56, 0.64, 1)</div>
</div>
<div class="card">
<div class="track steps"><span class="ball"></span></div>
<div class="label">steps(5)</div>
</div>
</div>
</div>
/* Base demo layout */
* { box-sizing: border-box; }

body {
  margin: 24px;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
  background: #f5f7fb;
  color: #102a43;
}

.wrap {
  max-width: 860px;
  margin: 0 auto;
}

h1 {
  font-size: 20px;
  margin: 0 0 16px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 6px 18px rgba(16, 42, 67, 0.08);
}

.label {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
  font-size: 12px;
  color: #486581;
  margin-top: 10px;
  word-break: break-word;
}

.note {
  font-size: 13px;
  color: #486581;
  margin-top: 14px;
}

/*  examples */
.track {
  position: relative;
  height: 36px;
  border-radius: 18px;
  background: #e2e8f0;
}

.ball {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #2563eb;
  animation: slide 2s infinite alternate;
}

@keyframes slide {
  to { left: calc(100% - 32px); }
}

.linear .ball { animation-timing-function: linear; }
.ease .ball { animation-timing-function: ease; }
.ease-in .ball { animation-timing-function: ease-in; }
.ease-out .ball { animation-timing-function: ease-out; }
.bezier .ball { animation-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1); }
.steps .ball { animation-timing-function: steps(5); }
Open in editor

Browser Support

The following information will show you the current browser support for the CSS easing-function data type. Hover over a browser icon to see the version that first introduced support for this CSS data type.

This data type is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported

Looks like you're using an ad blocker, and that's fine! Ads help keep CSS Portal's generators and references free, so if the site's useful to you, visit our Support page to see other ways to help.