AI Image Caption Generator - Alt Text From a Photo

A vision-language model looks at your image and writes a short description of what it contains, ready to edit into alt text. The model downloads once and then runs entirely on your device.

Alt text, and what an automatic caption is good for

Alt text is the written description a screen reader announces in place of an image. It is what makes a page usable for people who cannot see the picture, it is a formal requirement under accessibility standards such as WCAG, and it doubles as the main signal search engines have for understanding image content. It is also the thing most often skipped, because writing a description for every image on a site is tedious work.

This tool runs Xenova's ViT-GPT2 image captioning model directly in your browser through Transformers.js. A vision transformer encodes what is in the picture and a language model turns that representation into a sentence. The result is a literal description of the visible content, along the lines of what the image plainly depicts.

Treated as a first draft, that is genuinely useful. Facing a folder of product shots, blog images or gallery photos, generating a caption for each and then editing gives you a complete set of alt text in a fraction of the time that writing from scratch takes. The editing pass is where the value gets added: good alt text reflects why the image is on the page, names specific people, products or places the model cannot know, and stays concise.

The unusual part is that the model runs locally. Most captioning services send your image to an API, which for unreleased product photography, client work or personal pictures means handing the file to a third party. Here the weights download once, cache in your browser, and then work offline with no per-image cost or quota.

How to generate a caption

  1. Upload an image. Clear, well-lit photos with an obvious subject produce the most useful descriptions.
  2. Wait for the model on first use. The weights download once, then stay cached for subsequent images.
  3. Generate the caption. A short description of the visible content appears.
  4. Edit it into real alt text. Add the specifics the model cannot know, such as names, product models and place names, and trim it to the point.

Two conventions worth applying when you edit. Do not begin with "image of" or "photo of", screen readers already announce that it is an image. And if a picture is purely decorative and adds nothing to the content, the correct alt text is an empty attribute, so a screen reader skips it rather than reading a description nobody needs.

Frequently asked questions

What is alt text for?

It is the description a screen reader announces in place of an image, making the page usable for people who cannot see it. It is required under accessibility standards like WCAG and is also the main signal search engines use to understand image content.

Which model does this use?

Xenova's ViT-GPT2 image captioning model, run through Transformers.js. A vision transformer encodes the image and a language model turns that into a sentence.

Should I use the caption exactly as generated?

Treat it as a first draft. It describes what is visible, but good alt text also reflects why the image is on the page and names the specific people, products or places the model has no way of knowing.

Should alt text start with "image of"?

No. Screen readers already announce that the element is an image, so that prefix just adds noise. Describe the content directly.

What about purely decorative images?

Give them an empty alt attribute. That tells a screen reader to skip the image rather than reading out a description that adds nothing.

Are my images uploaded?

No. The model weights download once and then run on your device, so unreleased product photography and client work stay local. There is no per-image cost or quota.

🔎 Verify it yourself: nothing uploads

Don’t take our word for it. Open your browser’s DevTools (F12 → Network tab), then run this tool on any image. The only download you’ll see is the open-source AI model coming to your browser — your image itself is never sent anywhere. Every tool on this site works the same way — all processing happens on your device.