In HTML the <sup> tag is used to display a text as superscript.Superscript are usually rendered with a raised baseline and smaller text, Subscript text can be used for square, like a2, b2, etc.
<!DOCTYPE html>
<html>
<body>
<p>a<sup>2</sup></p>
<p>b<sup>2</sup></p>
<p>a<sup>2</sup>+ b<sup>2</sup></p>
</body>
</html>