01What is ARIA Label Generator?
Most accessible-name bugs are not hard to fix. The tricky part is remembering which pattern fits which element. An icon button wants aria-label, an image wants alt, and a form field wants a real <label>. This tool puts the right patterns for one element type side by side, filled in with your own words, so you can pick one and paste it. You choose one of five element types: Button, Link, Image, Form Field or Navigation. Then you type what the element does or shows into Purpose / Action, such as Close dialog or Email address. The tool drops that text into two or three fixed HTML templates for the type, each with a one-line explanation. A Best Practices list for the type sits above the snippets. The patterns follow WAI-ARIA 1.2 and WCAG 2.x. Buttons get an icon-only version with aria-label, a plain version with visible text, and a version that adds aria-describedby pointing at hidden help text. Links get a preferred version with descriptive visible text and a "Read more" version that adds visually hidden context. That second one keeps the accessible name starting with the visible words, which is what WCAG 2.5.3 Label in Name asks for. Images get informative alt text, an empty alt for decoration, and a figure with a caption. Form fields get a label tied by for and id with the native required attribute, an aria-label fallback, and an aria-labelledby plus aria-describedby pair. Navigation gets a labelled nav with aria-current="page", and a nav named by its own heading. A quick example. Pick Form Field and type Email address. The first snippet is <label for="field1">Email address</label> followed by <input id="field1" type="text" required />. The third adds <p id="help1">Enter your email address</p> as the description. Your text is trimmed and HTML-escaped before it goes in, so a quote or angle bracket can't break an attribute. The generation happens in the page itself, and your text is never posted to a server. Now the limits. The tool doesn't inspect your page, and it won't choose an attribute for you. The templates are fixed, so ids such as field1 and help1, file names like image.jpg, and type="text" are placeholders you must change. The help sentences in the button and form field patterns are generic, so rewrite them to say something useful before shipping.
Front-end developers fixing accessible-name issues from an audit who want the correct pattern for one element without rereading the spec. The tool runs entirely in your browser, so your data never leaves your device.
02How to use ARIA Label Generator
- Pick an Element Type: Button, Link, Image, Form Field or Navigation.
- Type the element's purpose in Purpose / Action, for example Delete item or Footer links.
- Read the Best Practices list for that element type.
- Compare the generated snippets and the one-line explanation under each.
- Click Copy on the pattern you want, then rename the placeholder ids, src and href values in your own code.
- Use Reset to clear the text and return to Button.
03Worked examples
- Input:
Element Type: Button; Purpose / Action: Close dialog - Result:
<button aria-label="Close dialog"> <svg><!-- icon --></svg> </button> <button>Close dialog</button> - First two of three patterns. The third adds aria-describedby="btn-help" and a hidden <p> with extra description.
- Input:
Element Type: Link; Purpose / Action: Read the "Pricing" guide - Result:
<a href="/page">Read more<span class="sr-only">: Read the "Pricing" guide</span></a> <a href="/page">Read the "Pricing" guide</a> - Quotes are escaped as ". The first pattern keeps Read more visible so the name still begins with the visible words.
- Input:
Element Type: Image; Purpose / Action: Bar chart of Q3 sign-ups - Result:
<img src="image.jpg" alt="Bar chart of Q3 sign-ups" /> <img src="decorative.jpg" alt="" /> - The third pattern wraps the same img in a figure with an empty figcaption for credit or date.
- Input:
Element Type: Form Field; Purpose / Action: Email address - Result:
<span id="label1">Email address</span> <input type="text" aria-labelledby="label1" aria-describedby="help1" /> <p id="help1">Enter your email address</p> - Third of three patterns. Change type="text" to type="email" in real code.
- Input:
Element Type: Navigation; Purpose / Action: Footer links - Result:
<nav aria-label="Footer links"> <ul> <li><a href="/" aria-current="page">Home</a></li> <li><a href="/about">About</a></li> </ul> </nav> - The second pattern names the nav with aria-labelledby pointing at an <h2>.
- Input:
Element Type: Button; Purpose / Action: Download PDF - Result:
<p id="btn-help" class="sr-only">Additional description for download PDF</p> - Trimmed to the help line of the third pattern. Only a capitalised first word is lowercased, so acronyms like PDF stay as typed.
04Common use cases
- Adding accessible names to a toolbar of icon-only buttons (bold, italic, delete) in a rich text editor
- Fixing vague Read more links on a blog index after an audit flags WCAG 2.4.4 Link Purpose
- Labelling a main nav and a footer nav so screen reader users can tell the two landmarks apart
- Writing alt text for a chart and deciding whether a hero image should get an empty alt instead
- Wiring a password field to its rules text with aria-describedby during a sign-up form rebuild
- Showing a junior developer how alt, aria-label, aria-labelledby and aria-describedby differ, using the same words in each
05Tips
- Prefer visible text over aria-label. aria-label replaces the visible text as the name, and voice-control users say what they see.
- Don't add the word button or link to your purpose text. Screen readers announce the role already, so you'd hear it twice.
- aria-describedby adds a description after the name. Use it for password rules or error text, not as a second label.
- Every snippet reuses the same ids (field1, help1, btn-help, nav-heading). Make them unique if you use a pattern twice on one page.
- The sr-only class in the Read more and button patterns is not built into browsers. Your CSS needs a visually-hidden rule with that name.
06Related concepts
WAI-ARIA, Accessible name computation, WCAG 2.5.3 Label in Name, Screen reader, Alt text, Landmarks.
Frequently Asked Questions
What is ARIA Label Generator?
ARIA Label Generator is a free, browser-based developer tool on AIDToolStack. Generate proper ARIA labels for HTML elements to improve screen reader support. It requires no installation or sign-up and works entirely in your browser.
Is ARIA Label Generator free to use?
Yes. No sign-up, no fees and no usage cap.
Does ARIA Label Generator store my data?
No. It runs in your browser; nothing is uploaded.