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 <sub> and <sup>HTML tags, respectively, with no other formatting info, with some exceptions (see below). The {{sup}} and {{sub}} 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 <sup>2</sup> and <sup>3</sup> 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) (w<sup>i</sup>x<sup>2</sup>z<sup>(n + 6)</sup>) or
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.
Per WP:SDFORMAT, {{short description}} cannot use HTML or wikitext formatting, leaving Unicode characters as the only option for superscripts and subscripts.
The ordinal suffix (e.g., th) is not superscripted (23rd and 496th, not 23rd and 496th). (Exception: Non-English languages; see MOS:ORDINAL.)
Centuries and millennia are written using ordinal numbers, without superscripts and without Roman numerals: the second millennium, the 19th century, a 19th-century book per MOS:CENTURY.
Non-base-10 notations in non-computer-related articles use subscript notation. For example: 1379, 2416, 2A912, A87D16 (use {{sub|radix}} or <sub>radix</sub>).
In figured bass, superscript and subscript may be combined by using math markup or by using the {{su}} template: <math>C_6^4</math> = , ''C''{{su|b=6|p=4}} = C4 6; (see also Wikipedia:TeX markup or m:Help:Formula).
For diminished chords and half-diminished chords: {{music|dim}} and {{music|halfdim}}.
For chord qualities and inversions: vii{{music|dim}}, I{{sub|6}}. This looks like: viio, I6.
Powers of unit symbols such as squares and cubes are expressed with a superscript exponent (5km2, 2cm3). Use the <sup> tag or {{sup}} 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).
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:
(correct—typeset from <math> x_\text{this one} = y_\text{that one} </math>),
and
(correct—typeset from <math>\sum_{i=1}^n {{y_i}^2 }</math>),
but not
(incorrect—typeset from r = x_{predicted} - x_{observed}).
Moreover, the TeX engine used on Wikipedia may format simple superscripts using <sup>...</sup> depending on user preferences. Thus, instead of the image , many users see x2. Formulae formatted without using TeX should use the same syntax to maintain the same appearance.
Notes
↑Esling, John (1999). "Appendix 2: Computer coding of IPA symbols". In International Phonetic Association (ed.). Handbook of the International Phonetic Association: A Guide to the Use of the International Phonetic Alphabet. Cambridge University Press. pp.161–185. ISBN0-521-63751-1.