# Lighthouse
Lighthouse is an open-source automated tool by Google for auditing web page quality. It runs audits across five categories: Performance, Accessibility, Best Practices, SEO, and Progressive Web App (PWA) compliance. Each category produces a score from 0 to 100.
## How to use
- **Chrome DevTools**: Audits panel (built-in, no install needed)
- **Chrome extension**: Lighthouse browser extension
- **CLI**: `npm install -g lighthouse` then `lighthouse https://example.com`
- **Node module**: programmatic usage via `const lighthouse = require('lighthouse')`
- **PageSpeed Insights**: https://pagespeed.web.dev (runs Lighthouse under the hood with real-world CrUX data)
## CLI usage
```bash
# Basic audit
lighthouse https://example.com
# Output as JSON
lighthouse https://example.com --output json --output-path report.json
# Specific categories only
lighthouse https://example.com --only-categories=performance,accessibility
# Run in headless mode (CI-friendly)
lighthouse https://example.com --chrome-flags="--headless"
```
## Key metrics (Performance)
- First Contentful Paint (FCP)
- Largest Contentful Paint (LCP)
- Total Blocking Time (TBT)
- Cumulative Layout Shift (CLS)
- Speed Index
## References
- https://github.com/GoogleChrome/lighthouse
- https://developer.chrome.com/docs/lighthouse
## Related
- [[Search Engine Optimization (SEO)]]
- [[Accessibility (a11y)]]
- [[Core Web Vitals]]