Ensure <video> Elements Have Captions

Photo of Researcher
Yotam Flohr
Researcher
Hearing
WCAG 2.1 Level A

Written and researched for humans by humans

Photo of Researcher
Yotam Flohr
Researcher
Photo of Expert
Ritvik Shrivastava
Expertly reviewed by
Comments: 0
Your entire domain
Get detailed instructions on how to resolve every accessibility issue on your website

An HTML5 video element must include a track element with kind=”captions”. Captions should convey all meaningful audio, including dialogue, musical cues, and sound effects.

Why It Matters

If a video doesn’t have captions, deaf users have limited or no access to the details within it.

Fixing the Issue

Developers should ensure that all video elements have a caption using the track element with a caption attribute. 

Captions shouldn’t only include dialogue, but also identify who is speaking and include non-speech information where relevant.

Good Code Example

The following code shows how to add two different tracks – one in English and one in Spanish:

Code example
<video width="300" height="200"> <source src="myVideo.mp4" type="video/mp4"> <track src="captions_en.vtt" kind="captions" srclang="en" label="english_captions"> <track src="captions_es.vtt" kind="captions" srclang="es" label="spanish_captions"> </video> Copy

Test Cases

For more examples, visit W3C’s GitHub’s ATC Rules library