The
<sup>tag in HTML is used to display superscript text, which appears smaller and slightly above the baseline of normal text.
It is commonly used in mathematical powers, chemical notation, footnotes, or references.
It is an inline element.
Syntax
<sup>Superscript text</sup>Attributes
| Attribute | Description |
|---|---|
class | Assigns one or more class names for styling. |
id | Assigns a unique identifier to the element. |
style | Adds inline CSS styles to customize appearance. |
title | Provides additional information as a tooltip. |
Example
<!DOCTYPE html>
<html>
<head>
<title>SUP Tag Example</title>
<style>
.exponent {
color: #2c3e50;
font-size: 0.9em;
}
</style>
</head>
<body>
<h1>HTML <sup> Tag Example</h1>
<p>
Mathematical example: 5<sup class="exponent" id="power" title="Superscript">2</sup> = 25
</p>
<p>
Footnote example: The term “HTML”<sup>1</sup> stands for Hypertext Markup Language.
</p>
</body>
</html>Output
Browser Output
Use our TryIt Editor to see the output.
Browser Support
Chrome | Firefox | Edge | Safari | Opera | IE9+ |
|---|---|---|---|---|---|
| ✅Yes | ✅Yes | ✅Yes | ✅Yes | ✅Yes | ✅Yes |
The <sup> tag displays text slightly above the baseline, making it suitable for exponents, footnotes, and reference numbers.
Notes
<sup>is an inline element and does not break the line.- Often paired with
<sub>for scientific or mathematical notation. - CSS can adjust font size, color, or spacing for superscript text.
- Ideal for exponents, footnotes, or references rather than normal text.
Conclusion
The <sup> tag is used for superscript text, such as exponents, footnotes, or references.
It visually raises the text above the baseline, providing correct formatting for technical and academic content.