Alt text (alternative text), also known as "alt attributes", “alt descriptions,” and colloquially but technically incorrectly as "alt tags,” are used within an HTML code to describe the appearance and function of an image on a page.
Alt text uses:
1. Adding alternative text to photos is first and foremost a principle of web accessibility. Visually impaired users using screen readers will be read an alt attribute to better understand an on-page image.
2. Alt tags will be displayed in place of an image if an image file cannot be loaded.
3. Alt tags provide better image context/descriptions to search engine crawlers, helping them to index an image properly.
Optimal format
The best format for alt text is sufficiently descriptive, but doesn't contain any spammy attempts at keyword stuffing. If you can close your eyes, have someone read the alt text to you, and imagine a reasonably accurate version of the image, you're on the right track.
Why is alt text important?
1. Accessibility
Alt text is a tenet of accessible web design. Its original (and still primary) purpose is to describe images to visitors who are unable to see them. This includes screen readers and browsers that block images, but it also includes users who are sight-impaired or otherwise unable to visually identify an image. Including alt text with your images ensures all users, regardless of visual ability, can appreciate the content on your site.
2. Image SEO
Using alt text on your images can make for a better user experience, but it may also help earn you both explicit and implicit SEO benefits. Along with implementing image title and file naming best practices, including alt text may also contribute to image SEO.
While search engine image recognition technology has vastly improved over the years, search crawlers still can't "see" the images on a website page like we can, so it's not wise to leave the interpretation solely in their hands. If they don't understand, or get it wrong, it's possible you could either rank for unintended keywords or miss out on ranking altogether.
Source: Moz