
Interaction to Next Paint (INP) measures how quickly a page responds when someone taps, clicks or types. It records the delay from the interaction until the browser paints the next frame, and reports roughly the worst interaction of the visit. A good INP is 200 milliseconds or less. INP replaced First Input Delay (FID) as a Core Web Vital in March 2024, and it is usually harder to pass, because it is caused by heavy JavaScript on the main thread. This guide explains how INP works, how to find slow interactions, and the code-level fixes that bring it down. This guide explains how to improve INP step by step.
- Good INP is 200 ms or less; above 500 ms is poor. It is measured from real Chrome users.
- Every interaction has three parts: input delay, processing time and presentation delay. Fix the biggest one.
- Break up long JavaScript tasks (over 50 ms) and yield to the main thread so the browser can paint.
- Third-party scripts such as chat widgets, trackers and ad tags are the most common cause on business sites.
Improve INP: how INP is measured
For every click, tap and key press during a visit, the browser measures three phases: Also, this is one of the easiest ways to improve INP.
| Phase | What happens | Typical cause when slow |
|---|---|---|
| Input delay | Time before your event handler can start | Other JavaScript already running (long tasks) |
| Processing time | Your event handlers running | Heavy handlers, synchronous work, big state updates |
| Presentation delay | Style, layout and paint of the next frame | Large DOM, forced layouts, expensive CSS |
INP is the longest interaction of the visit, ignoring one outlier for every 50 interactions on very busy pages. Scrolling and hovering are not counted. Google reports the 75th percentile of all visits in PageSpeed Insights and Search Console.
| INP | Rating |
|---|---|
| 0 to 200 ms | Good |
| 200 to 500 ms | Needs improvement |
| Above 500 ms | Poor |
Improve INP: how to find slow interactions
- Search Console → Core Web Vitals shows which page groups fail INP on mobile and desktop.
- PageSpeed Insights shows field INP at the top. Lab tests cannot measure INP directly; Lighthouse shows Total Blocking Time (TBT) as a lab stand-in.
- Chrome DevTools Performance panel shows live INP for your own interactions. Record, click the slow button, and look for long yellow (scripting) tasks in the Interactions track.
- The web-vitals library reports real INP with attribution from your visitors:
import { onINP } from 'web-vitals/attribution';
onINP(({ value, attribution }) => {
console.log(value, attribution.interactionTarget,
attribution.inputDelay, attribution.processingDuration,
attribution.presentationDelay);
});
Test on a mid-range Android phone or with 4x CPU throttling in DevTools. A fast laptop hides most INP problems.
Fix 1: Break up long tasks
Any task that runs longer than 50 ms blocks the main thread. If a visitor taps during that time, the tap waits. Split big jobs into chunks and give control back to the browser between them: So keep this in mind whenever you improve INP.
function yieldToMain() {
if (globalThis.scheduler?.yield) return scheduler.yield();
return new Promise(r => setTimeout(r, 0));
}
async function processItems(items) {
for (const item of items) {
doWork(item);
await yieldToMain(); // let the browser handle input and paint
}
}
scheduler.yield() is supported in Chromium browsers and keeps your task at the front of the queue; the setTimeout fallback works everywhere.
Fix 2: Do less inside event handlers
Show visual feedback first, then do the expensive work after the next paint:
button.addEventListener('click', () => {
button.classList.add('is-loading'); // cheap, visible change
requestAnimationFrame(() => {
setTimeout(() => runExpensiveFilter(), 0); // after the paint
});
});
- Debounce search boxes and filters so they do not re-render on every key press.
- Send analytics events with
navigator.sendBeacon()or after yielding, not before the UI update. - In React, use
startTransitionfor non-urgent updates so typing stays responsive.
Fix 3: Tame third-party scripts
Chat widgets, heatmaps, multiple analytics tags, social embeds and ad scripts all compete for the main thread. Audit them in DevTools (Performance → Bottom-Up, grouped by domain) and:
- Remove tags nobody uses. Each Google Tag Manager tag still costs CPU.
- Load chat widgets only after the first interaction or after a few seconds.
- Replace heavy embeds, such as YouTube players, with a lightweight preview that loads the real player on click.
Fix 4: Reduce rendering cost
- Keep the DOM small. Lighthouse warns above about 1,400 elements. Page builders often create deeply nested markup; a mega menu or long product grid can add thousands of nodes.
- Avoid layout thrashing: do not read layout properties such as
offsetHeightright after changing styles in a loop. Batch reads, then writes. - Use
content-visibility: autoon long off-screen sections so the browser skips rendering them until needed. - Animate with
transformandopacityonly.
.long-section { content-visibility: auto; contain-intrinsic-size: auto 800px; }
Improve INP: INP fixes for WordPress
- Remove plugins that add front-end JavaScript you do not need, such as sliders on pages without sliders.
- Use a performance plugin's "delay JavaScript until interaction" feature for trackers and chat, but test menus and forms afterwards.
- Avoid heavy page builders on key templates, or use their optimised DOM output settings.
- WooCommerce: disable cart fragments on pages that do not show the mini cart.
Improve INP: frequently asked questions
What replaced First Input Delay?
INP replaced FID as a Core Web Vital on 12 March 2024. FID only measured the delay of the first interaction; INP measures the whole visit.
Why does Lighthouse not show INP?
Lighthouse loads the page without real interactions. Use Total Blocking Time as a lab indicator and field data for the real INP.
Is INP worse on mobile?
Usually yes. Mid-range phones have much slower processors, so the same JavaScript takes several times longer.
Related guides: Why Website Speed Matters and How to Make Your Site Faster, How to Get Your Website on Google and 301 vs 302 Redirects.
For official guidance, see web.dev by Google.
Need your INP fixed?
Our speed optimization team profiles real interactions and fixes the scripts behind slow INP. Also read our guides on fixing CLS and improving LCP, or contact us.
Written by the ItsWebExpert team, a web design and development company in Karachi building websites, online stores and apps for businesses across Pakistan.
Ask a Question on WhatsApp