How to Find Your Windows 11 Product Key Using CMD

Every copy of Windows 11 is tied to a product key — a 25-character alphanumeric code that confirms your license is legitimate. Most users never need to see it. But when you're reinstalling Windows, switching motherboards, or moving a license to a new machine, knowing where that key lives becomes genuinely important.

The good news: Windows stores the key locally, and Command Prompt gives you a direct path to it — no third-party tools required.

What Is a Windows 11 Product Key, Exactly?

A product key (also called a license key) is a unique identifier that activates your copy of Windows 11. It confirms to Microsoft's servers that your installation is genuine and authorized.

There are three common license types, and this matters for how — and whether — CMD can retrieve the key:

License TypeWhat It MeansKey Retrievable via CMD?
RetailYou purchased Windows directlyYes
OEMPre-installed by the manufacturerYes (embedded in firmware)
Volume/MAKEnterprise/institutional licenseSometimes — depends on deployment
Digital LicenseLinked to your Microsoft accountKey may not be stored locally

This distinction becomes important later.

How to Find Your Product Key Using Command Prompt

There are two reliable CMD-based methods. Neither requires administrator privileges for the basic query, though elevated access improves reliability.

Method 1: Using WMIC (Windows Management Instrumentation)

This is the most widely known approach.

  1. Press Windows + R, type cmd, and hit Enter
  2. In the Command Prompt window, paste or type the following:
wmic path softwarelicensingservice get OA3xOriginalProductKey 
  1. Press Enter

If a key is present in your system firmware, it will display as a 25-character string in the format XXXXX-XXXXX-XXXXX-XXXXX-XXXXX.

⚠️ Important: If the output returns blank or shows no value, it doesn't necessarily mean your Windows isn't activated — it may mean your license is a digital license tied to your Microsoft account rather than a locally stored key.

Method 2: Using PowerShell via CMD

For cases where WMIC returns nothing, this alternative decodes the key from the registry:

  1. Open CMD (or PowerShell directly)
  2. Run:
powershell "(Get-WmiObject -query 'select * from SoftwareLicensingService').OA3xOriginalProductKey" 

This queries the same underlying data source but through PowerShell's WMI interface — sometimes returning results where the WMIC command doesn't.

Running CMD as Administrator 🔑

For the most reliable results:

  • Search for cmd in the Start menu
  • Right-click Command Prompt
  • Select Run as administrator

Then run either command above. Administrator access ensures the process has full read permissions on system-level license data.

Why CMD Sometimes Returns a Blank Result

This is one of the most common points of confusion, and it's worth understanding clearly.

Digital licenses — which became the default for Windows 10 and carried forward into Windows 11 — don't store a traditional product key on the local machine. Instead, activation is tied to your Microsoft account and verified online. The hardware fingerprint of your device is matched against Microsoft's activation servers.

If your machine came with Windows 11 pre-installed and you signed in with a Microsoft account during setup, there's a strong chance your activation uses this method. In that scenario:

  • CMD commands will return blank output
  • This is normal behavior, not an error
  • Your Windows is still fully activated
  • The "key" effectively lives in your Microsoft account, not your hard drive

To verify your activation status regardless of key type, run:

slmgr /xpr 

This opens a dialog confirming whether your Windows license is permanently activated.

Where the Product Key Actually Lives

Understanding the storage location helps explain why different methods work in different situations.

  • OEM keys are embedded in the UEFI/BIOS firmware of the motherboard — this is why a reinstall on the same machine can activate automatically
  • Retail keys may be stored in the firmware or entered manually during setup
  • Digital licenses are stored in Microsoft's activation servers, linked to your hardware ID and/or Microsoft account
  • The registry contains an encoded version of the key in some installations, which is what third-party tools often decode

The WMIC command specifically reads from the SoftwareLicensingService WMI class, which pulls from UEFI/BIOS — not the registry. This is why it works well for OEM machines and may miss keys entered manually.

Factors That Affect Whether This Works for You

Several variables determine whether the CMD approach gives you a usable result:

  • How Windows was installed — clean install with a retail key vs. OEM pre-installation vs. upgrade from Windows 10
  • Whether you linked a Microsoft account — digital licenses bypass local key storage entirely
  • Your hardware — older machines may not have UEFI firmware capable of storing embedded keys
  • Enterprise or institutional setup — volume licenses managed through KMS (Key Management Service) work differently and the key may not be retrievable by individual users
  • Windows edition — Home, Pro, and Enterprise have different licensing architectures 🖥️

Each of these variables pushes the outcome in a meaningfully different direction. A user on a retail-purchased Surface Pro running Windows 11 Pro will have a very different experience than someone on a corporate-issued laptop managed by an IT department — even if they run the exact same CMD command.

What to Do If You Need the Key for Reinstallation

If CMD returns blank and you need your key for a reinstall:

  • Check your Microsoft account at account.microsoft.com under Devices
  • Look for a physical COA sticker on the device (common on older hardware)
  • Check your email for a purchase confirmation if you bought a retail license
  • If it's an OEM machine, reinstalling Windows on the same hardware will typically auto-activate without needing the key manually

The method that works depends almost entirely on how your specific license was issued and how your system was originally set up — something only your own machine can tell you.