Skip to main content

How to Turn Any Number Into Its Ordinal (1st, 2nd, 3rd, and Why 11th Breaks the Rule)

A plain-English guide to writing ordinals: the st/nd/rd/th suffix rule, the 11/12/13 exception, plus dates, rankings, and how programmers format them.

Published By Li Lei
#ordinal numbers #grammar #text conversion #formatting

How to Turn Any Number Into Its Ordinal (1st, 2nd, 3rd, and Why 11th Breaks the Rule)

Cardinal numbers count how many: one, two, three. Ordinal numbers say where something sits in a line: first, second, third. In writing you abbreviate them with a number plus a two-letter tail, so 1 becomes 1st and 3 becomes 3rd. It looks trivial until you hit 11, and then half the people in the room write 11st with a straight face. This guide walks through the rule that actually decides the tail, the band of three numbers that ignores it, and how the whole thing shows up when you are writing dates, building a leaderboard, or formatting a string in code.

The basic suffix rule: look at the last digit

The tail you attach is decided by the final digit of the number, with one exception we will get to in a moment. Clear that exception first and the pattern is clean:

  • ends in 1 takes st — first
  • ends in 2 takes nd — second
  • ends in 3 takes rd — third
  • ends in 4, 5, 6, 7, 8, 9, or 0 takes th — fourth, fifth, and so on

So you write 1st, 2nd, 3rd, 4th, 5th, 6th, 7th, 8th, 9th, and 10th. Because the rule reads the last digit, it repeats every ten once you are past the tricky band: 21st, 32nd, 43rd, 54th, 65th. Twenty ends in zero, so it is 20th; ninety ends in zero too, so it is 90th. Nothing about the digits in front matters here, only the one on the end.

The 11, 12, 13 exception

Here is where it goes sideways. The suffix is not really chosen by the last digit, it is chosen by the last two digits, and when those two land in the 11-to-13 range the answer is always th.

Eleventh, twelfth, and thirteenth have ended in th for as long as English has been written down, so they keep it: 11th, 12th, 13th, never 11st, 12nd, or 13rd. The catch is that this band recurs inside every hundred. The numbers 111, 112, and 113 end in the same eleven-twelve-thirteen pattern, so they are 111th, 112th, and 113th. Same for 211th, 212th, 213th. The moment you step out of the band, the single-digit rule takes over again: 121 ends in 21, the 21 is past 13, so it reads 121st.

The order of operations is what trips people up. Check for the 11-to-13 band first; only if you are clear of it do you fall back to the last digit. That is why 113 is 113th and not 113rd even though it ends in a 3 — the 13 wins because the band is tested before the digit.

A worked example

Take a column of numbers and run them through:

  • 21 — last digit is 1, and 21 is well past the 11-to-13 band, so it is 21st.
  • 12 — falls right inside the band, so it ignores the "ends in 2 takes nd" rule and reads 12th, not 12nd.

Put those two side by side and the whole logic is visible: two numbers that both end in low digits, but the band decides one of them. The ordinal number converter does exactly this check on every row, so you can paste a list, drop in 11 through 13 to demonstrate the exception, then 21 through 23 to watch the rule snap back. It shows the suffix, the spelled-out word like twenty-first, and the Chinese 第N form all in one table.

Where you actually use ordinals

Dates. In speech and in many style guides you say "the 21st of June" or "June 1st." Get the suffix wrong and the date reads as a typo, which undercuts trust in everything around it. If you publish a lot of dated copy, this is the single most common place a stray 22th sneaks in.

Rankings and results. Sports recaps, contest writeups, and leaderboards are wall-to-wall ordinals: 1st place, 2nd place, 3rd place, then 4th through 10th, then the 11th-place finisher who quietly breaks the pattern. When you have a long results table, batch-converting the whole placement column at once removes the temptation to hand-type each tail and guess at the edge cases.

Spelled-out words. Sometimes you need the word, not the abbreviation: "the twenty-first century," "her fortieth birthday." Compound ordinals only change the final word and keep the hyphen, so 21 reads twenty-first and 42 reads forty-second. If you are going the other direction and need the cardinal spelled out first, a number to words tool handles that, and words to number reverses it when you are parsing text someone else wrote.

Formatting ordinals in code

When I first wrote an ordinal helper for a reporting dashboard, I did the obvious thing and switched on the last digit alone. It passed every test I bothered to write — 1, 2, 3, 21, 22 — and shipped. Two weeks later a finance report rendered "the 11st quarter milestone" on a slide that went to the whole company, and I learned the rule the embarrassing way. The fix is one line of order: test the last two digits against 11, 12, 13 first, and only then look at the last digit.

In practice the logic reads like this in any language:

function ordinalSuffix(n) {
  const lastTwo = Math.abs(n) % 100;
  if (lastTwo >= 11 && lastTwo <= 13) return "th";
  switch (Math.abs(n) % 10) {
    case 1: return "st";
    case 2: return "nd";
    case 3: return "rd";
    default: return "th";
  }
}

The lastTwo guard is the whole game. Skip it and you get 11st; keep it and 11, 12, 13, 111, 112, 113 all correctly collapse to th. Note the Math.abs so a negative carries its sign cleanly — -3 stays -3rd. Decimals are not ordinals at all; "2.5th" describes no position in a sequence, so leave fractional values to a plain number rather than forcing a suffix onto them.

Quick reference

  • The suffix follows the last digit: 1→st, 2→nd, 3→rd, everything else →th.
  • Exception first: if the last two digits are 11, 12, or 13, the answer is th regardless of the final digit.
  • That band recurs every hundred, so 111th, 112th, 113th, then 121st.
  • Ordinals are for whole-number positions only — no decimals, no fractions.

For the related jobs around all this — turning Arabic figures into Roman numerals for chapter headings, or adding thousands separators to long numbers — the roman numeral converter and number formatter cover those without leaving the same toolkit.


Made by Toolora · Updated 2026-06-13