Skip to content
🛠️ToolsShed

Superscript & Subscript

Convert text to Unicode superscript or subscript characters. Supports digits, letters, and common symbols.

Supported characters:

Digits 0-9: ⁰¹²³⁴⁵⁶⁷⁸⁹

About this tool

Superscript and subscript text are special Unicode characters that appear raised or lowered relative to normal text. They're essential for mathematical equations, chemical formulas, footnotes, and scientific notation where you need to display exponents, bases, or annotations without using special formatting or markup.

Simply paste or type your text into the input field, select whether you want superscript or subscript output, and click Convert. The tool will transform supported characters—including digits, letters, and common symbols—into their Unicode equivalents. The converted text can be copied directly and used anywhere that supports Unicode, from social media to documents.

Frequently Asked Questions

Code Implementation

SUPERSCRIPT = str.maketrans(
    "0123456789abcdefghijklmnoprstuvwxyzABDEGHIJKLMNOPRTUVW+-=()",
    "⁰¹²³⁴⁵⁶⁷⁸⁹ᵃᵇᶜᵈᵉᶠᵍʰⁱʲᵏˡᵐⁿᵒᵖʳˢᵗᵘᵛʷˣʸᶻᴬᴮᴰᴱᴳᴴᴵᴶᴷᴸᴹᴺᴼᴾᴿᵀᵁⱽᵂ⁺⁻⁼⁽⁾"
)

SUBSCRIPT = str.maketrans(
    "0123456789aehijklmnoprstx+-=()",
    "₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜₓ₊₋₌₍₎"
)

def to_superscript(text: str) -> str:
    return text.translate(SUPERSCRIPT)

def to_subscript(text: str) -> str:
    return text.translate(SUBSCRIPT)

print(to_superscript("x2 + y2 = r2"))  # x² + y² = r²
print(to_subscript("H2O"))              # H₂O

Comments & Feedback

Comments are powered by Giscus. Sign in with GitHub to leave a comment.