Skip to content
Back to blog
Wednesday, December 2, 2026

Markdown Superscript and Subscript with Examples and PNG Export

Compare four Markdown superscript and subscript examples, fix crossed-out digits, and export a lab handout as a PNG.

Markdown Superscript and Subscript with Examples and PNG Export

Use 10<sup>2</sup> for a superscript and H<sub>2</sub>O for a subscript on GitHub or in another renderer that preserves those HTML tags. For a short label in a handout, you can paste 10² or H₂O directly. Use inline math when the exponent or index contains an expression.

The same Markdown can change when you move it between editors. The four rows below show which forms kept the small digits in place in a PNG downloaded from Markdown2Image.

Compare four ways to write the same notation

Copy the contents of this block into an empty Markdown draft. The blank lines keep each form on its own row.

## Raised and lowered numbers

**HTML** · 10<sup>2</sup> and H<sub>2</sub>O

**Unicode** · 10² and H₂O

**Inline math** · $10^{2}$ and $\mathrm{H}_{2}\mathrm{O}$

**Editor extensions** · 10^2^ and H~2~O

Comparison PNG showing 10² and H₂O in the first three rows, then visible carets and a struck-through 2 in the fourth row.

The first row uses inline HTML. Place each tag right next to its base and enclose only the characters you want to move. GitHub documents both tags. CommonMark describes how to parse inline HTML, and individual applications decide which elements to preserve in their output. GitHub text styling · CommonMark inline HTML

The second row uses literal Unicode digits. They travel with the text when you paste it into a caption or message, and their appearance depends on the font. The third row uses ^ and _ inside math delimiters. Braces group an exponent such as -3, so both characters move up in $10^{-3}$. KaTeX supported syntax

The last row uses Pandoc extension syntax. In the Markdown2Image export on December 2, 2026, 10^2^ kept both carets on screen, and the 2 in H~2~O was crossed out. When moving a Pandoc draft, run this small test before converting the full document. Pandoc superscripts and subscripts

Choose the form for where the text will appear

  • GitHub README. Start with m<sup>2</sup> for units and CO<sub>2</sub> for chemical labels. Open the rendered README and check both positions.
  • Chat caption or slide label. Use m², CO₂ or 10⁻³ for a short label. Confirm the same characters are visible in the receiving app and font.
  • An equation with a multi-character index or exponent. Use braces in a math-enabled editor, as in $x_{i+1}$. Check where the index ends, especially when more symbols follow it.

If the renderer leaves tags visible or flattens the digits onto the baseline, switch a short label to Unicode and check the target preview again. When you see a line through a digit, look for surrounding tildes in the source. If dollar signs appear, check the editor’s math support and the matching closing delimiter.

Export a lab handout as a PNG

This small card uses Unicode labels that can also appear in the accompanying message. Copy the lines inside the block to try the same export.

## Lab handout

**Area** · 4 m² (four square metres)

**Gas label** · CO₂ (carbon dioxide)

**Scale factor** · 10⁻³ (one thousandth)
  1. Open the converter and paste the example into the Markdown input. Markdown to Image converter
  2. Check the preview for m², CO₂ and 10⁻³. Read the minus sign separately from the 3 and make sure both sit above the baseline.
  3. Choose PNG as the image format and select Download image. Open the downloaded file before inserting it into a worksheet or slide.

Exported lab handout with 4 m², CO₂ and 10⁻³, each written out in words.

This download retains the converter’s footer.

Check the card at the size you’ll share

Place the PNG in the destination first, then read it at the size your audience will see. The ² and ₂ should still differ in height, and both characters in ⁻³ should be distinguishable. If the digits merge or a glyph becomes a box, change the font or increase the text size, then download and check the image again.

Include the source or the key text alongside the PNG so readers can copy the notation. For a slide, useful alt text could read “Lab handout showing four square metres, carbon dioxide and a scale factor of one thousandth.” If you’re exporting a full equation with fractions or roots, use the dedicated formula workflow. LaTeX to PNG guide