Markdown Toolbox Logo Markdown Toolbox
Home
Blog

How do I add superscript in markdown?

2024-09-09

Short version

Markdown doesn’t directly support superscript, but you can use HTML tags:

This is x<sup>2</sup>.

This is x2.

Long version

Introduction

Superscript can be useful for mathematical notations and citations. Native Markdown does not support it, but you can achieve it using HTML tags or Markdown extensions in some environments.


Methods to Add Superscript

  1. Using HTML Tags: The simplest way to create superscript in Markdown is to employ the HTML <sup> tag:
    This is x<sup>2</sup>.
    
  2. Using Markdown Extensions: In some Markdown parsers, such as those used by certain static site generators, superscript can be enabled through specific syntaxes or extensions. For instance, ^2 is often recognized:
    x^2
    
    This might require enabling specific options in your Markdown processor.

Conclusion

While Markdown doesn't natively support superscript, using HTML tags provides a quick solution. Always check if your Markdown parser supports alternate syntaxes for additional capabilities.