🚀 LEVEL UP TO SENIOR:Unlock 500+ Advanced Practical Challenges & Expert Masterclasses.
🎓 COURSERA PARTNER:Earn professional Google, Meta, and IBM certificates to supercharge your resume.
REFERENCEhtml

html Documentation

LOADING ENGINE...

HTML <sup> Tag

Mark superscript. Learn sup tag and sup vs sub.

sup.html
<!-- Superscript -->
x<sup>2</sup>
📐
sup.html
1 / 7
📐

Tutor:The <sup> tag represents superscript—text that appears smaller and above the baseline. Use it for exponents (e.g. x²), footnote references, or ordinal numbers (1st, 2nd). Browsers render it as superscript.

Sup Mastery

Mark superscript with the sup tag. Learn sup vs sub.

Concept 1: The Sup Tag

The <sup> tag represents superscript—text above the baseline. Use it for exponents (x²), footnote refs, or ordinals (1st, 2nd). Browsers render it smaller and higher.

System Check

Which tag represents superscript (text above the baseline)?

Community Holo-Net

Superscript Patterns

Using <sup> for exponents or footnote refs? Share your patterns.

Enjoying this guide?

Codesyllabus is 100% free and open-source. Support our mission, pay for server infrastructure, and fuel new tutorials by buying us a coffee!

HTML <sup> Details

Author

Pascual Vila

Frontend Instructor

The <sup> tag represents superscript—text that appears smaller and above the baseline. Use it for exponents (e.g. x²), footnote references, or ordinal numbers (1st, 2nd). Browsers render it as superscript. Use <sub> for subscript (below the baseline).

sup vs sub

<sup> = superscript (above baseline). <sub> = subscript (below baseline). Use <sup> for exponents, footnote refs, ordinals; use <sub> for chemical formulas, variable subscripts. Both are semantic.

Best practices

Use <sup> when the meaning is superscript—exponents, footnote refs, ordinals. Do not use it only for visual effect; prefer semantic markup. The exact style can be overridden with CSS if needed.

Sup Tag Glossary

<sup>
HTML element for superscript—text above the baseline. Use for exponents (x²), footnote refs, or ordinals (1st, 2nd).
<sub>
Subscript—text below the baseline. Use for chemical formulas (H₂O), variable subscripts. Use <sup> for superscript.
Superscript
Text that appears smaller and above the normal baseline. <sup> is semantic and renders as superscript by default.