completefrontend

What is Interaction to Next Paint (INP)?

Interaction to Next Paint is the Core Web Vital for responsiveness. Here's what it measures, what a good score is, and how to find and fix the code behind a slow click.

A click followed by three bars, input delay, processing, and presentation delay, ending at the next paint

You tap Add to cart. Nothing happens. You tap again, and now there are two in your cart. That pause between your tap and the page reacting is what Interaction to Next Paint measures.

Interaction to Next Paint (INP) is the Core Web Vital that measures how quickly a page responds when someone clicks, taps, or presses a key. It times each interaction from the input to the next frame the browser paints, and reports one of the slowest for the whole visit. A good INP is 200 milliseconds or less.

What does INP measure?

Think of a waiter in a busy café. You raise your hand. The waiter is carrying plates to another table, so you wait. Then they come over and take your order. Then they walk back to the counter and pin your order slip up where you can see it. That whole stretch, from raising your hand to seeing something happen, is one interaction.

A web page goes through the same steps:

  1. You click, tap, or press a key.
  2. The browser runs the page's code for that input.
  3. The browser paints the next frame, so you see the result.

INP is the time from step 1 to step 3. It stops at the next paint: the first moment the screen can show that the page heard you.

These count as interactions:

  • Clicks with a mouse
  • Taps on a touch screen
  • Key presses, including typing in a text box

Hovering and scrolling don't count. A visit where someone only scrolls has no INP at all.

What is a good INP score?

INP thresholds: good is 200 ms or less, needs improvement is over 200 ms up to 500 ms, and poor is over 500 ms
Google judges INP on the 75th percentile of real visits.
INP Rating
200 ms or less Good
Over 200 ms, up to 500 ms Needs improvement
Over 500 ms Poor

Google looks at the 75th percentile of real visits to a page, with phones and computers counted separately. So at least three out of four visits need an INP of 200 ms or less for the page to pass.

How is one number picked for a whole visit?

A visit can have hundreds of interactions. INP turns them into one number:

  • With fewer than 50 interactions, INP is the slowest one.
  • With more, INP skips one of the slowest for every 50 interactions. On a visit with 120 interactions, it skips the two slowest and reports the third slowest.

It works like a teacher who drops one bad test for every 50 a student takes. One off day in a long term doesn't decide the grade, but a habit of slow answers still shows up.

Why did INP replace First Input Delay?

INP became a Core Web Vital in March 2024, taking the place of First Input Delay (FID). FID had two blind spots:

  • It looked only at the first interaction on the page.
  • It measured only the wait before the page's code started running. It ignored the code itself and the paint after it.

Back in the café, FID only timed how long the waiter took to notice your first raised hand. It never timed taking the order, or any order after the first. INP times every order, from your raised hand to the slip on the counter.

What are the three parts of an interaction?

A 190 ms click split into 40 ms of input delay, 100 ms of processing, and 50 ms of presentation delay before the next paint
One click from the input to the next paint. Its time is the three parts added together.

Every interaction's time is made of three parts, one after the other:

  1. Input delay. The page was busy when you clicked, so your click waited in line. Long tasks from other code cause this: analytics, ads, or a big chunk of JavaScript still starting up.
  2. Processing duration. The page's event handlers for your click run. Slow or heavy handlers make this part long.
  3. Presentation delay. The browser works out the new styles and layout, then paints the frame. A huge change to the page makes this part long.

To fix a slow interaction, first find out which part is slow. Each one has its own fixes.

Here's a click handler that makes the processing part slow on purpose:

button.addEventListener("click", () => {
  const end = performance.now() + 300;
  while (performance.now() < end) {} // keeps the main thread busy for 300 ms
  message.textContent = "Saved";
});

The browser can't paint until the handler finishes, so "Saved" appears at least 300 ms after the click. That's well past the 200 ms limit, and the browser hasn't even started painting yet.

How do you find slow interactions?

Start with what real visitors experience, then reproduce it on your own machine.

From real visitors. The web-vitals library reports INP from your users' browsers, with the details you need to fix it:

import { onINP } from "web-vitals/attribution";

onINP(({ value, attribution }) => {
  sendToAnalytics({
    inp: value,
    element: attribution.interactionTarget,
    inputDelay: attribution.inputDelay,
    processing: attribution.processingDuration,
    presentation: attribution.presentationDelay,
  });
});

interactionTarget is a CSS selector for the element people used, such as #checkout>button. The three times tell you which part to fix. sendToAnalytics stands for your own code that sends the numbers to your server.

For pages with enough traffic, PageSpeed Insights also shows the INP that Chrome users actually had, from the Chrome User Experience Report.

On your own machine. Open the Performance panel in Chrome DevTools. Before you record anything, it shows your INP live as you click around the page. Then record a trace, repeat the slow click, and look for long tasks on the main thread right after it.

Lighthouse's standard page-load test can't measure INP, because nobody clicks during it. Total Blocking Time is its stand-in: a page with a lot of blocking time usually responds slowly too.

How do you fix a slow interaction?

Show the change first, then do the work

The most useful habit: update what people see, let the browser paint it, and only then do the slow part.

button.addEventListener("click", async () => {
  message.textContent = "Saving…"; // what people see right away
  await yieldToMain(); // let the browser paint it
  saveDraft(); // the slow part, after the paint
});

function yieldToMain() {
  if (globalThis.scheduler?.yield) return scheduler.yield();
  return new Promise((resolve) => setTimeout(resolve, 0));
}

await yieldToMain() hands the main thread back to the browser for a moment. The browser paints "Saving…", so the interaction ends there, and saveDraft() runs after it. Chrome and Firefox have scheduler.yield(). In other browsers, the function falls back to setTimeout.

Break up long tasks

A task that runs for more than 50 ms is a long task. While it runs, every click waits behind it. Split big loops and long chains of work into smaller pieces, and yield between them. Long tasks and Breaking up long work show how.

Keep the update small

The presentation delay grows with how much of the page changes. Updating one row is cheap. Re-rendering a list of thousands of items is not. Keep the page's DOM small, and change only what the interaction needs. DOM size explains why size matters.

Move heavy work off the main thread

Work that doesn't touch the page, like parsing a large file or filtering a big list of data, can run in a web worker. The main thread stays free to answer clicks. See Web workers for performance.

Watch out for third-party scripts

Ads, chat widgets, and tag managers run on the same main thread as your code. If they run long tasks when people click, they add input delay to your interactions. Load them later, or only on the pages that need them.

Does INP include network requests?

No. INP stops at the next paint. If a click starts a fetch that takes two seconds, those two seconds don't count, as long as the page paints something quickly, such as a spinner or a loading message. What does count is any slow code that runs before that first paint.

That's a big reason to always show feedback right away. A page that shows a spinner within 50 ms feels responsive and scores well, even when the data takes a while.

Learn INP step by step

This post covers the basics. The web performance course goes deeper, with examples you can run: