How to write superscript and subscript in markdown
Find out how we can write superscript and subscript in markdown using html <sup> tag and <sub> tag.
In this post, we will learn how to write superscripts and subscripts in markdown.
There is no native support for superscript (sup) and subscript (sub) in markdown.
However, if you are using a markdown compiler to render the content as HTML then we can use the <sub> tag for subscript and <sup> for superscript.
Let's see with an example.
Write superscript in markdown
To write superscript in markdown we will use the <sup> HTML tag.
This is <sup>superscript</sup> in markdown
Output:
This is <sup>superscript</sup> in markdown
Write subscript in markdown
To write subscript in markdown we can use the <sub> HTML tag.
This is <sub>subscript</sub> in markdown
Output:
This is <sub>subscript</sub> in markdown
You can also write the power of numbers in mathematical equations using HTML tags.
Write power of numbers in markdown
To write a mathematical equation with a power of number, we can use the superscript <sup> like this.
2<sup>2</sup> = 4
Output:
2<sup>2</sup> = 4
Note: You can also use the Unicode or emoji character directly on your markdown content if your OS support it.
Related Posts
Checkbox inside GitHub Markdown Table
Short article on how to create checkbox or tick and cross mark inside markdown table in Github using emoji.
How to convert markdown to PDF offline with Pandoc Converter
Find out how to convert or merge two or more markdown files into a pdf format in windows and MacOs using command line in Pandoc document converter.
Easy Way to add Emoji in markdown with VS Code
Find out how to add emoji in your markdown document in VS Code using markdown emoji or emojisense plugins.
How to open markdown link in new tab
Article on how to open a markdown link in a new tab in browser using target="_blank" in the ahref link.
