Skip to main content
Accessibility AccessLint 0.16

Video elements must have captions via <track kind='captions'> or <track kind='subtitles'>.

About this AccessLint rule

Videos that contain audio must include captions so that people who are deaf or hard of hearing can access the spoken dialogue and other meaningful sounds. When a <video> element lacks a <track> element with kind="captions" or kind="subtitles", this content is completely unavailable to those users.

Captions are distinct from subtitles in some contexts, but HTML treats both kind="captions" and kind="subtitles" as valid ways to provide text synchronized with video audio. Captions typically include not just dialogue but also descriptions of relevant sound effects, music, and speaker identification. Subtitles usually focus on translating dialogue. For accessibility purposes, either kind satisfies the requirement as long as the text track conveys the same information as the audio.

This rule maps to WCAG 2.0 Success Criterion 1.2.2: Captions (Prerecorded), which is a Level A requirement. Level A is the minimum conformance level, meaning any site that claims WCAG conformance must meet it. The criterion exists because audio content in video is a barrier for users who cannot hear it, and captions are the established solution.

Beyond deaf and hard of hearing users, captions also help people watching video in noisy environments, non-native speakers of the audio's language, and people with cognitive disabilities who benefit from reading along with spoken content.

How to fix this

Add a <track> element inside the <video> element that points to a caption file in WebVTT format (.vtt). Set the kind attribute to "captions" (or "subtitles" if appropriate). The caption file should include:

  • All spoken dialogue, with speaker identification when multiple speakers are present.
  • Descriptions of meaningful non-speech audio such as sound effects, music, or silence that carries meaning.

If the video has no audio track at all, this rule does not apply. If the video is a media alternative for text content already present on the same page (and is labeled as such), captions are also not required, though they are still recommended.

To create a WebVTT caption file, write a plain text file with the .vtt extension. Each caption entry has a timestamp range and the corresponding text:

WEBVTT
00:00:01.000 --> 00:00:04.000
[Background music playing]
00:00:04.000 --> 00:00:08.000
Welcome to our guide on keyboard accessibility.

Examples

Video without captions (incorrect)

This video has no <track> element. Users who cannot hear the audio have no way to access that content.

<video src="product-demo.mp4" controls>
</video>

Video with captions track (correct)

A <track> element with kind="captions" provides synchronized text for the audio content.

<video src="product-demo.mp4" controls>
<track src="product-demo-captions.vtt" kind="captions" srclang="en" label="English captions">
</video>

Video with subtitles track (also correct)

Using kind="subtitles" is an acceptable alternative. Include the srclang and label attributes so users can identify the track.

<video src="product-demo.mp4" controls>
<track src="product-demo-en.vtt" kind="subtitles" srclang="en" label="English">
</video>

Video that is a labeled media alternative for on-page text (correct)

When a video repeats information already provided as text on the same page, and the page clearly identifies the video as an alternative, captions are not strictly required. The surrounding text must convey the same information as the audio.

<p>
Keyboard accessibility means every interactive element on a page can be
reached and operated with the keyboard alone. Watch the video below for
the same information in video form.
</p>
<video src="keyboard-accessibility.mp4" controls>
</video>

Even in this case, adding captions is still good practice because it improves the experience for all users.

Detect accessibility issues automatically

Rocket Validator scans your site with complementary accessibility engines, helping teams find issues across every page.

Help us improve our guides

Was this guide helpful?
๐ŸŒ Trusted by teams worldwide

Validate at scale.
Ship accessible websites, faster.

Automated HTML & accessibility validation for large sites. Check thousands of pages against WCAG guidelines and W3C standards in minutes, not days.

Scheduled Reports
API Access
Open Source Standards
$7 / 7 days

Pro Trial

Full Pro access. Cancel anytime.

Start Pro Trial โ†’

Join teams across 40+ countries