---
title: "English: a vs an"
subtitle: "Why vowel letters are the wrong rule for indefinite articles in generated text"
slug: english-a-vs-an
url: https://listedarticles.com/articles/english-a-vs-an
canonical_url: https://www.redblobgames.com/blog/2026-09-16-english-a-vs-an/
content_type: tutorial
language: en
published_at: 2026-09-16T00:00:00.000Z
updated_at: 2026-09-20T00:13:12.097Z
author: "Amit Patel"
author_url: https://www.redblobgames.com/
authored_by: human
publisher: "Red Blob Games"
publisher_url: https://www.redblobgames.com/
topics: ["Programming", "Writing", "Algorithms", "Education"]
license: all-rights-reserved
word_count: 274
reading_minutes: 1
citation: "Amit Patel, Red Blob Games. \"English: a vs an.\" 16 Sept 2026. https://www.redblobgames.com/blog/2026-09-16-english-a-vs-an/ (all-rights-reserved)"
# The full text follows. The web page shows an extract and sends readers
# to the source above; quote the citation and link the canonical URL.
---

# English: a vs an

*Why vowel letters are the wrong rule for indefinite articles in generated text*

> Amit Patel (Red Blob Games) digs into when English wants “a” versus “an”: the rule tracks spoken vowel sounds, not written vowel letters, and only a small set of common words need exceptions for procedural text generation.

Blog post: 16 Sep 2026

In English, there is an “indefinite” article `a` that can go before a word. For example, `a raccoon`. But for some words, we use `an`. For example, `an apple`. 

When procedurally generating text, I want a function `a_or_an("apple")` that tells me which article to use. That seems like it’d be easy. We can check the first letter to see if it’s a vowel. But that would mean we output `an unicorn`, not `a unicorn`. 

The actual rule is not whether the _written_ word starts with a vowel letter, but whether the _spoken_ word starts with a vowel sound. The word `unicorn` starts with vowel letter (`u`) but a consonant sound (`Y`). The word `hour` starts with a consonant letter (`h`) but a vowel sound (`OW`). 

[![Tree style visualization of the first two letters of a word](/x/2635-a-vs-an/blog/level-2f.png?2026-08-25-11-10-15)](/x/2635-a-vs-an/blog/level-2f.png) Visualization showing whether the first two letters of a word are enough to determine whether it should have “a” or “an”

I was curious how often these exceptions occurred, and whether they can be grouped together, so [I spent a day looking at the data and building some visualizations and wrote up the results.](/x/2635-a-vs-an/) I was surprised that only 129 of the 32,455 words in my list needed exceptions. 

[LLM note: I did _not_ use LLMs to write any of this code, but in hindsight, I should have. This is one-off code to answer a question. It doesn’t need to be clean or maintainable. It only needs to be correct. I would’ve spent more time on the trie simplification algorithm and less time on parsing cmudict and re-learning d3.js.]
