How to write alt text for your pictures
- Add the pictures. Drop them anywhere on the page, paste one, or click the box and choose files. JPEG, PNG, WebP and iPhone HEIC photos work.
- Press the button. The first time, the page downloads the caption model (see below). Every picture then gets a short description. Short is selected, and Detailed and Very detailed are there if you need a longer description.
- Edit each suggestion. This step matters most. The text box is editable, and the next section explains what to check.
- Copy it with the Copy button under each picture, or Download as CSV to get one spreadsheet with the file name and the text for every picture.
What good alt text looks like
Alt text is the text a screen reader reads out in place of a picture, and the text a browser shows when the picture cannot load. Search engines read it too: Google says it uses alt text, together with what it can see in the picture and the text of the page, to understand a picture's subject. Three pieces of published advice are worth keeping in mind.
- Describe the picture's job on this page, briefly. The W3C's tutorial on images says the text should be the most concise description possible of the image's purpose, and that if more than a short phrase or sentence is needed, a longer description belongs elsewhere on the page.
- Leave out "image of" and "picture of". The W3C says there is usually no need to include words like "image", "icon" or "picture", because screen readers already announce an image. That is why this page takes openings like "The image shows" off the caption, and why you should check that none was left.
- Do not stuff keywords. Google's guidance is to avoid filling alt attributes with keywords, because it makes for a bad experience and can make a site look like spam. Its example of "good" is "Dalmatian puppy playing fetch": specific, short, no extras.
What the generator cannot know
The model looks at a picture and says what is in it. It does not know why the picture is on your page, and that decides what the alt text should say. The W3C's tutorial sorts pictures by purpose, and the right text is different for each:
| The picture is | What to do with the suggestion |
|---|---|
| Information the reader needs (a product photo, a portrait in an article) | Keep it short, then add what matters on your page: the product name, the person's name, the colour or model. |
| Decoration only (a divider, a background texture) | Do not use the suggestion. The W3C says to give a decorative image an empty alt, alt="", so that screen readers skip it. |
| A link or a button | Describe where it goes or what it does, not what it looks like. |
| A picture of text (a banner, a screenshot of a quote) | Type the words that are in the picture. The model does not read text reliably: Image to Text does. |
| A chart or diagram | Say what it shows in a sentence and put the data in the page text. A generator cannot read a chart. |
How good are the suggestions?
We tried eight pictures and checked each caption against its picture. The short caption named the main subject correctly in all eight, and was between 8 and 11 words long: "A cat sitting on top of a stone wall", "A hamburger with lettuce on a black background". It was not always right in the small things: one called latte art a "baseball design", and one called a mossy rock a "log". The detailed captions went further and, in four of the eight, added something that is not in the picture, such as a fence where there were bare branches. So use the Short length for alt text, and read it against the picture every time.
Using the CSV
The CSV has two columns, file and caption, with a header row, and opens in any spreadsheet. Use it to review the whole set in one place, hand it to an editor, or match the text to your images by file name when you import it into a CMS or a shop. Your own edits are in the file, so edit first.
Speed and the model
The text comes from Florence-2 base, a model from Microsoft with an MIT license, running in this tab. The first time, your browser downloads it (about 343 MB if it can use your graphics chip, about 265 MB if it uses the processor) and keeps it. After that, a picture takes about 2 to 3 seconds on the graphics chip and about 20 seconds on the processor, measured on an Apple M1 Max laptop that was busy with other work. The page says which one it is using before you start. It is English only, it works best on a computer, and we have not tested phones. The image caption generator has the details, and also the option of text to put at the start of each caption.
Privacy
The text is made in this tab. For what the site collects, see our privacy policy.
Frequently asked questions
What is alt text?
It is the text in an image's alt attribute. Screen readers read it aloud for people who cannot see the picture, and browsers show it if the picture does not load. Search engines also use it to understand what a picture is about.
How long should alt text be?
As short as it can be while still giving the picture's purpose: a short phrase or one sentence. The W3C advises moving anything longer into a separate description on the page. The short captions from this page were between 8 and 11 words in our test.
Does every image need alt text?
Every image needs an alt attribute, but a purely decorative one should have an empty one, alt="", so that screen readers skip it. The W3C explains this in its images tutorial. Do not paste a generated description onto decoration.
Can I use the generated text without editing it?
We would not. The model does not know why the picture is on your page, and in our test it gave a wrong detail now and then. Read each one against its picture, and add the names and facts that only you know.
Does alt text help SEO?
Google says it uses alt text, along with the picture itself and the page around it, to understand an image, and that it works as anchor text when the image is a link. It also warns against filling alt text with keywords.