What is INP (Interaction to Next Paint) in Core Web Vitals?
AdvancedPerformance interview questionBy UIRound, updated 24 November 2026
Short answer
INP, or Interaction to Next Paint, is the Core Web Vital for responsiveness. For every click, tap and key press during a visit, it measures the time until the browser paints the next frame, then reports close to the worst one. Google rates INP good at 200 milliseconds or less and poor above 500 ms at the 75th percentile. It replaced First Input Delay (FID) as a Core Web Vital on 12 March 2024.
Which interactions count
INP is one of the three metrics in Core Web Vitals: LCP, INP and CLS; this page covers it in depth. Only three kinds of interaction are observed:
- clicking with a mouse,
- tapping on a touchscreen,
- pressing a key on a physical or on-screen keyboard.
Hovering, scrolling and zooming are not counted. A page where the user only scrolls has no INP value at all, and neither does a visit from a bot that never interacts.
One interaction usually fires several events. A tap fires pointerdown, pointerup and click; a key press fires keydown, keypress and keyup. The Event Timing API gives all events of one interaction the same interactionId, and the interaction's latency is the longest event duration in that group. Each duration runs from the moment the user acted to the next frame painted after the handlers ran, and it is rounded to the nearest 8 ms for security reasons.
How the page's INP value is chosen
A visit can have hundreds of interactions, so INP has to pick one number. The rule on web.dev: take the longest interaction, but ignore one of the highest for every 50 interactions.
- A visit with 10 interactions reports the slowest one.
- A visit with 120 interactions ignores the two slowest and reports the third.
That is close to the 98th percentile of the visit's interactions. It keeps one freak slow click, such as a garbage collection pause, from defining a long session, while still reporting what a user would remember as the bad moment. If a page is restored from the back/forward cache, INP starts again from zero, because the user sees it as a new visit.
Across visits, the page's INP is the 75th percentile of those per-visit values, split by mobile and desktop. Computing the per-visit value yourself from Event Timing entries is the exercise in Compute INP from Event Timing entries.
Thresholds
| Rating | INP at the 75th percentile |
|---|---|
| Good | 200 ms or less |
| Needs improvement | over 200 ms up to 500 ms |
| Poor | over 500 ms |
Why INP replaced FID
FID measured only the first interaction, and only its input delay: the wait before the event handler started. It ignored how long the handler ran and how long the browser took to paint the result, and it ignored every later interaction. Most sites passed FID while still feeling slow. INP measures the whole latency of every interaction. Google announced the change in May 2023, and INP became a stable Core Web Vital on 12 March 2024, with FID deprecated.
The three phases and how to fix each
Every interaction splits into three phases. Find which one is large before you change code.
| Phase | From | To | Typical cause |
|---|---|---|---|
| Input delay | User acts | First event handler starts | Other work already running on the main thread |
| Processing duration | First handler starts | Last handler finishes | Your event handlers doing too much |
| Presentation delay | Handlers finish | Next frame is painted | Style, layout and paint of a large update |
Input delay
The handler cannot start while another task is running. On load that is usually script evaluation, hydration and third-party tags; later it is timers, analytics batches or a polling loop. Fixes: ship less JavaScript at startup, split hydration, load third-party scripts after the page is usable, and break up any long task so input can get in between. The mechanics of long tasks, and why async alone does not help, are covered in what a long task is. Moving pure computation off the main thread with Web Workers removes it from this phase entirely.
Processing duration
Do as little as possible inside the handler before the visual change. Update the UI first, then yield, then do the invisible work: analytics, saving to storage, syncing other components.
scheduler.yield() is the best way to yield because its continuation is queued ahead of other tasks of the same priority, so third-party scripts cannot cut in. As of late 2026 it is supported in Chrome and Edge 129 and Firefox 142, but not in Safari, so feature-detect it and fall back to setTimeout. A ready-made yieldToMain() helper is on the long task page. When you only need to wait until the frame with your update has been painted, this pattern works in every browser:
// Resolves after the next frame has been presented
function afterNextPaint() {
return new Promise((resolve) => {
requestAnimationFrame(() => setTimeout(resolve, 0));
});
}
filterInput.addEventListener("input", async (event) => {
showSpinner(); // cheap visual feedback, painted next
await afterNextPaint();
renderResults(search(event.target.value)); // heavy work no longer counts toward this interaction
});requestAnimationFrame runs just before the next paint, and the setTimeout inside it schedules a new task after that paint. The interaction ends at the first paint, so the slow work afterwards does not inflate its INP. It can still delay the next interaction, so heavy work should also be chunked. Practise chunking in Split a long task into chunks that yield to the browser, and see the time-sliced task runner for a scheduler with priorities.
Avoid layout thrashing inside handlers. Reading a layout property such as offsetHeight or getBoundingClientRect() after writing styles forces the browser to run layout synchronously, and doing it in a loop runs layout once per item:
// Slow: each read after a write forces a fresh layout
for (const row of rows) {
row.style.height = `${row.scrollHeight}px`;
}
// Fast: read everything, then write everything
const heights = rows.map((row) => row.scrollHeight);
rows.forEach((row, i) => { row.style.height = `${heights[i]}px`; });Reflow vs repaint lists the properties that force layout, and Batch DOM reads and writes to fix layout thrashing is the hands-on version.
Presentation delay
After the handlers return, the browser still has to recalculate styles, lay out and paint. This grows with the size of the DOM and the size of the change. Keep the DOM small, render long lists with virtualisation, let the browser skip off-screen sections with content-visibility: auto, and avoid replacing large chunks of HTML with innerHTML when a small update would do. requestAnimationFrame callbacks and ResizeObserver callbacks also run in this phase, so slow ones show up here.
React and INP
In React, a slow interaction usually means a state update re-renders far more of the tree than the user's change needs. Typing into a search box held in a top-level component re-renders the whole page on every key press, and all of it runs before the next paint.
Fixes, roughly in order:
- Move state down so only the component that changes re-renders, and memoise expensive children so they skip work when their props have not changed.
- Split context so a frequently changing value does not re-render every consumer.
- Mark the heavy update as non-urgent.
useTransitionlets the input update paint first while React renders the results in the background, and it abandons a stale render when a newer key press arrives.useDeferredValuedoes the same for a value you receive as a prop.
function Search({ products }) {
const [query, setQuery] = useState("");
const deferredQuery = useDeferredValue(query);
const results = useMemo(() => filterProducts(products, deferredQuery), [products, deferredQuery]);
return (
<>
<input value={query} onChange={(e) => setQuery(e.target.value)} />
<ResultList items={results} stale={query !== deferredQuery} />
</>
);
}The input re-renders immediately with the new query; the expensive list renders later with deferredQuery, and that render can be interrupted. The choice between the two hooks is explained in useDeferredValue vs useTransition and practised in Keep typing responsive with useDeferredValue. Neither hook makes rendering cheaper: a component that takes 300 ms to render still needs memoisation or virtualisation. Hydration is the other React-specific cause, because clicks during hydration wait in input delay; see hydration in React.
Measuring INP in the field
INP only exists where real people interact, so field data is the source of truth. The web-vitals library's attribution build reports the phase breakdown and the element involved:
import { onINP } from "web-vitals/attribution";
onINP(({ value, rating, attribution }) => {
const { interactionTarget, interactionType, inputDelay, processingDuration, presentationDelay, loadState, longestScript } = attribution;
navigator.sendBeacon("/rum", JSON.stringify({
name: "INP", value, rating, interactionTarget, interactionType,
inputDelay, processingDuration, presentationDelay, loadState,
script: longestScript?.entry.sourceURL, scriptPhase: longestScript?.subpart,
}));
});loadState tells you whether the interaction happened while the page was still loading, which points at startup work rather than your handler. longestScript comes from the Long Animation Frames API: it names the script that ran longest during the interaction and the phase it ran in. That turns "INP is 450 ms on mobile" into "a tag manager script runs during input delay on the product page".
Browser support as of late 2026: the Event Timing API with interactionId is available in Chrome 96, Firefox 144 and Safari 26.2, so onINP works in all three engines. The Long Animation Frames API (long-animation-frame entries) is only in Chromium, from Chrome 123, so script attribution comes from Chrome users only. CrUX, the data behind Search Console, contains Chrome users only.
In single-page apps, INP keeps accumulating across route changes in the standard measurement. Chrome 151 and later can split it per soft navigation, and web-vitals version 6 does this with { reportSoftNavs: true }, resetting INP to cover only interactions after each route change. The RUM vs synthetic monitoring page covers sampling and the p75 aggregation.
Lab proxies: TBT and DevTools
A normal Lighthouse page load cannot report INP because nobody clicks anything. It reports Total Blocking Time instead: the sum of the time beyond 50 ms in each long task after First Contentful Paint, with a target under 200 ms on average mobile hardware. TBT correlates with input delay on load, but it says nothing about a slow click handler later in the visit, and web.dev is clear that it is not a substitute for field INP.
To reproduce a field problem, open the DevTools Performance panel, turn on CPU throttling, record while you perform the interaction, and read the Interactions track, which splits each interaction into its three phases. Lighthouse's timespan mode in user flows can also measure interactions you perform during the recording. Debugging a field-only INP is the scenario in Investigate an INP of 600 ms in the field that looks fine in the lab.
Follow-up questions interviewers ask
Does a slow network request make INP worse?
Not directly. INP ends at the next paint after the handlers run, not when a fetch resolves. If the handler shows a loading state immediately, the interaction can be fast even if the data takes two seconds. Waiting for the response before giving any visual feedback is a user experience problem, but INP will not see it.
Why does INP look fine on my laptop but poor in the field?
Field users have slower CPUs, more extensions, more tabs and longer sessions with more interactions. Third-party scripts, A/B tests and consent tools may run differently for them. Use attribution data to find the target and phase, then reproduce with CPU throttling on a mid-range phone.
Is a key press inside a text field always a separate interaction?
Yes. Each key press is its own interaction, which is why heavy work on every input event is a classic INP problem. Debounce the expensive part, defer it with a transition, or move it to a worker.
What is the difference between INP and Total Blocking Time?
INP is a field metric of real interaction latency across the whole visit. TBT is a lab metric that adds up main-thread blocking during load. A page can have low TBT and poor INP if its handlers are slow, or high TBT and good INP if users never interact during load.
Why is the INP interaction often a click on something cheap?
Because the time is usually not spent in that click's handler. A long task already running, such as hydration or a third-party script, delays it in the input delay phase. Check inputDelay and loadState in the attribution before optimising the handler.
Mistakes to avoid
Treating INP as a load metric
Most of it comes from work during use.
Optimising the handler when the attribution shows input delay or presentation delay
Awaiting a resolved promise and calling it yielding; microtasks run before the browser can paint
Doing analytics and storage writes before the visual update in a click handler
Using
useTransitionand expecting it to make a slow component render fasterRelying on TBT or one Lighthouse run instead of field INP with attribution
Sources
Practise it in code
Interviewers rarely stop at the definition. These questions open in an editor with tests.
- Split a long task into chunks that yield to the browser to keep INP lowMedium30 min
- Investigate an INP of 600 ms in the field that looks fine in the labHard45 min
- Compute INP from Event Timing entries: group by
interactionId, take the 98th percentile and split the phasesMedium40 min - Batch DOM reads and writes to fix layout thrashingMedium35 min
- Keep typing responsive with
useDeferredValue, and compare it withuseTransitionMedium35 min - Build a time-sliced task runner with priority lanes, cancellation and starvation protectionHard60 min