Ordinals are “counting words” like 1ˢᵗ, 2ⁿᵈ and 19ᵗʰ: they are characters that express position in a series. So-called “superior” letters are used to present some abbreviations in a similar way, such as Mᴹᴱ for the French “Madame”. All of these are forms of superscripted text, commonly used for references to footnotes, chemical compounds, and mathematical exponents.

Unfortunately, superscripted text can be difficult to create and typeset correctly on the web. If you want to use finely detailed layout that includes ordinals on your pages, there are several possible solutions:

Best option: OpenType

A well-crafted typeface has ordinals built in, and an embedded OpenType font should have the capacity to display them. Conversion to ordinals happens automatically in applications like Microsoft Word, but not in browsers, where it must be turned on with CSS.

Depending on the typeface and its range of ordinal characters, you may apply the CSS to all paragraphs, only certain elements, or <span> elements with classes. In this case, I’ll choose the latter:

<p>The <span class="ord">1st</span> place prize is awarded to
Constance Yeargood.

Results in (in this case, displayed using the embedded Source Sans Pro typeface):

The 1st place prize is awarded to Constance Yeargood.

Once the CSS is applied, the effect is also true for higher numbers:

<p>In the next two minutes humanity will take more photographs than it did
during the entire <span class="ord">19th</span> century.

Creates:

In the next two minutes humanity will take more photographs than it did during the entire 19th century.

Note that ordinals are not the only effect of this CSS: character strings like “No.1” will be automatically converted to the numero sign plus the associated number, if the typeface supports it:

Please visit us at No23 Charing Cross Road

Modern browsers have good support for ordinals, with the disappointing exception of their mobile cousins, at least at their current state. This situation is complicated by the fact that ordinals are best supported in OpenType fonts (.otf). While .woffshould support the feature, font hosts often strip it out when converting from .otf to .woff. As a result, relatively few webfonts have glyphs that support the feature, although their numbers are growing: right now, it’s something of a hit-and-miss affair. Take care when purchasing and using web fonts, and inspect their features closely.

Ordinals tend to work best with lining figures, i.e. numerals that are all the same height, and sit on the same baseline. As this is the default numeral style in most typefaces, it shouldn’t worry you too much, but it’s worthwhile to double-check.

2ⁿᵈ solution: Unicode characters

If your chosen web font does not have OpenType features and/or does not have the correct glyphs, you can usually fake ordinals by using Unicode characters. Again, these must be built into the typeface, but they are far more common. They can be entered as HTML entities using decimal notation, it’s usually easiest to simply copy and paste the characters into your text. I’ve left them here for you as a reference:

Unicode character set

Glyphs

Superscript numerals

⁰ ¹ ² ³ ⁴ ⁵ ⁶ ⁷ ⁸ ⁹

Subscript numerals

₀ ₁ ₂ ₃ ₄ ₅ ₆ ₇ ₈ ₉

Superscript ordinal characters

1ˢᵗ, 2ⁿᵈ, 3ʳᵈ, 4ᵗʰ

All uppercase superscript Latin characters

ᴬ ᴮ ᴰ ᴱ ᴳ ᴴ ᴵ ᴶ ᴷ ᴸ ᴹ ᴺ ᴼ ᴾ ᴿ ᵀ ᵁ ᵂ

All lowercase superscript Latin characters

ᵃ ᵇ ᶜ ᵈ ᵉ ᶠ ᵍ ʰ ⁱ ʲ ᵏ ˡ ᵐ ⁿ ᵒ ᵖ ʳ ˢ ᵗ ᵘ ᵛ ʷ ˣ ʸ ᶻ

Presented as a string of characters, you may find that the lowercase ordinals “jump” up and down a great deal in some typefaces; both Latin sets are also missing characters that are not commonly used for ordinals, such as the letter Q.

<sup> & Entities

Alternatively, you can place ordinal characters inside a <sup> tag. (Or, if the characters are intended to appear below the baseline, the <sub> element). If it is supported in the typeface, the browser should use the appropriate Unicode glyphs (shown above) to display the characters inside the tag:

the typeface may not have the correct Unicode characters, in which case it will use a substitute from another font, or not display the glyph at all.

as noted, the Unicode superscript characters do not always sit perfectly on the same baseline.

Superscripted characters may not be correctly sized, requiring more CSS to set it in proportion to the body text.

Conclusion

The typesetter’s goal should always be make text easy to read, so there is no one solution that can pointed to as being “correct”. The question is always “given this typeface used in this way under these reading conditions, what is the clearest way to present this text?”

If a word like loft appears similar to 10th on your pages, then you should probably use ordinals to clarify the text; which technique you use depends on the browser and typeface. Sometimes you might only want to use ordinals on headings; in other cases, it might be the entire body text.

An extensive use of exponents and other mathematical expressions usually requires moving from the solutions described here to a technology like MathML.