How to Safely Extract Microsoft Office ‘Activation Key’ from Registry (Recover Lost License)

If you purchased a standalone version of Microsoft Office (like Office 2019 or 2021) years ago, you probably threw away the physical cardboard box containing the 25-character activation key. If you need to reinstall Office on a new computer, you cannot just copy the software files over; you need that exact product key to prove you own it.

Microsoft does not display your product key inside Microsoft Word or Excel. Instead, the installer encrypted the key and buried it deep inside the Windows Registry. You can safely extract this hidden digital license using a specialized Command Prompt query.

How to Safely Extract the Microsoft Office Activation Key

You must use the `wmic` command to query the Software Licensing Service database.

  1. Click the Start button, type cmd, and launch the Command Prompt. (Right-click and select Run as administrator).
  2. Click “Yes” on the User Account Control prompt.
  3. To extract the raw, 25-character activation key from the registry, carefully copy and paste the following exact command: wmic path softwarelicensingservice get OA3xOriginalProductKey
  4. Press Enter.

The terminal will pause for a moment as it decrypts the registry entry. It will then output a single line of text directly below the command. This 25-character string (formatted like XXXXX-XXXXX-XXXXX-XXXXX-XXXXX) is your original Microsoft Office (or Windows) activation key. You can safely highlight this text with your mouse, press Ctrl + C to copy it, and save it to a secure location before you format your hard drive or move to a new computer.

Note: If the command returns a blank line, your version of Office is likely tied digitally to your Microsoft Account (Office 365) rather than a physical OEM key.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.