Lighthouse is an open-source,automated tool for improving the quality of web pages. You can run it againstany web page, public or requiring authentication. It has audits for performance,accessibility, progressive web apps, SEO and more.
You can run Lighthouse in Chrome DevTools, from the command line, or as aNode module. You give Lighthouse a URL to audit, it runs a series of auditsagainst the page, and then it generates a report on how well the page did.From there, use the failing audits as indicators on how to improve the page.Each audit has a reference doc explaining why the audit is important, aswell as how to fix it.
You can also use Lighthouse CI to prevent regressions on your sites.
Check out the video below from Google I/O 2019 to learn more about how to useand contribute to Lighthouse.
Lighthouse Test Firefox
Choose the Lighthouse workflow that suits you best:
- In Chrome DevTools. Easily audit pages that require authentication,and read your reports in a user-friendly format.
- From the command line. Automate your Lighthouse runs via shell scripts.
- As a Node module. Integrate Lighthouse into your continuousintegration systems.
- From a web UI. Run Lighthouse and link to reports withoutinstalling a thing.
Run Lighthouse in Chrome DevTools
Lighthouse powers the Audits panel of Chrome DevTools. To run a report:
- Download Google Chrome for Desktop.
- In Google Chrome, go to the URL you want to audit. You can audit any URL on the web.
- Open Chrome DevTools.
Click the Audits tab.
Click Perform an audit. DevTools shows you a list of audit categories.Leave them all enabled.
Click Run audit. After 30 to 60 seconds, Lighthouse gives you a reporton the page.
Install and run the Node command line tool
To install the Node module:
- Download Google Chrome for Desktop.
- Install the current Long-Term Supportversion of Node.
Install Lighthouse. The
-gflag installs it as a global module.
To run an audit:
To see all the options:
Run the Node module programmatically
See Using programmatically for an example of running Lighthouseprogrammatically, as a Node module.
Run Lighthouse as a Chrome ExtensionNote: Unless you have a specific reason, you should use the Chrome DevTools workflowrather than this Chrome Extension workflow. The DevTools workflow allows for testing localsites and authenticated pages, while the extension does not.
To install the extension:
Download Google Chrome for Desktop.
Install the LighthouseChrome Extension from the Chrome Webstore.
To run an audit:
In Chrome, go to the page you want to audit.
Click Lighthouse . It shouldbe next to the Chrome address bar. If not, open Chrome's main menu andaccess it at the top of the menu. After clicking, the Lighthousemenu expands.
Click Generate report. Lighthouse runs its audits against thecurrently-focused page, then opens up a new tab with a report of theresults.
Run PageSpeed Insights
To run Lighthouse on PageSpeed Insights:
- Navigate to PageSpeed Insights.
- Enter a web page URL.
Share and view reports online
Use the Lighthouse Viewer to view and share reports online.
Share reports as JSON
The Lighthouse Viewer needs the JSON output of a Lighthouse report. Thelist below explains how to get the JSON output, depending on whatLighthouse workflow you're using:
- Chrome DevTools. Click Download Report .
Command line. Run:
lighthouse --output json --output-path <path/for/output.json>
Lighthouse Viewer. Click Export > Save as JSON.
To view the report data:
- Open the Lighthouse Viewer in Google Chrome.
- Drag the JSON file onto the viewer, or click anywhere on the Viewer toopen your file navigator and select the file.
Share reports as GitHub Gists
If you don't want to manually pass around JSON files, you can also share yourreports as secret GitHub Gists. One benefit of Gists is free version control.
To export a report as a Gist from the report:
- (If already on the viewer, skip this step) Click Export > Open In Viewer. The report opens in theViewer, located at
- In the Viewer, click Share . Thefirst time you do this, a popup asks permission to access your basicGitHub data, and to read and write to your Gists.
To export a report as a Gist from the CLI version of Lighthouse,just manually create a Gist and copy-paste the report's JSON outputinto the Gist. The Gist filename containing the JSON output must end in
.lighthouse.report.json. See Share reports as JSON for an example ofhow to generate JSON output from the command line tool.
To view a report that's been saved as a Gist:
?gist=<ID>to the Viewer's URL, where
<ID>is the ID of the Gist.
Open the Viewer, and paste the URL of a Gist into it.
Lighthouse aims to provide guidance that is relevant and actionable for all web developers. To this end, there are two features now available that allow you to tailor Lighthouse to your specific needs.
Stack Packs allow Lighthouse to detect what platform your site is built on and display specific stack-based recommendations. These recommendations are defined and curated by experts from the community.
Lighthouse Firefox Extension
To contribute a Stack Pack, review the Contributing Guidelines.
- Lighthouse Plugins.Lighthouse Plugins allow domain experts in the community to extend the functionality of Lighthouse for their specific needs. You are now able to leverage the data that Lighthouse collects to create new audits. At its core, a Lighthouse plugin is a node module that implements a set of checks that will be run by Lighthouse and added to the report as a new category.
For more information about how to create your own plugin, check out our Plugin Handbook in the Lighthouse GitHub repo.
Lighthouse Firefox Login
If you are a company or an individual who is integrating Lighthouse as part of the products / services you're offering, first things first - we're so excited you are! We want as many people as possible to use Lighthouse, and this Guidelines and Brand Assets for Integrating Lighthouse is meant to make it straightforward for you to show that Lighthouse is under the hood while protecting our brand.
Contribute to Lighthouse
Lighthouse is open source and contributions are welcome.Check out the repository's issue trackerto find bugs that you can fix, or audits that you can create or improve upon.The issues tracker is also a good place to discuss audit metrics, ideas fornew audits, or anything else related to Lighthouse.