Wikipedia:Manual of Style/Superscripts and subscripts

A superscript or subscript is text that is positioned slightly above or below the normal line of type. Superscripts and subscripts are often rendered in a smaller font size than the adjacent normal text. This part of the Manual of Style aims to achieve consistency in the use and formatting of superscripts and subscripts in Wikipedia articles.

General guidelines
Subscripts and superscripts should be wrapped in  and   HTML tags, respectively, with no other formatting info, with some exceptions (see below). The and  templates are useful shortcuts to the HTML markup. Do not use the Unicode subscripts and superscripts ² and ³, or XML/HTML character entity references ( etc.). Rather, write and  to produce the superscripts $2$ and $3$. The superscripted 2 and 3 are easier to read, especially on small displays, and ensure that exponents are properly aligned. Compare:
 * wⁱx²z⁽ⁿ ⁺ ⁶⁾ (Unicode superscripts) to
 * wix2z(n + 6) or
 * w$i$x$2$z$(n + 6)$


 * 1 + x² + y³ to
 * 1 + x2 + y3 or
 * 1 + x$i$ + y$2$

These guidelines also apply in citations and template parameters; templates are responsible for cleaning up markup if needed for external consumption, e.g. for COinS.

Phonetic transcriptions
Phonetic transcriptions in the International Phonetic Alphabet and Uralic Phonetic Alphabet (which are most often inside IPA, IPA link, UPA, and related templates) should use Unicode subscripts and superscripts. This follows the recommendation of the International Phonetic Association and is done by the tools, help pages, and articles referenced in Manual of Style/Pronunciation. Tone should usually be marked with diacritics or IPA tone symbols, according to Manual of Style/Pronunciation. Use Needs IPA for any non-compliant articles.

Titles
Another exception where Unicode superscripts and subscripts are used is in the title of articles, though this is only rarely necessary. See.

Short descriptions
Per WP:SDFORMAT, short description cannot use HTML or wikitext formatting, leaving Unicode characters as the only option for superscripts and subscripts.

Dates and numbers

 * The ordinal suffix (e.g., th) is not superscripted (23rd and 496th, not 23rd and 496th).
 * Centuries and millennia are written using ordinal numbers, without superscripts and without Roman numerals: the second millennium, the 19th century, a 19th-century book (see also Manual of Style).
 * Non-base-10 notations in non-computer-related articles use subscript notation. For example: 137$(n + 6)$, 241$2$, 2A9$3$, A87D$2$ (use  or  ).

Music

 * In figured bass, superscript and subscript may be combined by using math markup or by using the template:   = $$C_6^4$$,   = C$9$; (see also TeX markup or m:Help:Formula).
 * A superscript circle, or degree sign, which indicates a diminished chord, that may not display correctly for everyone, "°", can be produced by copying and pasting, typing, or by keying Alt176 (Windows PCs). A superscript lower case "$6$"  may be used instead. The slashed o, "$12$", which may not display correctly for all readers, is produced by superscripting the character produced by typing  , or by keying Alt248 (Windows PCs). Diminished chords can also be indicated with.
 * For inversions and the degree sign superscript and subscript may be done thus:,  . This looks like: vii$16$, I$radix$.

Unit symbols and abbreviations

 * Powers of unit symbols such as squares and cubes are expressed with a superscript exponent (5km$4 6$, 2cm$4 6$). Use the   tag or   template rather than the Unicode superscript characters such as ². Squared imperial and US unit abbreviations may be rendered with sq, and cubic with cu (15sqmi, 3cuft).

Chemistry
Descriptions of:
 * Chemical compounds
 * C2H5OH using


 * Isotopes
 * using

Mathematics

 * Exponentiation is indicated using a superscript:
 * 2$o$ = 4 using

Special care is needed with subscripted labels to distinguish the purpose of the subscript (as this is a common error): variables and constants in subscripts should be italic, while textual labels should be in normal text font (Roman, upright). For example:


 * $$ x_\text{this one} = y_\text{that one} \,\!$$ &emsp; (correct—typeset from ),

and
 * $$\sum_{i=1}^n { y_i^2 }\!$$ &emsp; (correct—typeset from ),

but not
 * $$r = x_{predicted} - x_{observed}$$ &emsp; (incorrect—typeset from ).

Moreover, the TeX engine used on Wikipedia may format simple superscripts using  depending on user preferences. Thus, instead of the image $$x^2\,$$, many users see x$o$. Formulae formatted without using TeX should use the same syntax to maintain the same appearance.