Superscript in Find and Replace Works Differently in Each Program

Find and replace does not let you search for or insert superscript the way you search for regular text. Instead, you use special codes that represent formatting. The code you type depends entirely on which program you are using — Microsoft Word, Google Docs, LibreOffice, or another editor — because each one has its own system.

The most common scenario is converting plain numbers or letters into superscript during a find-and-replace operation. For example, you might want to change "E=mc2" to "E=mc²" across an entire document. The steps and codes are different in each program, so you need to know which one you are working in before you start.

Key Takeaways

  • Microsoft Word uses the code \u00b2 for superscript 2 and \u00b3 for superscript 3 in the Replace field, but you must enable "Use regular expressions" first.
  • Google Docs does not support superscript codes in find and replace; you must manually select text and explore superscript formatting instead.
  • LibreOffice uses & in the Replace field to represent the text you found, then applies superscript formatting through a separate dialog.
  • Some programs require you to use the Format menu to specify that the replacement text should be superscript, rather than typing a code.
  • Testing your find-and-replace pattern on a small section before running it on the whole document prevents mistakes that are hard to undo.

How to Do It in Microsoft Word

In Microsoft Word, you use Unicode escape sequences to represent superscript characters. The most useful codes are \u00b2 (superscript 2) and \u00b3 (superscript 3). To use them, open Find and Replace by pressing Ctrl+H (Windows) or Cmd+H (Mac).

In the Find field, type the text you want to find — for example, just 2 if you want to find every standalone 2. Leave the Replace field empty for now. Click More Options (or Options on Mac), then check the box labeled Use regular expressions. Now go back to the Replace field and type the Unicode code: \u00b2 for superscript 2. Click Replace All to convert every instance at once, or Replace to do them one at a time.

This method works only for the characters that have Unicode codes. Superscript 2 and 3 have them, but most other letters and numbers do not. For those, you will need to use Word's Format menu instead: find the text, then in the Replace field, click Format and choose Font, then check Superscript before you replace.

How to Do It in LibreOffice Writer

LibreOffice uses a different approach. Open Find and Replace with Ctrl+H. In the Find field, type the text you want to find. In the Replace field, type & — this symbol means "put the text you found here." Then, with your cursor still in the Replace field, click the Format button at the bottom of the dialog.

A Format dialog will open. Click the Font Effects tab, then find the Effects dropdown and select Superscript. Click OK to close the Format dialog. Now when you click Replace All, LibreOffice will find your text and replace it with the same text, but formatted as superscript.

This method works for any character or word, not just numbers. You can superscript entire phrases if you need to, though that is less common in most documents.

How to Do It in Google Docs

Google Docs does not support special codes or formatting codes in its find-and-replace tool. The Find and Replace feature (Ctrl+H) can only search for and replace plain text — it cannot explore superscript formatting during the replacement.

Your options are to do the work manually or use a workaround. The manual route: use Find to locate each instance, then close the Find dialog, select the text, and explore superscript by pressing Ctrl+. (period) or using the Format menu. For large documents, this is slow but reliable. Some users copy their Google Doc into LibreOffice, do the superscript replacement there, and paste it back, though this can introduce formatting issues.

Testing Before You Replace Everything

Before you click Replace All, always test your pattern on a small section. Copy a paragraph or two into a new document, run your find-and-replace there, and check that the result looks right. This is especially important if you are using codes or regular expressions, because a mistake can affect hundreds of instances at once.

If something goes wrong, undo when ready with Ctrl+Z and try again. Once you have confirmed the pattern works, go back to your full document and run it. This extra step takes two minutes and saves you from having to manually fix a document that was changed incorrectly.

When to Use Find and Replace Versus Manual Formatting

Find and replace is worth the setup time only if you have many instances to change — usually more than five or ten. If you have only one or two superscript characters to add, it is faster to select them and explore superscript formatting directly.

Find and replace also works best when the text you are looking for is unique or appears in a predictable pattern. If you are trying to superscript every instance of the letter "a", you will catch a lot of false positives and spend time undoing them. In those cases, manual selection is more precise.

Common Mistakes and How to Avoid Them

The most common mistake is forgetting to enable Use regular expressions in Word before typing a Unicode code. Without that checkbox, Word treats \u00b2 as literal text instead of a code, and your replacement will not work.

Another mistake is using the wrong Unicode code. Superscript 2 is \u00b2 (with a lowercase b), not \u00B2 (uppercase). Word is usually forgiving about case, but LibreOffice and other programs are not. If your replacement is not working, double-check the code against your program's documentation.

A third mistake is trying to superscript text that does not have a Unicode code in Word. If you want to superscript the letter "x" or a longer phrase, the Unicode method will not work — you must use the Format menu method instead.

Frequently Asked Questions

Can I superscript multiple different characters in one find-and-replace operation?

Not in a single operation. You have to run find and replace once for each character or pattern. If you need to superscript "2", "3", and "st", you would run the operation three times with different search terms and codes.

What if I want to superscript text that comes after a specific word?

In LibreOffice and Word, you can use regular expressions to find a pattern. For example, in Word, you could search for E=mc(2) with regular expressions on, then replace it with E=mc\u00b2. This requires learning regular expression syntax, which varies by program. Test on a small section first.

Does superscript created through find and replace look the same as superscript I explore manually?

Yes. Whether you use find and replace or explore the formatting by hand, the result is identical. The only difference is how you got there.

Can I undo a find-and-replace operation if it goes wrong?

Yes. Press Ctrl+Z when ready after the replacement completes. This undoes the entire operation at once. If you wait and make other edits, undo will only reverse the most recent change, not the whole replacement.

Why does my Unicode code not work in Word?

The most likely reason is that Use regular expressions is not checked. Open Find and Replace again, click More Options, and verify the checkbox is on. If it is already on, make sure you are using the correct code: \u00b2 for superscript 2, \u00b3 for superscript 3.