Search engines cannot see what is in a picture the way you can. Image SEO is about giving them enough context to understand your images, and making sure those images do not make the page slow enough to hurt everything else.
The alt attribute describes an image in words. It is read aloud by screen readers, displayed if the image fails to load, and used by search engines to understand image content.
<!-- Useless -->
<img src="img1.jpg" alt="image">
<img src="img1.jpg" alt="laptop laptop buy laptop cheap laptop">
<!-- Useful -->
<img src="thin-laptop-desk.jpg" alt="A thin silver laptop open on a wooden desk beside a notebook">Write what you would say if you were describing the image to someone who cannot see it. Be specific and factual. Do not stuff keywords — it is the clearest possible signal of manipulation, and it makes the page actively hostile to screen reader users.
Decorative images
One exception worth knowing: purely decorative images that add no information should have an empty alt — alt="". This tells screen readers to skip them entirely. Omitting the attribute is not the same thing; some screen readers then read out the filename instead.
The filename is a small but free signal. DSC_0042.jpg says nothing; thin-silver-laptop-on-desk.jpg describes the content. Use lowercase, hyphens between words, and describe what is actually pictured.
Images are usually the largest thing on a page by size, which makes them the most common cause of slow loading — and page speed is covered as a ranking consideration later in this course.
Always set width and height attributes. Without them the browser does not know how much space to reserve, so the page reflows when each image loads — content jumps around while someone is trying to read it. That behaviour is measured directly as a page experience signal.
<img src="laptop.webp" alt="A thin silver laptop on a desk" width="1200" height="800" loading="lazy">loading="lazy" tells the browser to hold off downloading an image until it is about to come into view. On a page with many images below the fold, this makes a substantial difference to how fast the visible part appears.
One caveat: do not lazy-load images that are visible immediately when the page opens. Deferring the main image at the top of the page delays exactly the thing you want to appear fastest.