# INP

> The INP (Interaction to Next Paint) metric measures page responsiveness to user interactions.

## How do I improve Interaction to Next Paint (INP)?

The metric that observes the latency of clicks, taps and key presses throughout the visit and reports one of the slowest. A good value is 200 milliseconds or less. Improved by breaking up long tasks and reducing JS work.

- Topic: Performance
- Type: concept

## Example

Wrong:

```js
input.addEventListener('input', (e) => {
  results.render(filterAll(items, e.target.value));
});
```

Right:

```js
input.addEventListener('input', (e) => {
  showSpinner();
  setTimeout(() => {
    results.render(filterAll(items, e.target.value));
  }, 0);
});
```

Deferring the heavy filter lets the browser paint the input change first, so the next paint is not blocked.

## Common mistakes

- Running expensive filtering synchronously in an input handler, so typing lags.

## Key points

- Event handlers update the UI first and move heavy work after the next paint or to a worker.
- Long tasks are split into smaller chunks that yield to the main thread.
- Large lists and heavy re-renders are not triggered on every keystroke.

## Interview questions

### What is a good INP score?

200 ms or less at the 75th percentile of visits is good, and over 500 ms is poor.

### INP vs FID: what is the difference?

FID measured only the input delay of the first interaction. INP measures the full time to the next paint across all interactions and reports one of the slowest.

### Why is my INP bad in the field but fine in the lab?

Lab tests barely interact with the page and run on fast hardware, while real users click and type on slower phones.

## Related cards

- [Core Web Vitals](https://wonderium.dev/web/core-web-vitals.md)
- [Event Loop](https://wonderium.dev/js/event-loop.md)
- [Worker](https://wonderium.dev/js/worker.md)
- [useTransition()](https://wonderium.dev/react/use-transition.md)
- [requestAnimationFrame()](https://wonderium.dev/js/request-animation-frame.md)

---

- Level: [Web Platform](https://wonderium.dev/web.md)
- HTML version: https://wonderium.dev/web/inp
- Last updated: 2026-11-25
