The way you type an exponent depends on where you’re typing it. In a document, you format a number as superscript so it appears raised (like x²). In a spreadsheet or programming language, you use a special symbol like the caret (^) or double asterisk (**) to perform the actual math. Here’s how to do both, on every platform you’re likely to use.
Windows Shortcuts
The fastest method in most Windows apps is to type the number you want as your exponent, highlight it, then press Ctrl + Shift + Plus Sign (+). This toggles superscript formatting on the selected text, turning “x2” into “x².” Press the same shortcut again to switch back to normal text.
If you just need a squared (²) or cubed (³) symbol and don’t want to fuss with formatting, you can use Alt codes. Hold the Alt key and type 0178 on the numeric keypad for ², or Alt + 0179 for ³. These insert the actual Unicode character, so they work in almost any text field, including emails, browser search bars, and chat apps. You do need a keyboard with a number pad for this method.
Mac Shortcuts
On a Mac, the superscript shortcut in Pages and many other apps is Control + Shift + Command + Plus Sign (+). Select the text first, then press all four keys together. It works the same way as the Windows version, just with an extra modifier key.
For a quick one-off symbol, open the Character Viewer by pressing Control + Command + Space. Search for “superscript” and you’ll find the full set of raised digits. Double-click one to insert it at your cursor.
Chromebook Shortcuts
Chromebooks don’t have Alt codes, but they support direct Unicode entry. Press Ctrl + Shift + U in any text field. You’ll see an underlined “u” appear, which means the system is ready for a Unicode value. Type 00B2 for the squared symbol or 00B3 for cubed, then press Enter or Space. The code disappears and the exponent character takes its place.
Google Docs
In Google Docs, select the character you want raised, then press Ctrl + Period (.) on Windows or Command + Period on Mac. This applies superscript formatting instantly. You can also find it under Format > Text > Superscript in the menu bar. The same shortcut works to toggle superscript off when you’re done.
Microsoft Word
Word uses Ctrl + Shift + Plus Sign (+) to apply superscript, the same shortcut that works across most Windows applications. You can also click the small x² button in the Font group on the Home tab. For more control, open the Font dialog box (click the small arrow in the bottom-right corner of the Font group) and check the Superscript box under Effects.
Spreadsheets: Doing the Actual Math
In Excel and Google Sheets, you usually don’t want a superscript that just looks like an exponent. You want the spreadsheet to calculate the result. There are two ways to do that.
The simplest is the caret symbol (^). To raise 2 to the 5th power, type =2^5 in a cell and press Enter. The result, 32, appears. This works for any base and exponent, including decimals and fractions. Typing =9^0.5 gives you 3, since raising a number to the 0.5 power is the same as taking its square root.
The other option is the POWER function. The syntax is =POWER(base, exponent). So =POWER(2, 4) returns 16, and =POWER(3, 1.5) returns about 5.196. The function and the caret produce identical results. Use whichever feels more readable to you.
Programming Languages
Most modern programming languages use the double asterisk (**) for exponentiation. In Python, 3 ** 4 returns 81. JavaScript uses the same operator, and it’s equivalent to the older Math.pow(3, 4) syntax that you’ll still see in legacy code.
One common mistake: the caret (^) does not mean “to the power of” in JavaScript, C, or Java. In those languages, ^ is a completely different operation (bitwise XOR). Python is an exception where ^ is also bitwise XOR, but ** is the exponentiation operator, so the distinction still matters. If your code is returning unexpected results, check whether you accidentally used ^ instead of **.
HTML, Markdown, and LaTeX
If you’re writing for the web, HTML has a dedicated tag for superscripts. Wrap your exponent in <sup> tags: x<sup>2</sup> renders as x² in the browser. This is purely visual formatting and doesn’t perform any calculation.
In Markdown, support varies by platform. Some flavors let you write x^2^ to produce a superscript, but this isn’t universal. GitHub-flavored Markdown, for example, doesn’t support it natively. Check your platform’s documentation.
LaTeX uses the caret for superscripts in math mode. Type x^2 to render x². If the exponent is more than one character long, wrap it in curly braces: x^{2n} produces x raised to the power of 2n. Without the braces, LaTeX only superscripts the first character after the caret.
Mobile Devices
On both iPhone and Android, the default keyboard doesn’t have a dedicated exponent key, but there’s a workaround. Switch to the numbers view, then long-press on a digit. On some keyboards, including Gboard, this reveals alternate characters. Long-pressing certain keys can surface symbols like the degree sign (°) from the zero key. However, superscript digits aren’t available on most stock keyboards through long-press.
On iOS, when you long-press a key and an alternate character pops up, you need to slide your finger onto that character before releasing. Simply lifting your finger from the original key inserts the base character, not the alternate. Android handles this slightly differently, inserting the alternate on release without requiring the slide.
For reliable access to superscript numbers on mobile, your best options are copying the character from a web search (just search “superscript 2” and copy ²), or using a third-party keyboard like Gboard’s symbol search. In any app that supports rich text, like Google Docs, you can also use the Format menu to apply superscript formatting after typing.

