How to Find Your Windows 11 Product Key Using the Command Prompt

Your Windows 11 product key is a 25-character code used to activate your operating system, verifying that your copy of Windows is genuine and properly licensed. If you bought a pre-built laptop or desktop computer, this key is usually embedded deeply within the motherboard’s firmware (the UEFI/BIOS), meaning Windows activates automatically without you ever seeing the code. However, if you are planning to build a new PC and want to transfer your retail license, or if you need to reinstall Windows from scratch and want the key handy just in case, you need a way to extract it. The fastest way to pull this embedded key is by using a single command in the Command Prompt.

Extracting the OEM Product Key

This method works specifically for OEM (Original Equipment Manufacturer) keys—the keys that are digitally injected into the motherboard by companies like Dell, HP, or Lenovo at the factory.

  1. Click the Start button on your taskbar.
  2. Type cmd into the search bar.
  3. In the search results, you will see Command Prompt. Do not just click it.
  4. Look at the options on the right side of the search pane and click Run as administrator. (Alternatively, right-click the Command Prompt result and select “Run as administrator”).
  5. A User Account Control (UAC) prompt will appear asking if you want to allow this app to make changes. Click Yes.
  6. A black terminal window will open. Carefully copy and paste (or type) the following exact command:

wmic path softwarelicensingservice get OA3xOriginalProductKey

  1. Press the Enter key.

Understanding the Results

After pressing Enter, you will see the phrase OA3xOriginalProductKey appear on the next line.

  • If a 25-character key appears below it (formatted like XXXXX-XXXXX-XXXXX-XXXXX-XXXXX), success! This is your embedded product key. You should immediately highlight it with your mouse, press Ctrl+C to copy it, and save it in a secure password manager or text document.
  • If the next line is completely blank, it means your computer does not have an OEM key embedded in its firmware. This usually happens if you built the PC yourself, if you bought a retail digital license directly from the Microsoft Store, or if your system was upgraded from an older version of Windows using a digital entitlement linked to your Microsoft Account. In these cases, your activation is handled via the cloud when you log into your Microsoft account, not via a hardcoded motherboard string.

Get the best tech tips delivered straight to your inbox.

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