Count-up animation

A count-up animation (number ticker) runs a number from a start value to its final value, or rolls each digit like an odometer, so a change in a figure is easy to see.

A count-up animation shows a number climbing to its value instead of appearing at once: a balance that ticks up after a payment, a statistic that counts up as it scrolls into view, or an odometer whose digits roll in columns. It draws the eye to a change and makes the size of the change feel real.

Use tabular numerals (font-variant-numeric: tabular-nums) so the width does not jitter as digits change, format with Intl.NumberFormat so separators stay right, and ease out so the count slows as it lands. For an odometer, each digit is a column of 0 to 9 moved with translateY.

Screen readers should hear the final value once, not every step: put the final number in an aria-label or update the live text only at the end. With reduced motion turned on, show the final number straight away.

function countUp(el, to, ms = 900) {
  const fmt = new Intl.NumberFormat();
  const start = performance.now();
  const tick = (now) => {
    const t = Math.min(1, (now - start) / ms);
    const eased = 1 - Math.pow(1 - t, 3); // ease-out
    el.textContent = fmt.format(Math.round(to * eased));
    if (t < 1) requestAnimationFrame(tick);
  };
  requestAnimationFrame(tick);
}

See it live

Related terms