Superscript and subscript text

Superscript is indicated by surrounding carets ^, and subscript text by surrounding tildes ~ after a preceding space.

Textile example: Superscript and subscript text

Global warming in the 21 ^st^ century is mostly caused by CO ~2~ in the atmosphere.

Textile input (editable)

Browser output

HTML output


More about: Superscript and subscript text

1. To avoid spaces around the super- and subscripted text, square brackets [ ... ] have to be used. The above example then should be rewritten as:

Global warming in the 21[^st^] century is mostly caused by CO[~2~] in the atmosphere.

Another example, a chemical formula:

Calcium borate: Ca[~3~](BO[~3~])[~2~]

Which generates “Calcium borate: Ca3(BO3)2”.

Further reading: Superscript and subscript text

  1. MDN: The HTML <sup> element
  2. MDN: The HTML <sub> element

See something wrong in this page? Outdated info, a broken link, faulty code example, or whatever? Please write an issue and we’ll fix it.