HTML Sup Tag

Sup Tag (Superscript)

At times, we are required to represent some content as superscript. Well, superscript means that it is slightly above the other text. For example, if we want to represent some mathematical equation, or simply if we want to write a square of 4 that is equal to 16, we would simply write 42 = 16. As you can see, the 2 is into the superscript.

If we are required to write something like this into our webpage, we can do so, using the sup tag. Here is an example –

Superscript example

<!DOCTYPE html>
<html lang=”en”>
<head>
<meta charset=”UTF-8″>
<meta http-equiv=”X-UA-Compatible” content=”IE=edge”>
<meta name=”viewport” content=”width=device-width, initial-scale=1.0″>
<title>Superscript example</title>
</head>
<body>
<p>This is an equation from Physics : E = MC<sup>2</sup></p>
</body>
</html>

As you can see, using the sup tag in the above example, we could make that 2 as superscript, as required. If we try to have a look at the output, it comes out to be something like this –
If you are required to have something as a superscript for any reason, you can make use of the sup tag. The thing that you write between <sup> and </sup> is going to be in the superscript.