A limerick is a five-line comic poem with a strict shape: a long opening couplet, a short middle couplet, and a long closing line that rhymes with the first two — the AABBA scheme — all carried on a galloping anapestic rhythm. This generator gets the rhymes right not by guessing how words sound but by storing words in pre-matched rhyme groups, so the structure is correct by construction every time.
The AABBA structure
A limerick has a precise line structure:
| Line | Rhyme | Rhythm | Role |
|---|---|---|---|
| Line 1 | A | Long (da-da-DUM da-da-DUM) | Introduces person and place |
| Line 2 | A | Long | Extends the setup |
| Line 3 | B | Short (da-da-DUM) | Starts the twist |
| Line 4 | B | Short | Heightens the twist |
| Line 5 | A | Long | Delivers the punchline |
The rhythm is technically anapestic (two unstressed syllables followed by a stressed one), but in practice the key constraint is that lines 1, 2 and 5 are longer (typically 7–10 syllables) and lines 3 and 4 are shorter (typically 5–7 syllables).
How this generator works
The tool keeps two collections: A-rhyme groups (sets of words that share an ending sound, used to close lines 1, 2, and 5) and B-rhyme groups (used to close the shorter lines 3 and 4). To build a limerick it picks one A group and one B group at random, then selects distinct rhyming words from each group to end the appropriate lines. The line bodies come from light templates sized to the limerick’s long-short-short-long-long rhythm. Because both rhyme sets are drawn from matched groups, lines 1/2/5 always rhyme and lines 3/4 always rhyme.
A brief history
The limerick form was popularised in the mid-19th century by Edward Lear, whose Book of Nonsense (1846) collected 72 illustrated limericks and established the bouncing comic tone. The name is thought to derive from the Irish city of Limerick, possibly from a parlour game where guests composed verses before the refrain “Will you come up to Limerick?” The form has been a vehicle for wordplay, bawdy humour, and quick wit ever since.
Tips for reading and using generated limericks
- Read them aloud and lean into the da-da-DUM bounce — the rhythm is the joke.
- The opening line traditionally names a person and a place; if a generated line does not, it is still technically valid but may feel looser.
- The fifth line is the punchline — it should land with a slight twist or surprise.
- Generate several and keep the one that flows most naturally; some rhyme combinations are funnier than others by luck.
- For party games, challenge each player to improvise a line in the same rhyme scheme as the generated limerick — the AABBA pattern is strict enough to be a fair constraint.