Images that add meaning to a page are required to have some form of text alternative. Let's look at the two text alternatives we want to discuss:
Captions are text about an image that are usually visible on the page. These can be placed inside a
Alternative text is an attribute on an image. In most cases it is invisible, but can appear if the image does not load correctly. It is also helpful for users of assistive technology. Here's an example of alt text in an <img> tag:
<img src="frog.png" alt="Frog on a lily pad">
Since captions and alt text both act as text alternatives for images, only one of the two are necessary. If the caption contains all the relevant visual information, then alt text isn't helpful. It is best practice to always include alt text, since it is more widely used and accepted.