Skip to content
Tutorials Center
My learning

Topics

Lesson 29 of 36 ยท Lighthouse and Audits

Accessibility, SEO and Best Practices Audits

What the three non-performance Lighthouse categories check, how to fix the most common failures, and why automated audits only cover part of real accessibility.

Performance gets the attention, but the other three Lighthouse categories catch problems that cost real users and real traffic: missing alt text that locks out screen reader users, low-contrast text, pages search engines cannot understand, or insecure resources. These audits are binary and cheap to fix, so they are some of the best value work in DevTools.

This lesson covers what each category checks, the failures you will meet most often, and the limits of automated testing.

Accessibility

The accessibility score is a weighted pass rate of automated checks powered by the axe-core engine. A score of 100 means no automatically detectable failures, not that the page is fully accessible: automated tools find only a portion of problems (commonly cited estimates are around 30 to 40 percent), because things like logical focus order and meaningful link text need a human.

Frequent failures:

  • Image elements do not have [alt] attributes: every <img> needs alt. Describe meaningful images; use alt="" for decorative ones.
  • Background and foreground colors do not have a sufficient contrast ratio: normal text needs at least 4.5:1 against its background, large text 3:1. The color picker in the Elements panel shows the ratio and suggests a passing color.
  • Form elements do not have associated labels: connect each <input> to a <label for> or wrap it in a label; placeholders are not labels.
  • Buttons, links and inputs do not have an accessible name: icon-only buttons need aria-label or visually hidden text.
  • <html> element does not have a [lang] attribute: screen readers use it to pick pronunciation.
  • Heading elements are not in a sequentially-descending order and document does not have a title.
  • ARIA attributes misused: for example role values that do not exist, or aria-hidden on a focusable element.

When you click a failing audit in DevTools, each failing element is listed with a node snippet; clicking it selects the element in the Elements panel. DevTools has more accessibility tools beyond Lighthouse: the Accessibility pane in the Elements sidebar (shows the computed accessible name, role and ARIA properties), the Accessibility tree view, and Rendering > Emulate vision deficiencies to see the page as users with blurred vision or color blindness would.

SEO

The SEO category checks the basics that let search engines crawl and describe the page:

  • A <title> element and a meta description.
  • A viewport meta tag, so the page is mobile-friendly.
  • Legible font sizes on mobile and tap targets large enough (about 48 by 48 CSS pixels including spacing).
  • Links with descriptive text: "click here" and "read more" fail.
  • A valid robots.txt and a page that is not blocked from indexing by noindex or a blocking header.
  • A valid canonical link and valid hreflang values for multilingual sites.
  • Crawlable links (real <a href> rather than click handlers) and HTTP status 200.

Lighthouse SEO checks the technical baseline only. It says nothing about content quality, keywords or backlinks.

Best Practices

This category collects trust and safety checks:

  • Uses HTTPS and has no mixed content (HTTP resources on an HTTPS page).
  • No browser errors logged to the console. Open the Console panel to see them.
  • No deprecated APIs, correct image aspect ratios, appropriate charset declaration and a valid doctype.
  • Avoids known vulnerable JavaScript libraries and, in newer versions, checks for security headers such as a Content Security Policy.
  • No geolocation or notification permission requests on page load.
  • Source maps present for large first-party JavaScript (informational).

A checker you can run

Real Lighthouse needs a browser, but many of these checks are plain HTML inspection. The stand-in below analyzes an HTML string for several accessibility and SEO issues, to show how simple many of the rules really are. It uses simple pattern matching, which is not a real HTML parser, so treat it as a teaching toy.

JS Stand-in: a tiny HTML audit

Press Run (or Ctrl + Enter) to see the console output here.

No output.

A real tool must handle a DOM with computed styles, ARIA, shadow DOM and dynamic content, which is why you use Lighthouse or axe for real audits.

Computing a contrast ratio

Contrast is a perfect example of a rule that is pure math. WCAG defines relative luminance from linearized sRGB values, and the ratio is (L1 + 0.05) / (L2 + 0.05) for the lighter and darker color.

JS Stand-in: WCAG contrast ratio calculator

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Black on white is exactly 21:1. The popular grey #777777 on white lands just below 4.5:1, a famous accidental failure; #595959 passes comfortably.

After the audit: manual checks

Pair Lighthouse with manual testing: navigate the whole page using only the keyboard (Tab, Shift+Tab, Enter, Space, Escape) and make sure the focus is always visible and the order is logical; zoom to 200%; test with a screen reader such as NVDA or VoiceOver for key flows; check the page with images and CSS off.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What minimum contrast ratio does WCAG AA require for normal-size text?

    AA requires 4.5:1 for normal text and 3:1 for large text. 7:1 is AAA.
  2. 2. A page scores 100 in Lighthouse Accessibility. What can you conclude?

    Automated tests cover only a part of accessibility issues.
  3. 3. Which SEO audit would the link text 'click here' fail?

    Descriptive link text helps users and search engines understand the destination.
  4. 4. Mixed content is:

    Loading insecure resources on a secure page is flagged by the Best Practices category.

Summary

  • Accessibility audits (axe-core) catch alt text, contrast, labels, names, language and heading problems but cover only part of real accessibility.
  • SEO audits check title, description, viewport, link text, robots and indexability.
  • Best Practices checks HTTPS, console errors, deprecated APIs and security basics.
  • Many rules, like contrast, are simple math; use DevTools panes to fix elements directly.
  • Always add manual keyboard and screen reader testing.

Next: Debugging Layout and CSS Bugs