[{"data":1,"prerenderedAt":227,"buildId":228},["ShallowReactive",2],{"page-\u002Flearn\u002Falt-text-best-practices":3},{"id":4,"title":5,"body":6,"description":209,"extension":210,"how_to_steps":211,"hub":190,"meta":212,"navigation":213,"path":214,"primary_keyword":215,"published_at":216,"schema_types":217,"seo":221,"status":222,"stem":223,"updated_at":224,"wave":225,"__hash__":226},"pages\u002Flearn\u002Falt-text-best-practices.md","Alt Text Best Practices: Write It Right the First Time",{"type":7,"value":8,"toc":193},"minimark",[9,25,30,52,55,58,62,67,70,80,83,87,90,96,99,103,106,110,113,117,127,133,142,146,149,152,155,159,162,166],[10,11,12,13,17,18,21,22,24],"p",{},"These alt text best practices start with one question: what would someone miss if they could not see the image?\nUse the ",[14,15,16],"code",{},"alt"," attribute to give them the same useful fact or action in words.\nIf the image adds nothing to the nearby text and does not act as a control, use ",[14,19,20],{},"alt=\"\"",".\nFor a chart or a diagram, give the short version in ",[14,23,16],{}," and put the details where everyone can read them.",[26,27,29],"h2",{"id":28},"the-decision-tree","The decision tree",[31,32,33,37,40,46],"ol",{},[34,35,36],"li",{},"Does the image act as the only label for a link or button? Name the place it takes the reader or the action it performs.",[34,38,39],{},"Does it tell the reader something they need to know? Give the useful detail in a short phrase or sentence.",[34,41,42,43,45],{},"Is there too much to say in a short phrase? State the point in ",[14,44,16],{}," and provide the rest in nearby text or a data table.",[34,47,48,49,51],{},"Does it add no information or repeat text that is already next to it? Use ",[14,50,20],{}," so a screen reader can skip it.",[10,53,54],{},"Ask the question on the page where the image appears.\nA photo of a bike can have a different job in two places.\nOn a repair guide, a close view of a tire may be there to show a tear along the rim.\nOn a page about opening hours, the same photo may be there to fill space next to text that already names the repair service.\nThe first use calls for a note about the tear.\nThe second may need no words at all.",[10,56,57],{},"Try reading the paragraph with your alt text in place of the picture.\nIf the phrase breaks the flow or repeats what you just read, change it.\nIf the reader still has to see the picture to know what to do next, put the missing step in the page text.\nThat is important for instructions such as where to enter a building or which part to remove from a tool.",[26,59,61],{"id":60},"examples-by-image-type","Examples by image type",[63,64,66],"h3",{"id":65},"a-photo-that-shows-a-useful-detail","A photo that shows a useful detail",[10,68,69],{},"A repair page uses a close-up to show which mark means a brake pad needs to be changed.\n\"Brake pad\" is true but leaves out the point of the photo.\n\"Brake pad worn down to the marked line\" tells the reader what to look for.\nIf it matters where the line is, spell that out in the guide so the repair does not depend on a photo alone.",[71,72,78],"pre",{"className":73,"code":75,"language":76,"meta":77},[74],"language-html","\u003Cimg src=\"brake-pad.jpg\"\n     alt=\"Brake pad worn down to the marked line\">\n","html","",[14,79,75],{"__ignoreMap":77},[10,81,82],{},"The best words may change if the photo is used again in a news story.\nIf the story is about a workshop, the reader may need to know that a volunteer is showing someone how to check a brake pad.\nOnly describe what is visible or known from the story.\nDo not guess a person's name, age, or mood from how they look.",[63,84,86],{"id":85},"a-linked-image-with-no-other-label","A linked image with no other label",[10,88,89],{},"When the only thing inside a link is the club logo, name the link's destination.\n\"Repair cafe home\" makes sense in a list of links.\n\"Blue wrench\" tells someone how the logo looks but gives them no clear reason to follow it.\nIf the same link also contains visible text that says \"Repair cafe home,\" the logo can have empty alt so the link is read once.",[71,91,94],{"className":92,"code":93,"language":76,"meta":77},[74],"\u003Ca href=\"home.html\">\n  \u003Cimg src=\"logo.svg\" alt=\"Repair cafe home\">\n\u003C\u002Fa>\n",[14,95,93],{"__ignoreMap":77},[10,97,98],{},"Use the same rule for a button with a small image.\nIf its job is to print the guide, \"Print guide\" is a useful name.\n\"Printer icon\" describes the shape but leaves the reader to work out the action.\nFor a button that already has the words \"Print guide,\" use those words as its label and keep any extra icon out of the spoken name.",[63,100,102],{"id":101},"a-chart-with-more-than-one-finding","A chart with more than one finding",[10,104,105],{},"For a line chart of repair visits, try alt text like \"Repair cafe visits rose from April to July.\"\nPut the monthly totals in a nearby table with clear column headings if the reader needs the exact values.\nName the unit and the time span in text, and explain any gap where figures are missing.\nA reader who cannot see the chart should still be able to use the figures to answer the same questions.\nIf the surrounding text already gives the finding and the chart adds a detail worth noting, use the alt text to tell the reader what the chart is for and where to find its data.",[63,107,109],{"id":108},"an-image-that-contains-words","An image that contains words",[10,111,112],{},"Use real text for notices and instructions whenever possible.\nIt can wrap on a phone and still be read when someone zooms in.\nIf the source has to stay an image, such as a photo of a dated flyer, put the useful facts in the page: the event, the time, and where people should go.\nIf you include all those words next to the image, the alt text does not need to repeat the flyer word for word.",[26,114,116],{"id":115},"when-alt-should-be-empty","When alt should be empty",[10,118,119,120,122,123,126],{},"Use ",[14,121,20],{}," for a decorative ",[14,124,125],{},"img"," such as a divider between two sections.\nGive an unnamed photo the same treatment only after you check that a reader would lose nothing by skipping it.\nA photo that shows which entrance has a ramp is useful even if it is next to an address.\nA stock photo of a wrench next to the words \"Tool list\" may add nothing.",[71,128,131],{"className":129,"code":130,"language":76,"meta":77},[74],"\u003Cimg src=\"divider.svg\" alt=\"\">\n",[14,132,130],{"__ignoreMap":77},[10,134,135,136,138,139,141],{},"Leaving ",[14,137,16],{}," out is different from giving it an empty value.\nWithout ",[14,140,16],{},", a screen reader may announce the image and read a filename or part of its address.\nWith empty alt on a plain decorative image, the browser can leave it out of what the screen reader needs to announce.\nDo not use empty alt on the only image in a link unless the link gets its name from somewhere else.\nCheck the link the way a user would: can you tell where it goes without seeing the picture?",[26,143,145],{"id":144},"the-mistakes-we-see-most","The mistakes we see most",[10,147,148],{},"Avoid using a filename as a description.\n\"IMG 0442\" means little to someone who did not take the photo.\nAvoid copying the same words to every image in a list of parts.\nIf the photos are needed to tell the parts apart, describe the difference, such as the long handle or the red safety latch.\nIf sight is not needed to tell them apart, name the parts in text so no one needs to infer their names from a photo.",[10,150,151],{},"In most cases skip \"image of\" at the start, since screen readers often announce that an item is an image already.\nKeep the medium when it matters: \"Map of the bus stops near the cafe\" is more useful than \"Streets near the cafe.\"\nUse the text a reader needs rather than squeezing in search terms or aiming for a fixed number of letters.\nIf removing a phrase does not change what the reader learns, leave it out.",[10,153,154],{},"When an AI tool suggests alt text, compare each claim with the picture and the text around it.\nThe tool may name an object that is not there or miss the feature that explains a step in your guide.\nCheck what the browser exposes for the image and for any link around it.\nThen listen to the paragraph with a screen reader to catch repeated words that are hard to notice in the code.",[63,156,158],{"id":157},"is-there-a-fixed-length-for-alt-text","Is there a fixed length for alt text?",[10,160,161],{},"No.\nUse the shortest text that does the job, and give long explanations in the page itself.\nFor a link or button, start with a short label that names where it goes or what it does.",[26,163,165],{"id":164},"the-alt-text-debates-2007-2009","The alt-text debates, 2007-2009",[10,167,168,169,174,175,179,180,184,185,187,188,192],{},"The proposal ",[170,171,173],"a",{"href":172},"\u002Fwiki\u002Findex.php\u002FOpen_Issues\u002Falt","from the 2007-2009 archive"," records a suggested change to the image section of the HTML5 draft.\nIn ",[170,176,178],{"href":177},"\u002Fpipermail\u002Flist_html4all.org\u002F2007-August\u002F000084.html","the original mailing list discussion",", contributors explored whether the browser could request a different version of an image or its content instead of relying on alt text and other fallbacks.\nRead both as part of the debate at the time, not as current browser instructions.\nFor a modern check, write one phrase that replaces the image's purpose, then read the page without the image and see whether the same task is still possible.\nAfter writing your text alternatives, ",[170,181,183],{"href":182},"\u002Flearn\u002Fhtml-validator","validate your HTML"," to catch a missing ",[14,186,16],{}," attribute or a mistake in the surrounding markup.\nFind more markup exercises in the ",[170,189,191],{"href":190},"\u002Flearn","Learn HTML hub",".",{"title":77,"searchDepth":194,"depth":194,"links":195},2,[196,197,204,205,208],{"id":28,"depth":194,"text":29},{"id":60,"depth":194,"text":61,"children":198},[199,201,202,203],{"id":65,"depth":200,"text":66},3,{"id":85,"depth":200,"text":86},{"id":101,"depth":200,"text":102},{"id":108,"depth":200,"text":109},{"id":115,"depth":194,"text":116},{"id":144,"depth":194,"text":145,"children":206},[207],{"id":157,"depth":200,"text":158},{"id":164,"depth":194,"text":165},"How to write alt text that helps users and search engines: decision rules, examples, common mistakes, and the empty-alt exception.","md",null,{},true,"\u002Flearn\u002Falt-text-best-practices","alt text best practices","2026-12-01T04:29:57Z",[218,219,220],"Article","BreadcrumbList","FAQPage",{"title":5,"description":209},"draft","learn\u002Falt-text-best-practices","2026-12-01T05:35:41Z","0","Y2JY0qORnzktPVl41kqrf-m1BexRShHRxbMm_Es72qs",1796185435704,"a1d53563-3a78-4678-8315-e5bd6a5bd80c"]