Calculators look simple: a few inputs, a button, a number. They are also one of the easiest places to ship an inaccessible page, because the whole point is a result that appears after you press a button. If a screen reader user never hears the result, the tool does not work for them.
I have been building small fitness-test calculators, and these are the habits that made the biggest difference. Nothing here needs a framework.
1. Every input gets a real label
A placeholder is not a label. It disappears when you type, it is often low contrast, and many screen readers do not announce it reliably. Use a <label> tied to the input:
<label for="run">2-mile run time (mm:ss)</label> <input id="run" name="run" inputmode="numeric" autocomplete="off"> Put the expected format in the label or in text linked with aria-describedby, so it is read out with the field:
<input id="run" aria-describedby="run-hint"> <p id="run-hint">Enter minutes and seconds, for example 15:30.</p> 2. Group related fields
Age and sex often decide which table you read. Put them in a fieldset with a legend so the group has a name:
<fieldset> <legend>Your details</legend> <label for="age">Age</label> <input id="age" type="number" min="17" max="65"> <label for="sex">Sex</label> <select id="sex"> <option value="m">Male</option> <option value="f">Female</option> </select> </fieldset> 3. Validate in plain language, next to the field
The error message should say what is wrong and how to fix it. "Invalid input" helps nobody. "Enter the run time as minutes and seconds, like 15:30" does.
Link the message to the input and mark the field invalid:
<input id="run" aria-invalid="true" aria-describedby="run-error"> <p id="run-error">Enter the run time as minutes and seconds, like 15:30.</p> When the user submits with errors, move focus to the first invalid field, or to a short summary at the top of the form that links to each problem. Do not rely on color alone to show the error. Add text and an icon with a text alternative.
4. Announce the result
This is the part people miss. When your script writes the score into the page, a screen reader will not say anything unless you tell it to. Put the result in a live region:
<div id="result" role="status" aria-live="polite"></div> function showResult(points, passed) { const el = document.getElementById('result'); el.textContent = `Total: ${points} points. ${passed ? 'Meets the minimum.' : 'Below the minimum.'}`; } Use role="status" for results and role="alert" only for errors that need immediate attention. Keep the message short and complete, because the live region reads the whole text each time it changes. Write the live region into the HTML at load time, empty, before you fill it. Regions that are inserted and filled in one step are often not announced.
5. Do not hide meaning in a chart
If you show a table of scores or a bar chart, the information should also exist as text or a real table. A table with <th scope="col"> and <th scope="row"> cells is easy to navigate. For a chart, add a one-sentence summary and a link to the data table.
6. Keyboard and touch
- Everything must work with Tab, Shift+Tab, Enter, and Space.
- Make the focus outline visible. If the default looks bad, restyle it, do not remove it.
- Touch targets should be at least about 44 by 44 pixels.
- Use the
inputmodeattribute so phones show a numeric keypad for reps and times.
A quick tip on times: type="number" is a poor fit for mm:ss, because the colon is rejected. Use a text input with inputmode="numeric" and parse it yourself.
7. Test it with five minutes of effort
You do not need a lab.
- Unplug the mouse and complete the form with the keyboard only.
- Turn on a screen reader (VoiceOver on a Mac or phone, NVDA on Windows) and submit a valid and an invalid form. Check that you hear the labels, the errors, and the result.
- Zoom the page to 200 percent and check that nothing overlaps.
- Run an automated checker such as axe or Lighthouse. It will catch missing labels and contrast problems, though not whether your live region reads well.
A small checklist
- Labels on every field, with format hints
- Fieldsets for related inputs
- Errors in text, linked to fields, with focus moved
- Result in a live region that exists at load
- Tables instead of image-only charts
- Visible focus, large targets, numeric keypad
- Manual keyboard and screen reader pass
I use these on AFTPTCalc, a free set of military fitness test calculators at https://aftptcalc.com/, and the live region change alone fixed the most complaints. If you have found a pattern that works better for result announcements, I would like to hear it in the comments.
Disclosure: I drafted this post with the help of an AI writing assistant and edited it myself. The code samples are minimal examples; test them in your own project.
