How to retrieve your current license key on Windows

NicolasBrondinBernard

Author
@NicolasBrondinBernard

You want to reinstall Windows and need to find out the license key currently used on your machine? Here's how to do it in just a few seconds!

Article published on 06/02/2023, last updated on 10/08/2026

A license key allows a software publisher (in this case, Microsoft) to know that you have indeed paid to obtain the software in question; this key may be requested during installation, or upon first launch.

Regarding Windows keys, if you want to do a complete reinstallation of your system, it's best to remember to retrieve your key before starting the reinstallation, because otherwise you'll have to buy a new one!

Here are two very easy ways to retrieve your key, with just a single command line!

With a Windows terminal

The first method is the simplest, you just need to open a regular command terminal (Windows key, then type cmd), then type the following command:

C:\Windows\system32> wmic path softwareLicensingService get OA3xOriginalProductKey

OA3xOriginalProductKey
xxxxxxxxxxxxxxxxxxxx (key)

With a PowerShell console

If you're more the type to use PowerShell as your one and only terminal, then the command will be different, but works just as well:

PS C:\Windows\system32> powershell "(Get-WmiObject -query 'select * from SoftwareLicensingService').OA3xOriginalProductKey"

xxxxxxxxxxxxxxxxxxxx (key)

To note

Some license keys are only valid for a single machine (identified by the motherboard), if you try to reuse a key on a different machine, you might run into an issue!

If you'd like to install Windows yourself, here's another article that details the steps to follow:


Alp Duran sur Unsplash

Finished reading this article?
Our newsletter

No spam. Only free content, news, and ever more resources to level up your skills!

Join +1500 developers

Comments (0)

to leave a comment

No comments yet