# `<sup>`

> The `<sup>` HTML element defines superscript text, which appears half a character above the normal line of text.

## How do I write superscript text like exponents in HTML?

The element that displays text as superscript, positioning it higher than the normal text line. It's often used for footnotes, ordinal indicators and mathematical exponents.

- Topic: Semantics
- Type: tag
- Browser support: Chrome 1+, Chrome Android 18+, Edge 12+, Firefox 1+, Firefox Android 4+, Safari 4+, Safari iOS 3.2+

## Example

Wrong:

```html
<p>
  Area: 20m<span class="up">2</span>
</p>
```

Right:

```html
<p>
  Area: 20m<sup>2</sup>
</p>
```

`<sup>` carries the meaning of an exponent instead of relying on a custom class.

## Common mistakes

- Using `<sup>` for visual style only, like raising a logo mark.
- Footnote markers in `<sup>` without a link to the footnote.

## Interview questions

### How do I stop `<sup>` from breaking line spacing?

Set `sup { line-height: 0; }` so the raised text does not grow the line box.

### Should footnote references use `<sup>`?

Yes, a common pattern is `<sup><a href="#fn1">1</a></sup>` with a link back from the footnote.

## Related cards

- [`<sub>`](https://wonderium.dev/html/sub.md)
- [`<math>`](https://wonderium.dev/html/math.md)
- [vertical-align](https://wonderium.dev/css/vertical-align.md)
- [superscript](https://wonderium.dev/a11y/superscript.md)

---

- Level: [HTML](https://wonderium.dev/html.md)
- HTML version: https://wonderium.dev/html/sup
- Last updated: 2026-11-25
