Skip to content

First Input Delay is published by General Action, the company that makes Emdash. When we recommend Emdash, we are recommending our own product. About this site

How to measure First Input Delay

First Input Delay is measured in the field with the Event Timing API: observe the first-input performance entry and subtract its startTime from its processingStart. That still works in current browsers. What has changed is the tooling around it. Google’s own tools stopped reporting FID in 2024, and the web-vitals library dropped it in 2025.

The Event Timing API exposes a first-input entry for the first discrete interaction on a page. MDN’s PerformanceEventTiming reference defines the two timestamps you need: startTime is when the event was created, and processingStart is “the time at which event dispatch started”.

// Pages that loaded in a background tab do not produce a meaningful FID.
let firstHiddenTime = document.visibilityState === 'hidden' ? 0 : Infinity;
document.addEventListener(
'visibilitychange',
(event) => {
firstHiddenTime = Math.min(firstHiddenTime, event.timeStamp);
},
{ once: true }
);
new PerformanceObserver((list, observer) => {
for (const entry of list.getEntries()) {
// Only count inputs that happened before the page was first hidden.
if (entry.startTime < firstHiddenTime) {
const fid = entry.processingStart - entry.startTime;
console.log('FID:', fid, 'ms, from a', entry.name, 'event');
// Send it to your analytics endpoint here.
}
}
observer.disconnect();
}).observe({ type: 'first-input', buffered: true });

Three details in that snippet matter:

  • buffered: true returns an entry that was recorded before your script ran. Without it, a tap during load is missed, and those are the slow ones.
  • The first-input entry is always reported. Ordinary event entries are only exposed when they last 104 ms or longer by default, but MDN notes that first-input “is reported even if its duration is below the threshold”.
  • The visibility check follows web.dev’s guidance. Its FID article warns that “not all first-input entries are valid for measuring FID” and says entries from pages loaded in the background should be ignored.

The same article lists two cases the raw API does not cover: pages restored from the back/forward cache, and inputs that happen inside iframes. If you need numbers comparable to what Chrome used to publish, handle those too, or use the library below.

MDN’s compatibility data lists PerformanceEventTiming from Chrome 76, Edge 79, Firefox 89 and Safari 26.2, and MDN marks it as newly available across the latest browsers since December 2025. Older Safari versions report nothing, so wrap the observer in a try block or check PerformanceObserver.supportedEntryTypes.includes('first-input') first.

Google’s web-vitals library was the standard way to collect FID. Its status today, from the project’s changelog:

Version Released FID support
3.x From August 2022 onFID() supported
4.0.0 May 13, 2024 onFID() deprecated
5.0.0 May 7, 2025 onFID() removed
6.2.3 (current at the time of writing) October 5, 2026 Not available. Exports are onCLS, onFCP, onINP, onLCP and onTTFB

If you need FID for a legacy dashboard, pin the last major version that has it:

// npm install web-vitals@4
import { onFID } from 'web-vitals';
onFID((metric) => {
console.log(metric.name, metric.value, metric.rating);
});

Version 4’s documentation marks onFID() as deprecated. For anything new, measure INP with a current version. The attribution build tells you how much of the interaction was input delay, which is the part FID used to capture:

// npm install web-vitals
import { onINP } from 'web-vitals/attribution';
onINP(({ value, rating, attribution }) => {
console.log('INP:', value, rating);
console.log('Input delay:', attribution.inputDelay);
console.log('Processing:', attribution.processingDuration);
console.log('Presentation delay:', attribution.presentationDelay);
console.log('Element:', attribution.interactionTarget);
});
  • Chrome UX Report (CrUX). FID was removed in the release of September 10, 2024. The CrUX API dropped it that day, and the August 2024 BigQuery dataset is the last to contain FID columns. Queries against older monthly tables still work.
  • PageSpeed Insights. The documentation lists FCP, LCP, CLS, INP and TTFB as its field metrics. The Core Web Vitals assessment is INP, LCP and CLS.
  • Search Console. The Core Web Vitals report switched from FID to INP on March 12, 2024.

If an API client of yours still reads FID from the CrUX API or the PageSpeed Insights API, it has been receiving nothing since September 2024. Chrome described the removal as a breaking change made without a new API version.

FID cannot be produced in a lab. In web.dev’s words, it “requires a real user and thus cannot be measured in the lab”. A Lighthouse run loads the page and nobody taps anything.

Total Blocking Time (TBT) asks a related question that needs no visitor: for how long during load was the main thread blocked, so that an input would have had to wait? It adds up the portion of every long task beyond 50 ms. Lighthouse 10 gives TBT 30% of the performance score, more than any other metric.

TBT is a proxy. Web.dev’s TBT article says a low TBT “often correlates with” a low INP, and also that it is “not a substitute for INP”. Use the lab number to catch regressions before release, and field data to learn what visitors experienced. Long tasks and Total Blocking Time explains the calculation.

Once you have numbers, How to improve First Input Delay covers what to change. For how the legacy and current metrics differ, see FID vs. INP.

Frequently asked questions

How is First Input Delay calculated?

FID is the first-input performance entry's processingStart minus its startTime. startTime is when the input event was created, and processingStart is when the browser was able to begin dispatching it to event handlers. The difference is the time the input spent waiting.

Does the web-vitals library still measure FID?

Not in current versions. The onFID function was deprecated in web-vitals 4.0.0, released on May 13, 2024, and removed in 5.0.0, released on May 7, 2025. To keep using it you have to pin version 4. The supported replacement is onINP.

Does PageSpeed Insights show First Input Delay?

No. PageSpeed Insights reports field data for First Contentful Paint, Largest Contentful Paint, Cumulative Layout Shift, Interaction to Next Paint and Time to First Byte. FID was removed after Chrome ended support for it on September 9, 2024.

Which browsers report first-input entries?

According to MDN's compatibility data, the PerformanceEventTiming interface is supported from Chrome 76, Edge 79, Firefox 89 and Safari 26.2. MDN lists it as newly available across the latest browsers since December 2025.

Why does Lighthouse report Total Blocking Time and not FID?

FID only exists when a real person interacts with a page, and Lighthouse loads the page with nobody there. Total Blocking Time needs no interaction. It adds up the part of every long task beyond 50 milliseconds during load, which is the time an input would have been left waiting.