Javatpoint Logo
Javatpoint Logo

Superscript in Markdown

Some markdown editors allows the use of superscript, where a character is placed at a slightly upper height than the normal character or number. We need to use a caret symbol (^) before and after the text. Superscripts are commonly used in mathematics, such as representing linear equations, complex numbers, trigonometry, and differential equations.

For example,

Output:

A2

Here,

2 is the superscript of A

The text inserted between the two caret symbols will appear as the superscript and the text before and after the two caret symbols will appear as the usual text.

There should be no space between the words, characters, symbols, or numbers placed inside the tilde symbols for superscript.

Note: There should be no space between the caret and the text. Both the symbols and the text inside it should be written without any space. Otherwise, the caret symbols will be considered as the text by default.

For example,

Output:

Normal Text Superscript

Error

The error arises when we insert an extra space between the symbols and text.

Let's the above example.

There is one space before and after the text in both the cases.

Output:

Normal Text ~ SuperscriptText ~

Reason: The output is the same as that of input. It is due to the extra space before and after the text, which is considered as text by default.

Superscript using HTML

To use the superscript command in HTML, we need to use the <sub> tag.

Syntax

<sup> ... </sup>

For example,

10 <sub> 2 <sub>

Output:

102

Examples

Let's discuss two example based on subscript.

Example 1:

Output:

X2 + 3X + 2 = 0

Example 2:

(Number)^0^ is always equal to 1.

For example,

and so on.

Output:

Superscript in Markdown





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA