Using Lighthouse to Audit Performance & A11y


When building for the web, you’re not just writing code that looks good, you’re building experiences which can be good or poor.
You want your user experiences (UX) to be fast, accessible, and reliable though. Hence, the need for tools like Lighthouse. Whether you're refining your Core Web Vitals or ensuring your product is usable by everyone (including those relying on screen readers or keyboard navigation), Lighthouse is a developer’s flashlight into the dark corners of user experience.
What then is Lighthouse?
Lighthouse is an open-source auditing tool built to help you automated tool to help you improve the quality of your web apps. It lets you run tests against any webpage at all, and returns a detailed report with scores on:
Performance
Accessibility (A11y)
Best Practices
SEO
Progressive Web App (PWA) readiness
Each section gives a numeric score out of 100, but more importantly, it tells you why something is lacking and how to fix it.
Lighthouse can be run in the Chrome DevTools, as a node module, or from the command line. Let’s check them out;
1: Chrome DevTools
Navigate to your site in Google Chrome browser.
Right-click on anywhere on the page, and then click on “Inspect”. Click on the “Lighthouse” tab at the top panel.
Choose the categories you want to audit the site in. This could be performance, accessibility, best practices and/or SEO.
Click "Analyze page load” button.
Wait a few seconds for the analysis to complete, and then check out your full report.
2: Command Line
If you want more control or to automate audits, you can use:
npm install -g lighthouse
lighthouse https://your-site.com --view
This gives you a local HTML report in your browser which you can then proceed to review.
Auditing Performance with Lighthouse
Performance isn’t just about speed. It’s also about interactivity. Lighthouse looks at metrics like:
First Contentful Paint (FCP) – how fast the first element shows.
Largest Contentful Paint (LCP) – how quickly the main content loads.
Time to Interactive (TTI) – how long it takes before the page responds to user input.
Total Blocking Time (TBT) – the length of time the page is unresponsive due to heavy JS.
Cumulative Layout Shift (CLS) – how visually stable the page is.
Common Fixes:
Compress and lazy-load assets like images, gifs, videos, etc.
Minify CSS and JS files.
Use a Content Delivery Network (CDN) to store and fetch assets.
Code-split your bundles.
Preload only assets that are critical to the page functionality
Lighthouse runs its audits against the current page and then opens up the results of the report in the DevTool tab. These results come with recommendations/suggestions which would go a long way to help you rank up the scores. Take note of each report and fix in your codebase, one at a time.
Auditing Accessibility (A11y) with Lighthouse
The importance of accessibility (or A11y), a very important pillar in frontend development, is so commonly overlooked by a lot of engineers today. Yet, it’s one of the most critical things to factor in when building for great UX.
Lighthouse helps us run checks to answer questions like:
Are buttons and links labeled?
Do images have
alt
text?Is the contrast ratio sufficient?
Can the page be navigated with a keyboard?
Are ARIA (Accessible Rich Internet Applications) roles properly used?
These aren’t just technical checkboxes but are properties that when not properly checked, can directly impact the experience of users with disabilities.
Recommended Workflow:
To maximize Lighthouse, you can follow these steps;
Run a Lighthouse audit on Accessibility for a start.
Fix low-hanging issues like color contrast or missing labels.
Use tab navigation to test the keyboard navigation flow.
Run a screen reader (like VoiceOver or NVDA if you have access to one) to simulate non-visual access.
Re-run Lighthouse and aim for a 90+ score.
PS: Passing Lighthouse doesn’t mean your site is fully accessible, it’s just a starting point. Always test manually as it matters a lot.
Integrating Lighthouse Into Your Dev Process
If you’re building at scale or on a team, then you should do these:
CI Integration: Use Lighthouse CI to catch regressions during builds.
Custom Configs: Tailor Lighthouse runs with custom configs to align with your team’s goals.
Performance Budgets: Set performance thresholds and fail builds that exceed them.
In Conclusion
Lighthouse isn’t just a tool. It goes a long way to help you spot real issues, track progress, and build empathy for anyone using your site. It always has a way to force you to think about quality across the board in any page/site you’re building by giving really helpful recommendations.
Do not fail to also test manually to ensure your users always have a great experience!
References & Further Reading
Subscribe to my newsletter
Read articles from Gospel Chinyereugo directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Gospel Chinyereugo
Gospel Chinyereugo
I am a highly skilled Full Stack Software Engineer (frontend heavy) with a track record of success in the banking/fintech, health-tech, e-commerce, event tech, and CRM industries. With over half a decade of experience, I bring a wealth of experience in development, advocacy, problem-solving and architecture design.