How Event Timing turns one tap into entries, entries into interactions and interactions into a single INP value, and where the spec, Chrome and web-vitals disagree.
Contents · 11 sections
Picture a product page with a filter button. Its click handler is small: wrap it in performance.now() calls and it takes, say, 30 ms. The RUM dashboard says the page's INP at p75 is 232 ms, and whoever is asked to fix it can't find a single handler anywhere near that slow. Neither number is wrong. They measure different things, and the gap between them is made of definitions most of us have never read.
The usual explanation is "INP is the time from a click to the next paint". That's the headline, and it leaves out almost everything that decides the number: which events count, how several events become one interaction, where the clock stops, how the duration is rounded, which entries the browser will even show you, and how dozens of interactions on one page view collapse into one value. Each of those steps is written down somewhere: some in the Event Timing spec, some in Chrome's changelogs, some on a web.dev page, some only in the source of the web-vitals library.
This piece follows a single tap from hardware input to the value your analytics stores, one algorithm at a time, quoting the spec where wording matters and marking where Chrome, the spec and web-vitals disagree. It builds on the first part of this series (PRF-01), which covers what "passes Core Web Vitals" means at p75; here the question is what a single page view's INP value is before any percentile touches it. Every status fact was checked on 18 October 2026.
One tap dispatches several events, and only some of them count
Start with what the user does and what the browser dispatches, because they aren't the same thing. The Event Timing spec's section on interactions describes a single tap on a touchscreen as three physical inputs (a touch start, a little movement, a touch end) that can dispatch pointerdown, touchstart, pointermove, touchmove, pointerup, touchend and click, with focus and input events possibly in between. Each of those UI events is a candidate for its own PerformanceEventTiming entry. The spec then defines interactionId as the mechanism for grouping related entries into one interaction, and says that grouping is what lets you define INP.
Not every event is a candidate. The algorithm that decides whether an event is considered for Event Timing starts by rejecting any event whose isTrusted is false, so element.click() and dispatchEvent() in your own code never produce entries. It then accepts a fixed list: the mouse events (click, dblclick, auxclick, contextmenu, mousedown, mouseup and the enter, leave, over and out family), the pointer events except pointermove and pointerrawupdate, touchstart, touchend and touchcancel, keydown, keypress and keyup, beforeinput and input, the three composition events, and the drag events except drag itself. The note under the list says mousemove, pointermove, pointerrawupdate, touchmove, wheel and drag are excluded because they are "continuous" events, and the API doesn't yet have enough guidance on how to count and aggregate them.
That exclusion is the first reason INP can't see scroll jank. The second is on the program's side. The web.dev INP article, last updated 2 September 2025, says only three interaction types are observed for INP: clicking with a mouse, tapping on a touchscreen and pressing a key on a physical or onscreen keyboard. Hovering, zooming and scrolling are not observed, though the article notes some variations of them include clicks, taps or key presses that INP does measure.
There's one more property that surprises people. The spec's section on when events are measured says the API creates entries for events regardless of whether they have listeners. A click on blank space to move focus, or a tap that selects text, produces entries the same way a click on a button does. The spec calls this a deliberate choice: it catches pages that register listeners too late, and it covers inputs that matter without listeners, such as hover effects. It suggests that developers who want to ignore such entries can filter on a near-zero processingEnd - processingStart. Neither web.dev's definition of INP nor the web-vitals implementation filters them. If a tap on nothing in particular is slow because the main thread is busy, it counts.
So the raw material is a stream of per-event entries for a fixed set of discrete event types, trusted only, with or without listeners. The next step is deciding which of those entries belong together.
An interactionId is assigned late, and it is not a counter
The grouping algorithm is compute interactionId, and it's stranger than the attribute's one-line description suggests. The first thing it does after the isTrusted check is return 0 for every event type except seven: keyup, compositionstart, input, pointercancel, pointerup, click and contextmenu. Notice what's missing. pointerdown and keydown, the events that start an interaction, don't compute an id when they're dispatched. The spec's note says they are marked pending and get their id later, when the event that ends the interaction arrives.
The reason is that a pointerdown doesn't yet know what it is. It might become a tap, or a drag, or the start of a scroll. Only the matching pointerup or pointercancel settles it.
Pointers: a pending map and a pointer map
The pointer half runs on two per-Window maps defined in the spec's modifications to HTML: pending pointer downs, keyed by pointerId, holding the pointerdown entry that's waiting, and the pointer interaction value map, holding the id that's been assigned to a pointer. Here's how a tap moves through them.
When pointerdown finishes dispatching, finalize event timing stores its entry in pending pointer downs. If an older pointerdown for the same pointer is still pending, that older entry is released to the queue with id 0. When pointerup arrives, compute interactionId finds the pending entry, increases the interaction count, writes the new value into the pointer map, stamps the same value onto the pending pointerdown entry, queues that entry and removes it from the pending map. The pointerup gets the same id. When click arrives, it looks up its pointerId in the pointer map, takes the value, removes the mapping and returns it. Three events, one id.
A pointercancel takes a different path. It's what the browser fires when a touch that started as a press turns into a scroll or a pan. The algorithm still queues the pending pointerdown entry and removes it from the map, but skips the step that assigns a new id, so the pointerdown goes out with 0, and the pointercancel returns 0 too. A drag that becomes a scroll is, by construction, not an interaction. The spec's PerformanceEventTiming attribute summary says the same thing in prose: a pointerdown that ends in a scroll is excluded.
The contextmenu event adds a flag. A long press on a touchscreen can fire contextmenu before any pointerup, so the algorithm treats contextmenu like pointerup when a pointerdown is pending: it assigns the id and sets is contextmenu triggered. The later pointerup, which no longer has a pending pointerdown, sees the flag, clears it and reuses the current value instead of returning 0. A contextmenu with no pending pointerdown at all returns the current value directly.
Fig. 1 plays the two pointer paths side by side: a tap that ends in pointerup and click, and a press that turns into a scroll.
Keys: pending key downs, repeats and the 229 exception
The keyboard path uses pending key downs, keyed by keyCode. A keydown is stored there at finalize time. The matching keyup looks up its keyCode, increases the interaction count, stamps the new id on the stored keydown entry, queues it, removes it and returns the same id for itself. A keyup with no matching pending keydown gets 0.
Holding a key down produces repeated keydown events with the same keyCode, and finalize event timing handles that case explicitly. If a keydown arrives while an earlier one for the same code is still pending, the earlier entry gets a fresh value and goes to the queue, and the new one takes its place. One detail I noticed reading the steps today: that branch increases the user interaction value directly, not through the increase interaction count algorithm, so as written, auto-repeated keydowns get their own ids without being added to interactionCount. I don't know whether that's intended or whether any engine behaves that way; it's in the list at the end.
keyCode 229 is exempt from the repeat rule. The spec's note says 229 corresponds to IME keyboard events, which the user agent sometimes sends several of without the user holding a key down, so a repeated 229 releases the earlier entry with id 0 instead of minting a new interaction.
IME composition gets its id from input
Text composition, with a CJK input method or many onscreen keyboards, follows a third path. A keydown with isComposing set is queued immediately with id 0. A keyup with isComposing set returns 0. A compositionstart flushes every pending keydown to the queue with whatever id it had (0) and clears the map. The id comes from input: an input event that is a real InputEvent with isComposing true increases the interaction count and returns the new value. An input outside composition returns 0, because in that case the surrounding keydown and keyup carry the id.
So in the spec's model, a composed character is one interaction identified by its input event, and a plain keystroke is one interaction identified by its keydown and keyup pair.
The id is a label, and the count is a separate attribute
The value an interaction gets is not 1, 2, 3. Each Window's user interaction value starts at a random integer between 100 and 10000, and the increase interaction count algorithm raises it "by a small number chosen by the user agent", which may be a small random integer or a constant. The note gives two reasons: developers shouldn't treat the id as a count of interactions, and the user agent should be free to assign a value early (at pointerdown) and throw it away (after pointercancel). The same note says the value must be per-Window, because a shared global counter could leak information across origins.
The count lives in performance.interactionCount, which the spec increments once per distinct interaction in that same algorithm. It took a while to arrive. Chrome's INP changelog lists the launch of interactionCount to stable in Chrome 144, and MDN's compat data for Performance records it in Chrome 144, Firefox 144 and Safari 26.2.1 I couldn't find a separate webstatus.dev feature for it, so I can't give you a Baseline label for this one attribute.
Until engines had that attribute, you had to estimate the count, and web-vitals still ships the estimate. Its interactionCount polyfill observes event entries with durationThreshold: 0, tracks the smallest and largest interactionId it has seen, and computes (max - min) / 7 + 1. That only works if the browser increments by exactly 7, so the library is relying on an implementation detail the spec explicitly declines to promise. In version 6.2.3 it only runs when interactionCount is missing from performance.
Here's the grouping in code. It keeps, for each interaction, the entry with the longest duration, which is the one INP will use.
// interactionId -> the longest PerformanceEventTiming in that interaction
export const interactions = new Map();
export function record(entry) {
// 0 means the event isn't part of an interaction: a hover, a press
// that became a scroll, or a nested click.
if (!entry.interactionId) return;
const longest = interactions.get(entry.interactionId);
if (!longest || entry.duration > longest.duration) {
interactions.set(entry.interactionId, entry);
}
}
export const observer = new PerformanceObserver((list) => {
list.getEntries().forEach(record);
});
// 16 is the lowest threshold the spec allows; first-input is always
// reported, however fast it was.
observer.observe({ type: 'event', durationThreshold: 16, buffered: true });
observer.observe({ type: 'first-input', buffered: true });The first-input entry is a copy of an event entry with the same interactionId, so it merges into the same group rather than adding an interaction. That copy matters later, when we look at what happens to interactions faster than the threshold.
Chrome's keyboard and click handling has moved ahead of the spec text
Everything above is the spec's algorithm. Chrome's behavior differs from it in several documented places, and the differences cluster around keyboards and synthetic clicks.
The Chrome 127 changelog lists three keyboard changes that shipped by default: keypress entries now get an interactionId; during composition, keydown and keyup also get one (previously only input did); and keydown ids are generated up front instead of waiting for keyup. All three depart from the spec text above, where keypress isn't in the list of types that compute an id, composing keydowns get 0, and keydown waits in pending key downs. The spec's open issues track exactly these gaps. Issue #149, opened in March 2025, points out that a web platform test checks keypress ids while the spec never assigns them. Issue #153, from the spec's editor, proposes making keyboard id assignment eager because a keydown will always end up with an id anyway.
Keyboard-triggered clicks are another gap. Pressing space or enter on a button fires a click, and in the spec's algorithm that click looks for its pointerId in the pointer map, finds nothing and returns 0. The Chrome 130 changelog says Chrome now gives such a click the same id as the key events around it. Issue #147 records that this isn't specified: the engineer who opened it was prototyping interactionId in Firefox, found a web platform test expecting the shared id, and had to handle simulated clicks in a separate patch after implementing the spec as written.
The same Chrome 130 page lists two more launches. Taps and clicks that stop a fling scroll no longer get an id, on the grounds that the first visual feedback is the scroll stopping, which the compositor draws without waiting for the main thread. The changelog says this mainly affected Android, where some page loads whose only interaction was a fling stop stopped reporting INP at all. Chrome 130 also began reporting interactions that are still being measured when the page becomes hidden, so a final click that navigates away before the next paint can still be counted. Chrome 133 removed ids from text selection drags once the selection auto-scrolls the page, treating them as scrolling rather than as interactions.
The biggest restructuring came in Chrome 147. Before it, Chrome assigned interaction ids asynchronously, after the next paint's presentation time was known. From 147, ids are assigned synchronously at processingStart, as soon as dispatch begins, which the page says ensures all events in an interaction share an id in chronological order. It describes the change as mostly an internal simplification that may have fixed some rare edge cases, and says the work was needed to support interaction-contentful-paint. The same release added an explicit fallback for interactions that open a context menu, so the native menu taking focus no longer inflates the duration of the preceding events.
The spec is being rewritten to catch up. Issue #164, opened by the editor in February 2026, says that per spec pointerdown and keydown have delayed dispatch and asynchronous id assignment, that the current wording "does not work well in practice", and sets the goal of moving all id assignment into a single step at processingStart. The pull request making progress on it, #165, has been open since March 2026 and was last updated in May. So as of today, the published Working Draft and the browser most of your field data comes from describe keyboard interactions differently. I diffed the 13 October 2026 Working Draft against the Editor's Draft of the same date and their algorithm text is identical, so neither one contains the refactor yet.
Three more Chrome changes affect what you see in an entry rather than how ids are grouped:
- Chrome 135 changed
interactionIdtounsigned long longto match the spec's IDL, per the changelog index. - Chrome 148 reads
entry.targetat the end of dispatch, so internal targets such as user-agent shadow roots no longer leak, andtargetisnullmore often: when the element was removed during the handler or sits behind a closed shadow root. The page also describes an experimentaltargetSelectorattribute that it says is not yet enabled by default in stable. The current spec already hastargetSelectorin its IDL and a selector algorithm that produces the node name plus#idor[src=…]; MDN's compat data has no entry for it yet. - Chrome 150, per the changelog index, gives nested clicks such as a
<label>click forwarded to its form controlinteractionId = 0, "to align with web standards".
That last one matters for a common pattern. The HTML Standard's label element section says that on platforms where clicking a label activates its control, the user agent could fire a click at the input as if the user had triggered it. That forwarded click targets the input and bubbles back up through the label. From Chrome 150, only the label's own click carries the interaction's id. If your RUM counts clicks per interaction, or attributes an interaction to "the click entry", the forwarded click stops being a candidate.
Duration ends at the next rendering update, in 8 ms steps
With the grouping settled, the next question is what one entry's duration actually measures. The attribute summary says it's the difference between the next time the update-the-rendering steps complete for the event's Document after the event has been dispatched, and the event's startTime, rounded to the nearest 8 ms. And startTime is the event's timeStamp, which the spec's section on when events are measured treats as the estimate of when the physical input happened.
So the clock starts at the hardware timestamp, not at your handler, and it doesn't stop when your handler returns. It stops at the next rendering update. The normative step that sets it is in dispatch pending Event Timing entries, which Event Timing inserts into the HTML Standard's update the rendering steps right after "mark paint timing". The HTML Standard's own list of steps doesn't mention Event Timing yet; the Event Timing spec patches it from outside and says that section will be removed once HTML has been modified. At that point the algorithm takes the current high-resolution time as the rendering timestamp, sets each queued entry's duration to the rendering timestamp minus its start time, and queues it to observers only if the duration is at least 16 ms.
Two subtleties live in that step. First, it sets the duration of still-pending pointerdown and keydown entries too, without queuing them. A pointerdown that's followed by a frame before the finger lifts gets its duration fixed to that first frame, and is only released later, when pointerup gives it an id. That's the case the web.dev article's second diagram shows: a frame is presented between the press and the release, and the release then runs its own handlers before the next frame. Second, the duration is set only once ("If timingEntry's duration attribute value is nonzero, return"), so an entry always measures to the first rendering update after it, never a later one.
The spec's rendering timestamp is a point inside update the rendering, which is not the same as photons on glass. Chrome's changelogs describe measuring to when the frame is presented, and show that this end point moves with the platform. The Chrome 126 change on Mac switched to timestamps for when the frame's content is actually displayed, rather than when it was handed to Core Animation, and the page says that increased INP, LCP and FCP by about 20 ms on average. The Chrome 127 page added an alternative end point for synchronous modal dialogs like alert() and confirm(), because the time a user spends reading the dialog had been counted as processing time; it says pages using modal dialogs may see INP decrease. The web.dev article covers the last case: in rare cases there may be no frame to paint, and the interaction then ends when the browser would have been able to paint one.
Rounding to 8 ms has consequences at the thresholds
The rounding is described in two places with slightly different words. The attribute summary, which is non-normative, says "rounded to the nearest 8ms". The normative step says the duration has "granularity of 8ms or less", which as written would also permit finer values. The security and privacy section explains the choice: 8 ms is coarse enough not to create a new high-resolution timer for the time pixels are drawn, and fine enough to be useful on 120 Hz displays. The same section explains the 104 ms default as "the first multiple of 8 greater than 100ms", so that a rounded duration of at least 104 ms implies a pre-rounded duration of at least 100 ms.
Do the same arithmetic on the thresholds you care about. 200 ms, the "good" boundary for INP on web.dev, is 25 × 8. With round-to-nearest, a reported 200 covers raw durations from 196 ms up to anything below 204 ms, and the next reportable value is 208. (The spec doesn't say which way an exact tie such as 196 or 204 goes; I've assumed halves round up.) An interaction whose raw duration was 203 ms reports as good; one at 205 ms reports as 208 and needs improvement. The 16 ms floor works the same way: rounded durations of 16 or more correspond to raw durations of about 12 ms and up.
WebKit has questioned the precision itself. In the WebKit standards position on Event Timing, which is still open with "duplication" and "interoperability" concern labels, a WebKit engineer wrote in November 2024 that the 8 ms limit should probably depend on a 120 Hz requestAnimationFrame rate, with 16 ms precision in contexts that render at 60 Hz. In February 2025 he added that aligning duration with a planned rAF-aligned paint time would resolve his concern about exposing extra painting information. Safari shipped the Event Timing API in 26.2, and I haven't found a statement of which granularity it uses.
Input delay, processing and presentation split one duration three ways
The three phases are differences between four timestamps on the entry. The spec's section on when events are measured defines the delay as processingStart - startTime: the time from the input to the moment the browser is about to run handlers. processingStart and processingEnd are captured at the start and end of the DOM's event dispatch algorithm; with no handlers, they're equal. Whatever is left of duration after processingEnd is presentation delay: style, layout, paint, compositing and waiting for the frame.
Fig. 2 lays one interaction out on that timeline, with the duration snapping to the 8 ms grid at the end.
The spec's own usage example computes the three phases per entry and labels presentation delay "approximate", clamping it at zero. The spec doesn't say why, but the arithmetic explains it: duration is rounded while processingEnd is not, so rounding down by up to 4 ms can put the computed end before processingEnd when the frame follows the handlers closely.
// Phases of one PerformanceEventTiming entry. Presentation delay is
// approximate: duration is rounded to 8 ms, the other timestamps aren't.
function phases(entry) {
const end = entry.startTime + entry.duration;
return {
inputDelay: entry.processingStart - entry.startTime,
processing: entry.processingEnd - entry.processingStart,
presentationDelay: Math.max(0, end - entry.processingEnd),
};
}Per entry is not quite per interaction. The web.dev article says an interaction's latency is the single longest event duration in its group, and that the processing duration of INP includes all event handler callbacks within that frame. When a tap's pointerup and click are both dispatched before the same rendering update, their durations end at the same timestamp. The click is dispatched after the pointerup handlers finish, so its processingStart is later, and whether its own "input delay" swallows the pointerup handlers depends on what the browser puts in the click's timeStamp, which the Event Timing spec doesn't pin down. If you want the interaction-level split that web.dev describes, take the earliest processingStart and the latest processingEnd among the entries in the group that share the longest entry's frame, not the phases of whichever entry happened to be longest. PRF-19 in the "Fixing INP" series covers attribution in the field, including joining Event Timing with Long Animation Frames to find the script responsible.
This is where the opening's hypothetical 30 ms handler and 232 ms INP stop being a contradiction. The handler is one slice of processing. Input delay is whatever was running when the tap arrived. Presentation delay is the rendering work the handler caused, plus waiting for the frame. PRF-20 is about that last part, which no event handler owns.
The API shows you 104 ms and up by default, 16 ms at best
The browser computes a duration for every exposed event, but it doesn't show you every one. Which entries reach your code is decided by the should add PerformanceEventTiming algorithm, and it's short:
- A
first-inputentry is always added. - Otherwise the minimum duration is 104 ms if the observer gave no
durationThreshold, and the larger of 16 and the given threshold if it did. - The entry is added if its duration is at least that minimum.
Before that algorithm runs, dispatch pending Event Timing entries has already dropped anything under 16 ms. So a durationThreshold: 0 and a durationThreshold: 16 behave identically, and there is no way to observe an event entry shorter than 16 ms. The web.dev section on differences between the metric and the API says the same and recommends observing first-input too, because it's the one entry guaranteed to be observable when it's faster than the threshold. The article's phrase is that this "helps ensure" a page with interactions reports some INP value.
The buffered flag has a gap that catches analytics scripts loaded late. The same section of the spec says lowering the threshold doesn't change which entries were buffered before the observer existed: buffered: true only returns past entries at or above the 104 ms default. Issue #124, open since October 2022, describes the surprise: register with durationThreshold: 40 and you get buffered entries of 104 ms and up, but nothing between 40 and 104 from before you registered. The Timing Entry Names Registry sets the buffer sizes: 150 entries for event, 1 for first-input. It also marks event as not available from the performance timeline, so performance.getEntriesByType('event') won't give you anything; you need an observer.
The web-vitals README for onINP() states the consequence for the library most people use. Its default threshold after initialization is 40 ms, and the 104 ms Event Timing default applies to everything emitted before the library initializes. The source of onINP explains the 40 as a balance: below that, an interaction spans only one or two frames at 60 Hz and isn't worth the callback.
None of this changes INP for most pages, because INP is about the slow end, and slow interactions clear every threshold. It does change three things you might compute from the same data:
- Interaction counts. Counting entries with non-zero ids undercounts by every interaction under the threshold. That's why
performance.interactionCountexists, and why the rule in the next section needs it. - Early interactions. An interaction at 60 ms that happens before your script loads is invisible to you, while one at 110 ms is in the buffer. Your "interactions during load" distribution is truncated at 104 ms.
- Low INP values. On a fast page the reported value can come from the
first-inputentry or be absent below your threshold. TheonINPdocumentation says that with the 40 ms default, the library falls back to the first interaction's input delay rather than report nothing, which won't affect your p75 unless your p75 is itself under 40 ms.
"Ignore one per 50" is a 98th percentile, until web-vitals caps it
Now the step that turns many interactions into one number. The web.dev article states it twice, in two different vocabularies, and on a first read they look like two different rules. The definition section says the worst interaction is reported, except that for pages with many interactions "we ignore one highest interaction for every 50 interactions". The JavaScript section says to measure all interactions and "take the 98th percentile across all these interactions", and the section on differences adds that you can approximate a high percentile by keeping the worst N interactions, with 10 a common choice.
They agree exactly, as long as "98th percentile" means the nearest-rank percentile. With N interactions sorted from worst to best, ignoring one per 50 means reporting the value at zero-based position ⌊N/50⌋. The nearest-rank 98th percentile is the value at 1-based rank ⌈0.98N⌉ in ascending order, which is position N − ⌈0.98N⌉ from the worst end. For whole numbers, N − ⌈0.98N⌉ equals ⌊0.02N⌋, which is ⌊N/50⌋. Same position, same value, for every N.
I checked that numerically rather than trust the algebra. These two functions implement each rule:
// One latency per interaction: the longest event duration in its group.
// Pass performance.interactionCount as the count, because it also includes
// interactions too fast to produce an entry.
export function inpFromLatencies(
latencies: number[],
interactionCount = latencies.length,
): number | undefined {
if (latencies.length === 0) return undefined;
const worstFirst = [...latencies].sort((a, b) => b - a);
// Ignore one highest interaction for every 50 interactions.
const skip = Math.floor(interactionCount / 50);
return worstFirst[Math.min(skip, worstFirst.length - 1)];
}
// The textbook nearest-rank percentile: the smallest value that at
// least p percent of the values are less than or equal to.
export function nearestRank(values: number[], p: number): number {
const ascending = [...values].sort((a, b) => a - b);
const rank = Math.ceil((p / 100) * ascending.length); // 1-based
return ascending[Math.max(rank, 1) - 1];
}And this compares them for every page size from 1 to 1,000 interactions:
import { inpFromLatencies, nearestRank } from './inp-from-latencies.ts';
let mismatches = 0;
for (let n = 1; n <= 1000; n++) {
// Distinct latencies so ties can't hide a mismatch.
const latencies = Array.from({ length: n }, (_, i) => (i + 1) * 8);
if (inpFromLatencies(latencies) !== nearestRank(latencies, 98)) {
mismatches++;
}
}
console.log({ mismatches }); // { mismatches: 0 }On Node 24.18 with its built-in TypeScript type stripping (node check.ts), it prints zero mismatches. Floating-point 0.98 * n could in principle push Math.ceil one rank too far, and it doesn't in that range.
The rules diverge only if your "p98" is an interpolating percentile, which is what many percentile functions compute unless you ask for a discrete one. Check the documentation of whatever your pipeline uses. Take a hypothetical page view with 120 interactions, where the four slowest took 600, 248, 232 and 224 ms and the other 116 took 200 ms. Ignoring one per 50 skips two and reports 232 ms; nearest-rank p98 gives the same. A linear-interpolation p98 sits at position 0.98 × 119 = 116.62 in ascending order, between 224 and 232, and gives 228.96 ms, a value that isn't even on the 8 ms grid. Fig. 3 shows the rank-based rule as the count grows: the reported interaction steps down one place at 50 and again at 100.
web-vitals keeps ten candidates, and that is a cap
The reference implementation is the web-vitals library, which the web.dev article points to for how INP is calculated. Its InteractionManager keeps at most 10 of the longest interactions, each with the longest duration among its entries, and estimates INP as the candidate at index Math.min(list.length - 1, Math.floor(interactionCount / 50)), where the count comes from performance.interactionCount (or the polyfill) minus the count at the start of the current navigation. That's the one-per-50 rule exactly, with two edges.
The first edge is the cap. Ten candidates cover positions 0 through 9, so the rule is exact up to 499 interactions. At 500, the rule wants position 10, the eleventh-worst interaction, and the library returns the tenth-worst. At 1,000 interactions the rule wants the 21st-worst and the library still returns the tenth-worst. From 500 interactions on, web-vitals reports a value at or above what the stated rule gives. web.dev says most page views never reach 50 interactions, so 500 is far out in the tail; the page views that get there are long sessions in something like a spreadsheet or a chat client, where every keystroke is an interaction.
The second edge comes from the threshold. The count includes interactions too fast to produce an entry, but the candidate list doesn't. Suppose 120 interactions happened and only two were 40 ms or slower. The rule wants position 2, the third-worst, which was under 40 ms and was never observed; Math.min clamps to position 1 and reports the second-worst. The error is bounded: the true value is under 40 ms, and the library reports the fastest interaction it did see, which is the closest value it has. Still, it's a real difference from the definition on pages that are mostly fast.
For most page views neither edge applies. The web.dev definition section says the vast majority of page experiences don't have more than 50 interactions, so INP is usually the single worst interaction. That's the point to hold onto: for typical pages, INP is not an average or a median of anything. It's the worst thing that happened.
The page's value keeps changing until the page is gone
A page view's INP isn't final until the page view ends, and pages don't end cleanly. The web.dev differences section lists the cases. Tabs stay open for days. Mobile browsers usually don't run unload callbacks for background tabs. So INP should be reported every time the page is backgrounded, which the visibilitychange event covers along with unloads, and the analytics back end has to compute the final value from the reports it receives. A page restored from the back/forward cache should have its INP reset, because users experience it as a new visit.
web-vitals does exactly that. In onINP, a hidden page triggers takeRecords() on the observer, so entries the observer hasn't delivered yet are processed, and then a forced report; a back/forward cache restore starts a new metric and resets the interaction baseline. The Chrome 130 change that flushes in-progress interactions at visibility change is the browser side of the same problem: the page says a final click that navigates away before the next paint can now be reported, and that takeRecords() lets you read it synchronously.
Here's a minimal version of that reporting logic, using the grouping and the rule from earlier. It sends the current value every time the page is hidden; the back end keeps the last value it received for each page view.
// inp-from-latencies.js is the TypeScript module above, compiled.
import { inpFromLatencies } from './inp-from-latencies.js';
import { interactions, observer, record } from './group-interactions.js';
let pageViewId = crypto.randomUUID();
let countAtStart = performance.interactionCount ?? 0;
addEventListener('pageshow', (event) => {
// A back/forward cache restore is a new visit: start over.
if (!event.persisted) return;
interactions.clear();
pageViewId = crypto.randomUUID();
countAtStart = performance.interactionCount ?? 0;
});
document.addEventListener('visibilitychange', () => {
if (document.visibilityState !== 'hidden') return;
observer.takeRecords().forEach(record);
const latencies = [...interactions.values()].map((e) => e.duration);
const count = (performance.interactionCount ?? latencies.length)
- countAtStart;
const inp = inpFromLatencies(latencies, Math.max(count, latencies.length));
if (inp === undefined) return;
navigator.sendBeacon('/rum', JSON.stringify({ pageViewId, inp }));
});The Math.max covers browsers without interactionCount, where the only count available is the interactions you saw. It's a deliberately small sketch. It has the same blind spot as the library for frames: the web-vitals README says these APIs have no visibility into iframe content, not even same-origin iframes, while CrUX includes it, and that measuring same-origin frames means loading the library in each and posting results to the parent. The web.dev article makes the same point from the metric's side: interactions in iframes are part of the page's INP, because users can't tell what's in a frame, and that's a source of difference between CrUX and RUM. If your checkout or video player is an embed, your RUM INP and your CrUX INP are measuring different sets of interactions.
Soft navigations add a newer twist. The README's soft-navigation section, as of web-vitals 6.2.3 (published 5 October 2026), says that with reportSoftNavs: true, INP is reset to measure only interactions after each soft navigation, and that the first URL's INP is locked in when the first soft navigation happens. It also says only Chromium browsers from version 151 support this, so the same option produces different reporting boundaries in different browsers. CrUX has started publishing experimental soft-navigation variants of the Core Web Vitals in its September 2026 release, where 87.4% of origins had good INP with soft navigations included, against 85.4% without. PRF-06 covers what that changes; for this piece the point is narrower. "One page view" is itself a definition, and it's moving.
One lab page can test the grouping rules in every engine
I haven't run this comparison across browsers, so I can't give you a results table. What I can give you is the method, and what the spec and the changelogs say each scenario should produce, so that a run in your own browsers tests something specific.
The harness is the code above with one addition: log every entry, not only the longest per interaction, with its name, interactionId, startTime, the three phases and duration, and next to it performance.interactionCount and the value from web-vitals onINP with reportAllChanges: true. Observe at durationThreshold: 16 so you see as much as the API allows. To get entries above the threshold reliably, make the handlers slow on purpose:
<label id="terms">
<input type="checkbox" name="terms"> I agree to the terms
</label>
<input id="search" type="search" aria-label="Search">
<!-- Room to scroll, for the drag scenario. -->
<div style="height: 200vh"></div>
<script type="module">
// Busy-wait so every interaction clears the 16 ms floor. Lab use only.
function block(ms) {
const end = performance.now() + ms;
while (performance.now() < end) {}
}
document.querySelector('#terms').addEventListener('click', () => block(80));
document.querySelector('#search').addEventListener('keydown', () => block(40));
</script>Then run these scenarios, each in a fresh tab:
- A label wrapping a checkbox. Click the label text once. Expect entries for the label's click and for the click forwarded to the checkbox, and, per the Chrome 150 changelog, only one of them with a non-zero
interactionIdin Chrome 150 or later. Note how many times the 80 ms handler appears in processing time; the forwarded click bubbles through the label. - Typing with an IME. Type a few characters in the search field with a composition input method (Japanese or Chinese, or an Android keyboard with suggestions). Per the spec, the
inputevents carry the ids and the composingkeydowns get 0; per the Chrome 127 changelog, Chrome also assigns ids to composingkeydownandkeyup. CompareinteractionCountwith the number of distinct ids you logged. - A drag that becomes a scroll. On a touchscreen, press on the label and drag far enough to scroll the page. Per the spec, the
pointerdownleaves with id 0 and apointercancelfollows. Nothing should count as an interaction. - 120 clicks with one outlier. Click the label 120 times, and on one click make the handler block for 600 ms. Per the rule, INP should be the third-worst interaction, not the 600 ms one. Then repeat with 520 clicks and see whether
web-vitalsreports the tenth-worst where the rule wants the eleventh.
Record the browser version, the device, and whether DevTools CPU throttling was on, for every run. The point of the exercise isn't the millisecond values, which depend entirely on your machine, but whether each engine's grouping and counting match the spec. Firefox added interactionId in Firefox 144, and the compat data for PerformanceEventTiming records interactionId in Chrome 96, Firefox 144 and Safari 26.2, so cross-engine grouping is recent everywhere outside Chrome. webstatus.dev lists Event Timing as a whole as Baseline newly available since 12 December 2025, with a positive position from Mozilla and WebKit's position still listing concerns. MDN's interactionId page is a reasonable developer-facing summary; it says the value is 0 for event types where no id is calculated. Don't paste its example as is, though: it calls eventLatencies.has() on a plain object, which throws a TypeError on the first entry with an id. The spec's own usage example does the same job correctly.
What I'd do with this tomorrow
Group by interactionId, take the longest entry, and never average. An interaction's latency is the longest event duration in its group. INP is a rank statistic over interactions, and for most page views it's the single worst one. Any dashboard tile that shows "average interaction latency" is a different metric, and usually a much more flattering one.
Use performance.interactionCount for the count, and apply the rule by rank. Counting entries undercounts by every interaction under your threshold. If your pipeline computes INP server-side from raw latencies, implement ignore-one-per-50 (or nearest-rank p98, which is the same thing) and not your database's default percentile function, which probably interpolates.
Observe first-input alongside event, and register early. The first-input entry is the only one exposed below 16 ms, and the buffer only holds 104 ms and up from before your observer existed. If your RUM script loads late, its picture of the first seconds is truncated by construction.
Report on every hide, reset on every back/forward cache restore, and let the back end keep the last value. That's what web.dev specifies and what web-vitals does. If you build your own, the reporting code above is the minimum.
Read the phases at interaction level before blaming a handler. A 30 ms handler inside a 232 ms interaction means the other 200 ms is input delay or presentation delay. The fix is in different places: other tasks on the main thread in the first case, rendering work in the second.
Treat Chrome's changelog as part of the definition. Between Chrome 127 and Chrome 150, keyboard grouping, fling stops, selection drags, context menus, nested clicks and the target attribute all changed. The spec's own editor wrote that the current id assignment wording "does not work well in practice" and has a refactor open. If your INP shifts and nothing shipped, check the Chrome version distribution in your RUM against the changelog before you start bisecting.
If you rely on web-vitals for pages with hundreds of interactions, know about the cap. From 500 interactions per page view, its value is the tenth-worst interaction, not the one the rule picks. For a heavy single-page app without soft-navigation reporting, that's a systematic pessimistic bias at the top end, and it's worth either accepting knowingly or computing the rule yourself.
What we don't know
Whether CrUX applies exactly this rule. The web.dev article states the rule and points to web-vitals as the reference implementation, and Chrome's Chrome 147 changelog says aggregation for PageLoad UKM happens in the browser process. I found no public description of the code CrUX uses to reduce one page view's interactions to a value, so I can't confirm that it uses ⌊N/50⌋ with no cap, nor how it counts interactions. Chromium's source for that observer would settle it.
Whether CrUX uses 8 ms-rounded durations. The rounding in the spec is a web-exposure rule. Chrome's internal metrics pipeline could use rounded or unrounded values, and at the 200 ms and 500 ms boundaries the difference matters. I couldn't find a source either way.
How the other engines round and group. Safari 26.2 and Firefox 144 both expose interactionId, but I haven't run the scenarios above in them, and I found no published statement of Safari's duration granularity in light of WebKit's argument for 16 ms at 60 Hz. The WebKit position is still open.
How assistive technology interactions are counted. WebKit's standards position raises that some AT-initiated activations don't fire pointer or key events at all. If they don't, the spec's algorithm can't give them an id, and an interaction a screen-reader user experiences as slow wouldn't count toward INP. I found no test or documentation of what any engine does here.
What the spec will say once the refactor lands. PR #165 is open and unmerged. Until it lands, the parts of this piece that describe keyboard ids, keypress, simulated clicks and pending entries describe a draft whose editor says that wording doesn't work well in practice. The auto-repeat detail I noted, where repeated keydowns get fresh ids without incrementing interactionCount, may be a drafting accident that disappears in the rewrite.
Why INP has been regressing. CrUX's August 2026 release notes report 85.3% of origins with good INP, down 0.5 points, and say the continued regression of INP is a cause for concern without a definitive reason. The September 2026 release has it back up 0.1 points, at 85.4%, which is one month and not a reversal. With grouping rules changing in Chrome releases throughout 2026, a definition change is one candidate explanation among several. Nothing public lets me separate it from changes in what sites ship.
Whether the excluded events will stay excluded. The spec says continuous events are left out because there isn't enough guidance yet on how to count and aggregate them. That's a statement about the current draft, not a design principle, and scroll and drag responsiveness would need a different kind of metric. Nothing I found says one is being specified.
Notes
-
The per-release changelog pages and Chromium's own schedule disagree about when these releases reached users. The Chrome 144 page says stable users had it in October 2025, the Chrome 147 page says February 2026 and the Chrome 148 page says March 2026. Chromium Dash's schedule gives stable dates of 13 January 2026, 7 April 2026 and 5 May 2026. The file names (
2025_10,2026_02,2026_03) look like the month each page was written, so I'd trust Chromium Dash for the dates. ↩︎
References
- Event Timing API (Editor's Draft, 13 October 2026). W3C Web Performance Working Group>. Accessed .
- Event Timing API (W3C Working Draft, 13 October 2026). W3C>. Accessed .
- Interaction to Next Paint (INP). web.dev (Google)>. Accessed .
- Interaction to Next Paint Changelog. Chromium>. Accessed .
- INP, LCP, and FCP Changes in Chrome 126. Chromium>. Accessed .
- Interaction to Next Paint Changes in Chrome 127. Chromium>. Accessed .
- Interaction to Next Paint Changes in Chrome 130. Chromium>. Accessed .
- Interaction to Next Paint Changes in Chrome 133. Chromium>. Accessed .
- Interaction to Next Paint Changes in Chrome 144. Chromium>. Accessed .
- Interaction to Next Paint Changes in Chrome 147. Chromium>. Accessed .
- Interaction to Next Paint Changes in Chrome 148. Chromium>. Accessed .
- Chromium release schedule. Chromium Dash>. Accessed .
- PerformanceEventTiming: interactionId property. MDN>. Accessed .
- browser-compat-data: api/PerformanceEventTiming.json. MDN (GitHub)>. Accessed .
- browser-compat-data: api/Performance.json. MDN (GitHub)>. Accessed .
- Firefox 144 release notes for developers. MDN>. Accessed .
- WebKit Features for Safari 26.2. WebKit>. Accessed .
- Event timing performance entries. webstatus.dev>. Accessed .
- Event Timing (standards position #420). WebKit (GitHub)>. Accessed .
- Default buffering of Event Timing Entries is based on durationThreshold: 104 (#124). w3c/event-timing (GitHub)>. Accessed .
- interactionIds of keyboard simulated clicks are not spec'd (#147). w3c/event-timing (GitHub)>. Accessed .
- keypress doesn't expose an interactionId but there is a web platform test for it (#149). w3c/event-timing (GitHub)>. Accessed .
- Change the pendingKeydowns list and change keyboard interactionId assignment to be eager (#153). w3c/event-timing (GitHub)>. Accessed .
- Clean up Event Timing spec, especially InteractionID assignment steps (#164). w3c/event-timing (GitHub)>. Accessed .
- Progress towards #164: Major spec refactoring and clean up InteractionId assignment (#165). w3c/event-timing (GitHub)>. Accessed .
- Timing Entry Names Registry (Editor's Draft, 16 September 2026). W3C Web Performance Working Group>. Accessed .
- HTML Standard: update the rendering. WHATWG>. Accessed .
- HTML Standard: the label element. WHATWG>. Accessed .
- web-vitals 6.2.3 README. GoogleChrome (npm package web-vitals)>. Accessed .
- web-vitals 6.2.3 source: onINP.ts. GoogleChrome (npm package web-vitals)>. Accessed .
- web-vitals 6.2.3 source: InteractionManager.ts. GoogleChrome (npm package web-vitals)>. Accessed .
- web-vitals 6.2.3 source: interactionCountPolyfill.ts. GoogleChrome (npm package web-vitals)>. Accessed .
- web-vitals package metadata. npm registry>. Accessed .
- CrUX release notes. Chrome for Developers>. Accessed .