Step by Step

The required field asterisk: what screen readers say, and the HTML to write

10 min read
Mikhail ShaymardanovWeb Quality and Accessibility Expert

With the screen reader NVDA on its default settings, a blind visitor hears “star” on every required field whose label carries an asterisk. The symbol can go quiet with nothing lost: the required attribute on the field already makes NVDA say “required”. Hidden with aria-hidden and explained in a sentence above the form, the asterisk stays on screen and drops out of the audio.

Keep the asterisk, silence it


#Do screen readers read the asterisk on a required field?

On its default settings, NVDA, a free screen reader for Windows, says “star” when a field's label contains an asterisk. The word “required” comes from the required attribute.

The asterisk tells people, before they start typing, which fields they must fill out. The WCAG, the W3C's accessibility guidelines, explain that marking these fields up front helps people avoid sending an incomplete form. Their technique H90 accepts the symbol if its meaning is explained before its first use. In Europe, the accessibility standard EN 301 549 requires every web page to meet the criterion that covers this, Labels or Instructions. It was written as one voluntary way to comply with the European Accessibility Act.

We still recommend the word “required” in the label, as in our guide to accessible forms. An asterisk with an explanation is the accepted minimum. The same technique notes that the asterisk can be hard to see for people with low vision. When you tab to a well-built required field, the screen reader first announces three things:

  • its accessible name, the name the screen reader reads, taken from the <label>, asterisk included;
  • its role, “edit” for a text field;
  • its “required” state, taken from required.

Clearvale Joinery, our demo workshop, builds custom staircases and wardrobes. On its “Request a quote” page, four of the five fields carry required and a red asterisk, written as text inside the <label>.

Screenshot: the “Request a quote” page of Clearvale Joinery. On the left, the heading, an introductory sentence and five fields, Name, Email address, Phone, Job site postal code and Your project, each followed by a red asterisk except Phone, then the Send my request button with the note “* Required fields” in small type below it; on the right, a photo of an oak staircase and a sienna panel reading “5 days”.Marker 1. The red asterisk of the Name label. Marker 2. The red asterisk of the Email address label. Marker 3. The red asterisk of the Job site postal code label. Marker 4. The red asterisk of the Your project label. Marker 5. The note “* Required fields”, under the Send my request button.
On Clearvale Joinery's quote page, four labels end in a red asteriskmarker 1marker 2marker 3marker 4, and the only sentence that explains itmarker 5 comes under the submit button.

In Firefox, we found the name “Name *” in the accessibility tree, the version of the page that screen readers receive. Going by NVDA's own files, the listener should therefore hear “Name star”, “edit”, then “required”. That's four “star”s across the form, each repeating the “required” after it.

Firefox also reports these empty fields as invalid, so NVDA should add “invalid entry”. It's a browser bug, reported to Mozilla, and no reason to drop required. To listen for yourself, install NVDA and check its punctuation level, which sets how many symbols it speaks. NVDA+P cycles through the levels and names each one. The default is “some”.

#Should you hide the asterisk from screen readers?

Yes, as long as the field has required. Inside a <span aria-hidden="true">, the asterisk drops out of the field's name, and the “required” state stays. WAI-ARIA, the specification behind the aria-* attributes, lets authors hide visible content that is redundant, provided equivalent information still reaches assistive technologies: here, required.

Voice control users lose nothing either, since punctuation is generally ignored when someone speaks a field's name. On the fixed page, Firefox and Chrome give the name “Name”, still required, and the red asterisk stays on screen.

Screenshot: the “Name” label followed by a red asterisk, above an empty text field with a black border, on an ivory background.Marker 1. The red asterisk of the “Name” label.
The “Name” field keeps the same red asteriskmarker 1 in both versions; only the name the screen reader receives changes, “Name *” or “Name”.

Avoid

<label for="name">Name <span class="asterisk">*</span></label>
<input id="name" type="text" autocomplete="name" required>

Correct

<label for="name">Name <span class="asterisk" aria-hidden="true">*</span></label>
<input id="name" type="text" autocomplete="name" required>
NVDA screen reader: how to install it, set it up and test a web page

#How do you code a required field asterisk in HTML?

In HTML, the required attribute makes a field required: the browser won't send the form while the field is empty, and NVDA says “required”. The asterisk does neither, and three common variations of this code raise questions.

#Does a screen reader read an asterisk added with CSS?

Yes: the accessible name specification brings text added in CSS with ::before and ::after into a field's name, including when that name comes from the <label>. On a version of our demo where a .required class adds the asterisk, Chrome and Firefox name the field “Email address *”, and NVDA should say “star”.

The fix takes one slash: content: " *" / "";. The text after the slash replaces the symbol in speech output, and an empty string silences it. We saw the asterisk drop out of the name in both browsers. Firefox has supported the slash since version 128, Safari since 17.4. An older browser ignores the whole line and stops showing the asterisk, unless content: " *"; comes before it. The HTML stays as it is, which suits a design system that adds the asterisk through a class.

Screenshot: the “Email address” label followed by a red asterisk, above an empty text field with a black border.Marker 1. The red asterisk added in CSS after “Email address”.
The “Email address” field shows the same red asteriskmarker 1 with both CSS rules; the slash only removes it from the name the screen reader receives.

Avoid

/* <label for="email" class="required">Email address</label> */
.required::after {
  content: " *";
  color: #b3261e;
}

Correct

/* <label for="email" class="required">Email address</label> */
.required::after {
  content: " *" / "";
  color: #b3261e;
}

#Do you need aria-required as well as required?

No: the W3C advises against aria-required="true" on a field that already has required. The browser then goes by required alone. On our page that has both, Chrome and Firefox describe the “Name” field exactly as on the original page, so NVDA should say “required” once. The aria-required attribute keeps its place on a component that can't take required, such as a custom dropdown list built with the listbox role.

#What does a screen reader get if you hide the asterisk without required?

Nothing tells the screen reader the field is required anymore: its only mark, the asterisk, is hidden from it. On another version of the demo, the <span aria-hidden="true"> was copied like a recipe, without required. The “Job site postal code” field keeps its red asterisk, but Chrome and Firefox describe it as an ordinary field: NVDA should say its name and “edit”, with no “required”.

The automated checker axe-core 4.14 finds no violation on this page. WAI-ARIA, however, only lets you hide visible content when equivalent information still reaches assistive technologies. On the original page, the spoken asterisk repeated required. On a field without required, it would be the only audible sign that the field is required. Hiding the symbol and adding required therefore go together, on every marked field.

Screenshot: the “Job site postal code” label followed by a red asterisk, above an empty text field with a black border.Marker 1. The red asterisk of the “Job site postal code” label, hidden from screen readers.
The “Job site postal code” field shows the same red asteriskmarker 1 in both versions: only the required attribute decides whether the screen reader says “required”.

Avoid

<label for="postcode">Job site postal code <span class="asterisk" aria-hidden="true">*</span></label>
<input id="postcode" type="text" autocomplete="postal-code">

Correct

<label for="postcode">Job site postal code <span class="asterisk" aria-hidden="true">*</span></label>
<input id="postcode" type="text" autocomplete="postal-code" required>
The aria-hidden attribute: when to use it, and what to do when Tab reaches what it hides

#Where should the asterisk and its explanation go?

The asterisk goes inside the field's <label>, before or after the text, and the sentence that explains it goes before the <form> element. WCAG technique H90 ties the mark to the field through its label, or through the legend of a group of fields. Its test looks for the mark there. An asterisk set beside the field, with nothing linking the two, doesn't count.

People with low vision need to see it too. The W3C lists “required fields are red” among its examples of information conveyed by color, and color alone isn't enough. The code example in technique H90 enlarges the asterisk to 150%. The Nielsen Norman Group, a US user experience research firm, also warns against a pale gray or low-contrast asterisk.

#Should the asterisk go before or after the label?

Either works: the Nielsen Norman Group finds the difference unlikely to matter in practice. Placed before the text and in color, the asterisk is a little easier to spot along the left edge of the labels, which can help in a long form. Left audible, it would start the field's name, and NVDA would say “star” before “Name”. Hidden, it follows the design without changing what people hear.

#Where does the “required fields are marked with an asterisk” sentence go?

Before the <form> element, both on screen and in the code. Technique H90 asks for the explanation before the first field that uses the symbol. Inside a <form>, screen readers often switch to forms mode, where they only read the fields and their labels. That's why the W3C tutorial puts these instructions before the tag. One line is enough: “Fields marked with an asterisk (*) are required.”

Placed under the button, as at Clearvale Joinery, the sentence comes after all four asterisks. The fix is visible on screen: the sentence moves above the first field, with the symbol in parentheses so the eye makes the connection.

Avoid

Screenshot: the bottom of the quote form, the Job site postal code and Your project fields, the black Send my request button, then the note “* Required fields” in small type below it.Marker 1. The note “* Required fields”, under the submit button.
<form action="/quote" method="post">
  <!-- the five fields -->
  <button type="submit">Send my request</button>
  <p><span class="asterisk">*</span> Required fields</p>
</form>

Correct

Screenshot: the top of the fixed form, the heading “Request a quote”, the introductory sentence, then “Fields marked with an asterisk (*) are required.” above the Name and Email address fields.Marker 1. The sentence “Fields marked with an asterisk (*) are required.”, before the first field.
<p>Fields marked with an asterisk (<span class="asterisk">*</span>) are required.</p>
<form action="/quote" method="post">
  <label for="name">Name <span class="asterisk" aria-hidden="true">*</span></label>
  <input id="name" type="text" autocomplete="name" required>
  <!-- the other fields, coded the same way -->
  <button type="submit">Send my request</button>
</form>
Before, the explanationmarker 1 comes under the “Send my request” button, after the asterisks of the fields; after, the sentencemarker 1 comes before the “Name” field, on screen as in the code.

On the fixed page, as you press Tab from “Name” to “Your project”, NVDA should say “required” four times and never “star”, going by its files and Firefox's accessibility tree. The HTML of the two pages differs by six lines: four aria-hidden attributes, the note removed from under the button and the sentence written before the form. On screen, only that sentence has moved, and the four red asterisks stay.

Click the demo, then press the key shown, or move on with “Next step”. Escape leaves the demo.
5 steps

On Clearvale Joinery's fixed page, NVDA should say “required” on the four marked fields and never say “star”; “Phone”, which is optional, gets neither.
Accessible forms in HTML: required fields, error messages and validation

On a live page, the Includdy scan and its manual guides for forms find required fields whose mark is missing, on screen or in the code. Its guided fix then suggests corrected HTML, generated by its AI, for you to review before it goes into your code.


Share this article

Frequently asked questions

It isn't essential when every required field carries its own mark. The Nielsen Norman Group, a US user experience research firm, notes that labeling optional fields still lightens the mental load of the person filling out the form. It adds that marking only the optional fields makes the form harder to fill out.

Design systems split on this. The US Web Design System puts a red asterisk on required fields and “(optional)” on the others. The British government's design system adds “(optional)” to optional labels and never marks a required field with an asterisk. Whichever you pick, keep required on each required field: that attribute is what makes the screen reader say “required”.

Yes, each field keeps its mark, except in a form with a single field. The Nielsen Norman Group, a US user experience research firm, says to mark every required field, even when most of the form is required. It lets a login form go without, and a sign-up form that asks only for a username and a password. The US Web Design System exempts one-field forms.

The test of WCAG technique H90 also looks for the indicator in the label or legend of each required field. The sentence that explains the asterisk still goes before the form.

Yes: a word needs no explanation, and nobody has a symbol to decode. The W3C's Easy Checks page on required fields, still a draft, calls the word in the label the best way to mark a required field. The British government's design system never marks a required field with an asterisk.

An asterisk is also easy to miss for people with low vision. Our guide to accessible forms shows the version with the word “required” in every label.