Sub topic 11
Running and interpreting Lighthouse audits
This chapter assumes you can open DevTools, read the Network panel, and record a profile in the Performance panel. Lighthouse builds on those skills. It runs a set of automated checks on a page and reports what it found. The report points you to problems. It does not fix them for you.
What Lighthouse measures
Lighthouse is an auditing tool built into Chromium-based DevTools. It loads your page under controlled conditions and scores it in up to four categories.
| Category | What it checks |
|---|---|
| Performance | How quickly the page loads and becomes usable |
| Accessibility | Contrast, labels, alt text, and valid ARIA usage |
| Best practices | HTTPS, console errors, deprecated APIs |
| SEO | Crawlability, meta tags, readable link text |
Each category gets a score from 0 to 100. Scores of 90 and above show as green, 50 to 89 as orange, and below 50 as red. Treat the number as a summary. The individual findings underneath are what you act on.
Running an audit
- Open the page you want to test. Use an Incognito window if possible, so extensions do not change the results.
- Open DevTools and select the Lighthouse panel. It may sit under the
>>overflow menu. - Choose a mode. Navigation analyzes a full page load. Timespan records while you interact with the page. Snapshot analyzes the page in its current state.
- Choose a device: Mobile or Desktop. Mobile applies CPU slowdown and network throttling, so its scores are usually lower.
- Select the categories to run, then click Analyze page load.
Reading the Performance results
The Performance score is a weighted blend of several metrics. Metric names and weights change between Lighthouse versions, so check the current documentation. The main ones are these:
- First Contentful Paint (FCP) is the time until the first text or image appears.
- Largest Contentful Paint (LCP) is the time until the largest visible element renders.
- Total Blocking Time (TBT) is the total time the main thread was blocked by long tasks. This connects directly to the long tasks you saw in the Performance panel.
- Cumulative Layout Shift (CLS) measures unexpected movement of content while the page loads.
Below the metrics, Lighthouse lists Opportunities and Diagnostics. Opportunities suggest specific changes, such as properly sizing images or removing unused JavaScript. Diagnostics describe conditions worth knowing about, such as a large DOM or a long main-thread task. Expand an item to see the affected files, then return to the Network, Elements or Performance panel to investigate.
Interpreting the results with care
Lighthouse reports lab data. That means one simulated load on one machine under fixed conditions. Real users have different devices, networks and cache states. Keep these points in mind:
- Scores vary between runs. Run the audit three times and compare the median instead of trusting a single result.
- A high score does not prove the page is fast or accessible. Automated accessibility checks catch only some problems, so you still need manual testing with a keyboard and a screen reader.
- A low score on a single metric tells you where to look first. Fix the largest finding, then re-run.
- Lab results and field data can disagree. Field data comes from real visits, for example the Chrome User Experience Report. When they differ, trust field data for how users actually experience the page.
A worked example
Suppose a product page scores 52 on mobile Performance. The report shows LCP at 5.1 seconds and an Opportunity named "Properly size images".
- Expand the opportunity. It lists a 2400 px wide hero image displayed at 400 px.
- Open the Network panel and confirm the image is the largest request.
- Serve a resized version and add explicit
widthandheightattributes, which also helps CLS. - Re-run the audit under the same settings.
LCP drops to 2.6 seconds and the score rises. The comparison is only fair because the device mode, throttling and page state matched between runs.
Common errors
- Auditing with extensions enabled, which adds extra scripts and requests.
- Auditing a page behind a login without being signed in, so the report covers the login redirect.
- Chasing a score of 100 instead of fixing problems that affect users.
- Reading Opportunities as guaranteed savings. The estimated time saved is a projection and may not add up across items.
Exercise
Your Lighthouse mobile score is 58, and after you compress one image it is 61. Another run without any change gives 55. What should you conclude, and what should you do next?
Show answer
The 3-point improvement is inside the normal run-to-run variation, so it does not show the fix worked. Run the audit several times for each version under identical settings and compare medians. Also check the specific metric the fix targets, such as LCP, and confirm the image size in the Network panel.
Exercise
Which Lighthouse mode would you choose to measure layout shifts that happen after you click a button, and why?
Show answer
Timespan mode. It records during interaction, while Navigation covers only the initial page load and Snapshot captures one static state.