How to Improve Interaction to Next Paint (INP)

Learn how to optimize Interaction to Next Paint (INP) for better responsiveness. Covers JavaScript optimization, event handling, and reducing input delay.

inpcore-web-vitalsperformance

What is INP?

Interaction to Next Paint (INP) measures page responsiveness by observing the latency of all click, tap, and keyboard interactions throughout a page's lifespan. A good INP score is under 200 milliseconds.

Why INP Replaced FID

In March 2024, INP replaced First Input Delay (FID) as a Core Web Vital. While FID only measured the first interaction, INP measures all interactions, providing a more complete picture of responsiveness.

Steps to Improve INP

1

Break Up Long Tasks

Use setTimeout, requestIdleCallback, or yield to break JavaScript tasks into smaller chunks that don't block the main thread.

2

Optimize Event Handlers

Keep event handlers lightweight. Move heavy computations to Web Workers or defer them.

3

Reduce JavaScript Execution Time

Minimize and tree-shake JavaScript bundles. Remove unused code and dependencies.

4

Use Content-Visibility

Apply content-visibility: auto to off-screen content to reduce rendering work.

Frequently Asked Questions

A good INP score is under 200 milliseconds. Scores between 200-500ms need improvement, and over 500ms is poor.
FID only measured the first interaction's input delay. INP measures all interactions throughout the page lifecycle and includes processing time and presentation delay.

Ready to audit your website?

Get instant performance, SEO, and accessibility scores for your website.