How to find your Windows product key: where is your key stored?
You can find your Windows product key in three ways: read the OEM key from the firmware with (Get-CimInstance -ClassName SoftwareLicensingService).OA3xOriginalProductKey in PowerShell, look for the key on the sticker or in your order email, or check your digital licence via Settings, System, Activation. A retail key you typed yourself cannot be read.
Where is your key stored?
The Windows product key is a 25-character string (five blocks of five) used to activate your installation. It consists of letters and numbers and has the form XXXXX-XXXXX-XXXXX-XXXXX-XXXXX. Where that key is located depends on how you got Windows: preinstalled on an off-the-shelf PC, purchased separately as a retail version, or as a digital licence via the Microsoft Store. Each of those three routes stores the key in a different place, which explains why one can be retrieved with a command and another cannot.
On a preinstalled PC the key is usually held in the UEFI firmware of the motherboard and can be read with a command. With a separate purchase the code is on a card in the box or in your order email. On many modern devices there is no readable code at all, but a digital licence linked to your hardware and Microsoft account.
This guide walks through the three routes for finding your Windows product key, with the exact commands, and explains why some keys simply cannot be read.
When do you need the key? Usually for a clean reinstall, when moving a retail licence to another PC, or as a check when buying a second-hand device. In many cases Windows activates automatically after a reinstall on the same hardware because the digital licence recognises the PC. Even so, it is useful to have the key to hand before you wipe the disk, especially if you plan to move the installation to another device or need to activate without internet.
Method 1: read the OEM key from the firmware
If Windows came preinstalled on your PC or laptop, the product key is almost always stored in the firmware (BIOS/UEFI). This is called the OA3 key. You read it with a command in an elevated window.
The classic method uses Command Prompt. Open Start, type cmd, choose Run as administrator and enter this command:
wmic path softwarelicensingservice get OA3xOriginalProductKey
Important: Microsoft removed the wmic tool in recent Windows 11 versions. If the command does not work, use the modern PowerShell equivalent. Open Start, type powershell, choose Run as administrator and use:
(Get-CimInstance -ClassName SoftwareLicensingService).OA3xOriginalProductKey
If a 25-character key appears, that is the OEM code belonging to this device. If the line remains empty, there is no key in the firmware. That is normal for self-built PCs and for retail or digital licences.
If you only want to know whether Windows is properly activated and what the last five characters of the active key are, use:
slmgr /dli
For a more detailed overview with the full licence name and activation status, use slmgr /dlv. To see whether your licence has an expiry date, for example with a temporary or volume licence, slmgr /xpr shows that in a single window. With a normal retail or OEM licence, that window reports that activation is permanent.
This window shows licence status and part of the key, but never the full code. More about the activation commands can be found in the overview of the firmware settings that Windows 11 checks, because the same UEFI also stores the Secure Boot status.
Why does this only work on preinstalled devices? Manufacturers write the OA3 key during production into a special table in the firmware, the ACPI table. Windows reads it automatically during installation, so the buyer does not need to type a code. If you build your own PC and install Windows with a purchased key, nothing is written to that firmware table, so the command returns nothing.
Third-party tools: useful, but with a caveat
There are free utilities, such as ProduKey, that show the stored keys for Windows and Office in a list. They are handy when you want to view several codes quickly, but keep two things in mind. First, on a retail installation they usually show the firmware key or a generic default value, not the code you actually typed. Second, some antivirus packages flag these tools because they search the system for keys. Only download them from the original maker.
Method 2: find the key on the sticker or in your order email
Not every key is in the firmware. With separate purchases and older machines, you will find the code on paper or in your inbox.
- Certificate of Authenticity (COA): on older laptops and PCs there is a sticker with the code, often on the underside of the device, in the battery compartment or on the case.
- Retail box: if you bought Windows as a boxed version, the code is on a card inside, sometimes behind a scratch-off panel.
- Digital purchase: with a download from the Microsoft Store or a reseller, the key is in the confirmation email or in your order history.
- USB packaging: with a Windows installation on USB, the card with the code is in the package.
The Certificate of Authenticity sticker has largely disappeared on newer devices, precisely because the key now lives in the firmware. If you do find such a sticker on an older laptop, it belongs to the edition that was preinstalled at the time. Keep the code, because the adhesive layer eventually loosens and the ink fades from heat and handling.
If you can still just read a sticker but some characters have faded, note down what you have and try the rest using the firmware method.
Method 3: check your digital licence in Settings
Many modern installations use no visible code at all, but a digital licence (also called digital entitlement). This is linked to a hardware fingerprint of your PC and, optionally, to your Microsoft account. There is then no 25-character code that you type anywhere.
- Go to Settings > System > Activation.
- Read the status line at the top. If it says Windows is activated with a digital licence linked to your Microsoft account, you do not need to keep a code.
- If the licence is not yet linked to your account, click Add an account and sign in with your Microsoft account.
This link is valuable: it lets you reactivate Windows after a hardware change without a code. Do this before you replace components, not afterwards.
Note the difference between the two types of digital licence. A digital licence from a free upgrade or an OEM device is tied to the motherboard and does not move to other hardware. A digital licence you bought separately as a retail product can be moved to a new PC through your account. In both cases, the link to your Microsoft account is the key to smooth recovery.
OEM, retail and digital licences work differently
Why one key can be read and another cannot comes down to the licence type. The table compares the three types.
| Type | Where is the code? | Can it be read with a command? | Transferable |
|---|---|---|---|
| OEM (preinstalled) | In the UEFI firmware | Yes, via OA3xOriginalProductKey | No, belongs to this motherboard |
| Retail (bought separately) | On a card or in your order email | No, not in readable form | Yes, to another PC |
| Digital licence | Linked to hardware and account | No, there is no 25-character code | Only retail digital, via account |
A retail key you typed yourself is stored by Windows only as an encrypted fingerprint, not as a readable code. That is why no command can retrieve the full key. Programs that claim to show every key often display the OEM firmware key or a default value on such an installation, not your real retail code.
What to do if you can't find your key
If none of the methods returns a code, there is usually nothing broken. In the vast majority of cases an empty result simply means you have a digital licence and do not need a code at all. If not, work through the options.
- Empty result from the firmware: you probably have a retail or digital licence. Check methods 2 and 3.
- No sticker and no email: sign in to the account you used for the purchase and search the order history in the store or Microsoft Store.
- Wrong edition is listed: a firmware key only activates the edition it is meant for, for example Home or Pro.
- Key no longer works after reinstall: sometimes this conflicts with a failed update, see the solution for Windows Update error 0x80070643.
- Second-hand PC without paperwork: check the firmware method to see whether an OEM key is still present in the device; it remains with the motherboard, even after sale.
If you eventually find a valid code, link your Microsoft account to the digital licence straight away via Settings, System, Activation. That way you will not need to look up the code again after the next reinstall or hardware change, because the licence will recognise your device automatically.
If you are unsure about the status, consult the overview on the Microsoft support page about activation errors. Keep the code you find in a safe place, for example a password manager, so you have it ready for the next reinstall.
Frequently asked questions
Use the command (Get-CimInstance -ClassName SoftwareLicensingService).OA3xOriginalProductKey in PowerShell with administrator rights. That shows the OEM key from the firmware. The older cmd variant wmic path softwarelicensingservice get OA3xOriginalProductKey only works on systems where wmic is still present, because Microsoft removed that tool from recent Windows 11 versions.
An empty line means there is no product key in the firmware. That is normal for self-built PCs, retail installations and digital licences. Only preinstalled OEM machines store the key in the BIOS or UEFI. In that case, look for the code on the sticker, in your order email or via your digital licence in Settings.
No. A retail key you entered manually is stored by Windows only as an encrypted fingerprint. No command can retrieve the full code. Programs that promise to do so usually show the OEM firmware key or a default value. Keep your retail code yourself on the card, in the email or in a password manager.
A product key is a 25-character string you type in to activate. A digital licence is an activation right linked to your hardware and, optionally, your Microsoft account, with no visible code. With a digital licence you do not need to keep a key; link it to your account for recovery after a hardware change.
Go to Settings, System, Activation. The status line shows whether Windows is activated and with which licence type. With the command slmgr /dli in an elevated window you can see the licence status and the last five characters of the active key, but never the full product key.
Related articles
Mira helps businesses with Windows and Office deployments and resolves activation, licensing and error-code questions every day.
View profile