Interaction to Next Paint (INP): make your page respond to every tap
How INP measures responsiveness, the three phases of every interaction, how to find the slow ones on your site, and practical ways to keep the main thread free.
By Abdessamad Bettal. Published . 4-minute read.
On this page
Interaction to Next Paint (INP) measures how quickly a page shows a response after someone interacts with it. A tap on a menu, a click on "Add to basket", a key press in a search box: each is timed from the input until the browser paints the next frame. 200 milliseconds or less is good, more than 500 milliseconds is poor, measured at the 75th percentile of real visits.
INP became a Core Web Vital in March 2024, replacing First Input Delay. The older measure only looked at the first interaction and only at the wait before it was handled. INP covers every interaction in the visit and the whole time until something visibly changes, which makes it a much better match for whether a page feels responsive.
Which interactions count
INP looks at clicks, taps and key presses. Scrolling, hovering and zooming do not count. During the visit the browser times each interaction, and when the visitor leaves it reports one of the slowest. On pages with many interactions, a small number of outliers are ignored, so one freak delay does not decide the result.
Because INP runs for the whole visit, a page can be fast on load and still fail: a filter that freezes the page after scrolling halfway down, or a slow menu, count just as much as anything that happens early.
The three phases of an interaction
Every interaction splits into three phases, and each has its own causes.
- Input delay. The time before the browser can start running your event handler, because the main thread is busy with something else, such as a script still loading or a timer firing.
- Processing time. How long your event handlers take to run.
- Presentation delay. The time from the end of your handlers until the next frame is painted: recalculating styles, laying out the page and painting.
The browser has one main thread for running JavaScript and drawing the page. Anything that keeps it busy for long, a long task of more than 50 milliseconds, pushes interactions back. Most INP problems come down to long tasks in the wrong place.
Find the slow interactions
Lab tools cannot measure INP on their own, because nobody is tapping. Lighthouse reports Total Blocking Time instead, which adds up long tasks during load and is a useful hint, but it does not see interactions after load.
To find real problems:
- Use your field data. A site lookup on pagespeed.tools shows whether INP fails and whether it is worse on phones or desktops.
- Reproduce it in Chrome DevTools. The Performance panel shows INP live as you interact with the page, and a recording shows which tasks ran during a slow interaction.
- Collect your own data. The open-source
web-vitalsJavaScript library can report INP from your visitors, including which element was interacted with and how long each phase took.
Test on a mid-range phone, or with CPU throttling turned on. A laptop hides problems that are obvious on the devices most of your visitors use.
Keep the main thread free
Break up long tasks
The most useful habit is to do the work the visitor can see first, then hand control back to the browser before doing the rest. Yielding lets the browser paint the response and handle the next input.
function yieldToMain() {
if (globalThis.scheduler?.yield) {
return scheduler.yield();
}
return new Promise((resolve) => setTimeout(resolve, 0));
}
async function onAddToBasket(item) {
showAddedState(item); // the change the visitor sees
await yieldToMain();
updateRecommendations(item); // everything else, later
sendAnalytics(item);
}
scheduler.yield() is available in Chromium-based browsers; the setTimeout fallback works everywhere.
Do less work in event handlers
Look at what runs on each click. Common culprits are re-rendering a large part of the page in a framework when only a small part changed, validating a whole form on every key press, and analytics or tag scripts that run synchronously on clicks. Debounce handlers that fire on every key press, and move work that does not affect what the visitor sees out of the handler.
Ship less JavaScript
Every script has to be downloaded, parsed and run, and all of that competes with interactions, especially while the page is still loading. Remove unused code, split bundles by route, and load scripts with defer or async. Review third-party scripts in particular: chat widgets, A/B testing tools and tag managers often account for the longest tasks. The page size checker counts the scripts a page loads and lists the other sites it loads them from.
Keep rendering cheap
If the presentation delay is large, the browser is struggling to redraw the page:
- Keep the page's element count reasonable. Very large DOMs make every style and layout recalculation slower.
- Avoid reading layout values, such as
offsetHeight, right after changing styles in a loop. This forces repeated layout work. - Use
content-visibility: autoon long sections that start off-screen, so the browser can skip rendering them until they are needed.
Check that the fix worked
Re-test the slow interaction in DevTools with throttling on, then watch the field data. Like the other Core Web Vitals, the figures cover the previous 28 days, so the change takes up to four weeks to show fully.
For how INP fits with loading and layout stability, see Core Web Vitals explained.
Check it on your own site
Written by
Web developer and the builder of pagespeed.tools: free tools for finding what slows a website down and fixing it.
More guides
Core Web Vitals explained: LCP, INP and CLS in plain languageWhat the three Core Web Vitals measure, the limits Google uses, how the 75th percentile and the 28-day window work, and where to start fixing a slow site.5-minute read
Largest Contentful Paint (LCP): what slows it down and how to fix itHow LCP is measured, the four parts every LCP time breaks into, and the specific fixes for slow servers, late-discovered images, heavy files and render-blocking code.5-minute read
Cumulative Layout Shift (CLS): stop your page from jumpingHow CLS is calculated, the usual causes of layout shift, from images without dimensions to late fonts and injected banners, and how to fix each one.4-minute read