How to Find Your Windows 11 ‘Product Key’ via Command Prompt

When you purchase a laptop or desktop computer with Windows 11 pre-installed by the manufacturer (like Dell, HP, or Lenovo), they do not include a physical sticker with your 25-character product key anymore. Instead, to prevent piracy, the manufacturer digitally injects the Windows product key directly into your motherboard’s UEFI firmware chip at the factory.

If you ever need to completely format your hard drive and perform a clean installation of Windows 11 from a USB drive, the installer will usually detect this embedded key automatically. However, if it fails to detect it, or if you need the key for your own records before replacing a broken motherboard, you can extract the original product key directly from the firmware using a quick Command Prompt command.

How to Find Your Windows 11 Product Key via Command Prompt

You must use the Windows Management Instrumentation Command-line (WMIC) tool to read the motherboard firmware.

  1. Click the Start button and type cmd.
  2. Right-click on the “Command Prompt” result and select Run as administrator.
  3. If prompted by User Account Control, click Yes.
  4. In the black Command Prompt window, carefully copy and paste the following exact command: wmic path softwarelicensingservice get OA3xOriginalProductKey
  5. Press Enter.
  6. The terminal will pause for a second as it queries the motherboard. It will then output a 25-character alphanumeric string formatted like this: XXXXX-XXXXX-XXXXX-XXXXX-XXXXX

This is your original OEM product key. You should highlight this key with your mouse, press Enter to copy it, and save it in a secure password manager or write it down. Note: If the command returns a blank line, it means your computer does not have a product key embedded in the motherboard (for example, if you built a custom PC and purchased a digital retail license tied to your Microsoft Account instead).

Get the best tech tips delivered straight to your inbox.

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