mrpear.net logo one IT guy's personal web site
ČESKY | ► ENGLISH |
twitter icon flickr icon 500px icon

How to get Windows Product Key from DigitalProductId exported out of registry

This article describes how to decode Windows Product Key from DigitalProductId value which is stored in the registry. This may be useful when we have corrupted system that won't boot up or we just want or need to get the key from system where it is not possible to run key decoder. All we need is to get the DigitalProductId value form the registry of the offline system. Let's read more about it in this article.
There are plenty of tools to get Windows Procduct Key Number from the running (online) system, but what if this is not our case and we need to get Windows Product Key Number from the system that won't boot up or we are just not able to run key decoder there? Well it is possible to decode key from such a system as long as we are able to access offline registry database files from that system and as long as that registry database files are not corrupted.
Ads

Decoding the Windows Product Key Number

The process of getting Windows Product Key Number consist of two steps, first is obtaining DigitalProductId from the registry, the second is decoding that DigitalProductId as Windows Product Key Number.
We can get DigitalProductId value from the registry programmatically (as key decoders usually do) or we can find and export the value using Regedit.exe tool, which is part of every Windows instalation.
Please do not confuse DigitalProductId with Product ID, which can be found in the System dialog. They are not the same. Windows 10 has ProductId in this format: 00330-00000-00000-00000.

Loading registry hive from offline registry

Regedit.exe can load and edit offline registry databases. Registry databases are located in the following location:
%windir%/System32/config/
We need to access HKEY_LOCAL_MACHINE\SOFTWARE\ registry hive that is located in the following path:
%windir%/System32/config/SOFTWARE
Please note that "SOFTWARE" is the name of the registry database file, %windir% points to the system Windows directory, for example "C:\Windows".
To load offline registry database, do the following steps:
  1. Press the Win+R key combination, Run dialog appears.
  2. Type in "regedit" (without quotes) and press Enter.
  3. Confirm UAC prompt to elevate user rights (regedit needs administrator rights to run).
  4. Regedit tool will appear on the screen.
  5. Select HKEY_LOCAL_MACHINE key as this will be the place where we will load the offline hive.
  6. Click on File menu and Load Hive... option. If you have this option greyed out, please make sure you have selected (active) HKEY_LOCAL_MACHINE key.
  7. Locate and open the offline registry database SOFTWARE file.
  8. When prompted for a name give it a name you like (e.g. TEST). The name will be used to create a new node in the tree so we can browse the offline registry.

Exporting DigitalProductId from the registry

We can find DigitalProductId in the following registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion
As we have loaded the offline registry as the "TEST" node, we can actually find DigitalProductId in the following location:
HKEY_LOCAL_MACHINE\TEST\Microsoft\Windows NT\CurrentVersion
Now to export this key, do following steps:
  1. Navigate to the HKEY_LOCAL_MACHINE\TEST\Microsoft\Windows NT\CurrentVersion key (you can copy and paste the key name in the key bar under the menu.
  2. On the right pane you will see registry values for the selected key and you should see the DigitalProductId value as REG_BINARY.
  3. To export the value, we need to export whole key. Right click on the CurrentVersion key in the left pane and select Export in the context menu that will appear.
  4. Export Registry File dialog will appear, choose exported file name and location as needed. Keep "Save as type: Registration files (*.reg)" option and check that "Export range: Selected branch" is selected. You should see selected branch HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion under this option.
  5. Click Save.
  6. Registry key will be exported in the .reg file. Now we can open this file in any text editor, for example in Notepad.

Opening exported .reg file in the notepad

To open exported .reg file in the notepad, do follwing steps:
  1. Press the Win+R key combination, Run dialog appears.
  2. Type in "notepad" (without quotes) and press Enter.
  3. Notepad will appear.
  4. Now you can simply drag and drop exported file on the Notepad window, or you can use File - Open... (Ctrl+O) menu to browse the file. If you can't see exported .reg file, select "All files" from the file type selection drop down.

Locating DigitalProductId exported from registry

Now when you have open exported .reg file in the Notepad, you should see DigitalProductId value among other key values in the following format:
"DigitalProductId"=hex:a4,00,00,00,03,00,00,00,30,30,33,33,30,2d,38,30,30,30,\
  30,2d,30,30,30,30,30,2d,41,41,33,32,38,00,ec,0c,00,00,5b,54,48,5d,58,31,39,\
  2d,39,38,38,34,31,00,00,00,ec,0c,00,00,00,00,a8,d2,7b,6e,89,81,4f,6d,09,00,\
  00,00,00,00,f0,87,99,58,20,9a,d7,4d,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,ff,a1,85,e6
Selected DigitalProductId section and copy it to the clipboard (Ctrl+C).

Decoding DigitalProductId exported from registry

To decode the value, you can use my tool "Windows Product Key Finder" (you can read more about it here: (Yet Another) Product Key Number Finder for Windows). Since version 1.3 this tool is able to decode DigitalProductId exported from registry. You can download the tool directly here: WinProdKeyFind_v1.3.zip.
Windows Product Key Finder is open source, no-install, portable and very simple tool that look like this:
Windows Product Key Finder 1.3
Click Decode DigitalProductId button. Decode Windowss Product Key from DigitalProductId value dialog will appear. Paste DigitalProductId from the clipboard to the DigitalProductId key text box as in the following example:
Windows Product Key Finder 1.3
Please note that it is important to keep exported DigitalProductId in the format as shown in the examples.
If you are decoding DigitalProductId for Windows 7 or older Windows systems (Vista and XP), please select Up to Windows 7 (old) option, otherwise keep Windows 8 and newer (new) option in the version selection drop down.
Finally press the Parse DigitalProductId button to parse the DigitalProductId. Now you should see decoded Windows Product Key Number in the text box.

Final words

We've seen how to export DigitalProductId value from the offline registry database file and how to decode Windows Product Key Number from that value.
Let me know what you think about down below in the comments!
Ads

Comments

20. 5. 2018 9:08:30, Kuba
Díky moc za pomoc!!! Super návod!!!
5. 7. 2018 19:48:16, Ace Carlo
Why it didn't work on my laptop? I got it correct but when i try to use the key it says " You might be using different version of microsoft? Can you explain and help
9. 7. 2018 14:24:36, mrpear
[Ace Carlo] Really difficult to say where is the problem. The sentence about wrong versions leads me to use key for different version of Windows (Home vs Pro, ...)?
9. 8. 2018 4:31:01, Tom
Finally what I have been looking for. Not a coder so I could not edit the VBS scripts I've found that only read the registry. I had a .REG file that I needed converted and your program is perfect!
Thank you,
tom
19. 12. 2018 22:55:24, Brian E McNutt
This tool is fantastic! Love it and very easy to use. Thanks Pavel!
21. 12. 2018 2:48:53, Mark
Worked well, but I can only verify the key when needed. I'll keep it on paper in the pc box.
13. 5. 2019 22:15:45, nektarios
You are my hero! thank you so much. you did great job there and for free.that's the internet everybody contribute in the way he can
12. 6. 2019 13:39:34, Pavlo
Somehow, for all my laptops, it always returns the same product key that I see on your screen. Nothing changes even if I change DigitalProductId to some random value
13. 6. 2019 13:30:12, mrpear
[Pavlo] Depends on what product key exactly you get. There are few generic codes, that are always the same, such as VK7JG-NPHTM-C97JM-9MPGT-3V66T (Windows 10 Pro) and YTMG3-N6DKC-DKB77-7M9GH-8HVX7 (Windows 10 Home). Let me know.
14. 6. 2019 12:35:17, Pavlo
[mrpear] Thanks for answer))) I got VK7JG-NPHTM-C97JM-9MPGT-3V66T for all W10Pro. Stickers with a license have another key. Is it possible somehow retrieve non-generic key for win10Pro? Stickers are to damaged to recognize whole real product key
14. 6. 2019 12:54:25, mrpear
[Pavlo] No, you can't get "real" keys if the system is activated using generic key. But why do you need it? You can reinstall system on the same hardware without needing any product key (just use generic key or even skip this part and just choose right Windows edition), it will be activated using hardware fingerprint without any issues.

Btw, generic keys are used to activated Windows 10 also when upgrading from Windows 7/8.x system.

When any Windows 10 machine is sucessfully activated you do not need product key anymore (for the same hardware).
17. 6. 2019 9:24:29, Pavlo
[mrpear] Very useful answer. I just did not know that licensing is being this way. I tried to find a simple way but it looks like it is impossible in my case. Thank you.
29. 8. 2019 20:01:20, Pratik N Borkar
Hi man i have try to decode the Product ID from Windows 10 Enterprise LTSC 2019 edition but not working itsonly shows

NBBBB-BBBBB-BBBBB-BBBBB-BBBBB
31. 8. 2019 11:26:57, Denis Baturin
[Pavlo] Try to find the registry folder with the name "DefaultProductKey2" inside "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion". If it exists, take the value "DigitalProductId" there and parse it using this utility.
6. 10. 2019 20:11:07, Anonymous
What a great tool! It does exactly what it needs to do. This has saved me a purchase of a new Windows 10 license. I lost the code in a computer crash, but via a Ubuntu Live CD I was able to copy the 'SOFTWARE' file from Windows to a USB stick. I was then able to extract the hex code with a demo version of AccessData Registry Viewer. I could then put it into this tool fairly smoothly. I had to make sure that the layout of the hex-string is exactly the same as in the example, but that took little effort. Thanks again!
31. 12. 2019 12:09:38, user
cool
20. 1. 2020 5:47:44, Fred Williams
Thanks
24. 2. 2020 3:05:41, anon
Thank you for this, digital key decoding worked! However, initial attempt failed. My registry key name is "DigitalProductID" so changing it to "DigitalProductId" did the trick. :)
3. 3. 2020 11:35:20, Bogdan
Multumesc mult!
Thanks alot! :D
Worked perfect.
21. 3. 2020 12:43:22, Marcelo
[mrpear] What other information is stored in DigitalProductId besides the Product Key? Does upgrading Windows 10 (e.g. from version 1903 to 1909) change the value of DigitalProductId?
22. 3. 2020 14:14:05, mrpear
[Marcelo] Sorry, but I do not know what other information is stored in DigitalProductId.
25. 3. 2020 4:03:24, Dan
I used your software but only was able to get BBBBB-BBBBB-BBBBB-BBBBB-BBBBB. Any ideas I what I am doing wrong? I've on a windows 7 pro machine and it has novell zenworks on it (which I am trying to get rid of by reinstalling the windows 7 pro operating system.
25. 3. 2020 11:26:27, mrpear
[Dan] Those sets of keys indicate your were running a volume license client copy of Windows. You cannot use it to activate the system again. Is there option to restore system to factory settings? Or just upgrade to Win10, activate and then reinstall clean Win10.
20. 4. 2020 15:24:46, Anonimo
Does not work
28. 4. 2020 6:57:57, Bradley
Invalid DigitalProductId

I recovered the SOFTWARE file from a Windows 10 Pro that was upgraded from Windows 7 Ultimate.
I used Nirsoft OfflineRegistryView to read the file.
I copied the "DigitalProductId"
I pasted as-is into your tool.
Invalid DigitalProductId

I noticed three differences:
1. "DigitalProductId"=hex(3): instead of "DigitalProductId"=hex: Deleting "(3)" doesn't help.
2. My hex values are in UPPERCASE. Does that matter?
3. When I paste, each line is justified left. It doesn't have a 2-character indent like your DigitalProductId format example.
2. 5. 2020 9:45:58, mrpear
[Bradley] The problem is probably in the format that "Nirsoft OfflineRegistryView" exports the registry. My app requires specific format and if yours is different, it cannot parse it correctly. Sorry I cannot support every tool that exports registry.

In this article you can learn how to export offline registry using regex tool that produces output compatible with my app.
17. 7. 2020 17:30:09, D. Buck
Your Tool is absolutely great, this is what i have looked for.
especially for corrupt systems

Greatings from Germany
10. 10. 2020 2:08:12, Richmond Te
Hi, I got an Invalid Digital ProductId
11. 10. 2020 18:24:36, mrpear
[Richmond Te] Great comment, thank you...
9. 11. 2020 8:24:43, BUCKMARTIN
I THINK IT IS FASCINATING HOW YOU, HAVING STUDIED ALL THIS AND ARE WILLING TO SHARE IN SUCH A PRECISE AND ACCURATE WAY,IT IS GREATLY COMMEMORABLE!THERE'S A LOT TO BE SAID ABOUT CLARITY AND YOU DIFFERENTLY HAVE THAT BRILLIANT,AND I THANK YOU! I WAS ABLE TO FOLLOW YOUR INSTRUCTIONS THROUGH THE OFFLINE TEST IN ONE GO NO PROBLEM, UNBELIEVABLE... BUCKMARTIN...
10. 11. 2020 23:09:44, Max
First run i've got NBBBB-BBBBB-BBBBB-BBBBB-BBBBB,
After reading your answer:
Try to find the registry folder with the name "DefaultProductKey2" inside "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion". If it exists, take the value "DigitalProductId" there and parse it using this utility.
It worke.
Thank you for sharing your knowledge with us.

Max
20. 12. 2020 5:14:01, Christopher
Excellent explanation and worked well thanks Pavel (I exported the Digital Product ID etc.). Got the same answer as Belarc Advisor provided, but this confirmed for me that I have the generic key too.
Christopher
22. 12. 2020 5:59:51, bcov
If you did everything right and still get Invalid DigitalProductId. Study the github code in WinProdKeyFind/DigitalProductIdForm.cs -> btnParseDigitalProductId_Click and look for slight difference. The parsing is very specific.

For me, I needed a lowercase D at the end of DigitalProductId. My key ended in a capital D.
16. 3. 2021 23:21:43, Luksh
Thank you very much!
19. 3. 2021 13:06:06, Davey
I followed the instructions but the only result I can get is the same key that is displayed before the Hex is entered: VK7JG-NPHTM-C97JM-9MPGT-3V66T
Nothing I do seems to change change it at all.
Dell Desktop Machine with an Embedded key.
Thanks
24. 3. 2021 7:26:10, mrpear
[Davey] Well yes, as you have embeded key there is no "real" key to get exported from your system (or registry) and thus you are getting that generic key.
19. 4. 2021 8:56:32, dane
This was a lifesaver today, thank you! Well written. Also I really dig that little software tool, super simple yet effective.
13. 5. 2021 21:53:45, lulama
i'm looking for product keys of 8.1 windows with bing, please help it's a used Pc.
7. 6. 2021 6:05:30, Vladimir
VK7JG-NPHTM-C97JM-9MPGT-3V66T мой ключ сказал -хрен тебе Егорка собирай бычки))
11. 6. 2021 4:15:20, Eazy does it!
It worked like a charm but i noticed that my product id had a letter "n"which is not a recognized symbol ...i tried everything and all letters and numbers nothing happened...any idea?
this laptop was bought as gift from my dad to me but he threw away the box and was able to find out about the digitalproductid and I want to install an older version of Microsoft word but its asking for product id...pls Help if you know how to???
16. 6. 2021 17:46:23, Neil Paisnel
I can't install .net 4 on my Win 7 machine . it fails ..probably due the Win7 7 support being stopped.
If I copy your tool over to a Wn8 machine ..it now finds the Win 8 Product key.

How do I get an eallier version of your app so I can enter the exported registration data directly ? and do it on the Win 8 machine

Thank you
18. 7. 2021 19:38:09, Larz5000
Amazing! You saved me. I had found multiple DigitalID in the registry, but the one that worked was in "DefaultProductKey2" -- my system is now activated!
9. 8. 2021 14:08:08, Leonardo Vazquez
Amazing! You saved me too!!! Thanks Pavel !!!!
19. 8. 2021 12:00:51, Mark De Nooijer
Works perfect! thanks a lot.
4. 10. 2021 17:42:28, Muhsin
This tool was awesome! Easy to follow instructions. Fantastic work!
12. 10. 2021 19:41:27, Tim
This does not work. Tried multiple times following instructions very carefully and windows says it is not a valid key when entering it to activate.
2. 12. 2021 6:24:23, Trev
Would be great to be able to run this tool from the command line, what are the chances?? Great tool by the way :)
20. 1. 2022 6:20:51, Dan
Bloody Brilliant. Saved my bacon on a production server. Restore was going to be a nightmare but this tool saved the day on a 2008 x86 machine.
26. 2. 2022 0:29:35, Tobe
not working :-( just as all other key extractors out there it keeps showing the same identical (invalid) product key on various systems.
20. 4. 2022 21:11:51, MeKLiN
these keys are inserted in HKLM Software Microsoft Internet Explorer Registration after the very first boot on 19h1, i go to dvd and save regs and compare, to try and stop updates. the keys are under: key: ProductId, DigitalProductId, and DigitalProductId4 ... I'd post the binaries changed to and from's (nirsoft registrychangesview.exe) but its my dad copy and dont know if his key is hidden somewere in here. the regular SLUI.exe software protection program area has backupproductkey and it was a generic one of google, hes lost his for now as well... do u think its really in here? drmeklin of archive.org/details/@meklin looking help adding 2020 code signing to .. the fastest windows iso ever made windows 7700 and it is cleaned up and deacivate the bomb
1. 11. 2022 2:59:21, Yellow
Hi... in your code to get the Windows Product Key for Win8 systems and above, could you explain what exactly the following two lines do, and why?

var isWin8 = (byte)((digitalProductId[66] / 6) & 1);
digitalProductId[66] = (byte)((digitalProductId[66] & 0xf7) | (isWin8 & 2) * 4);

Also, doesn't (isWin8 & 2) always return zero, because you did a '& 1' in the line before?

Thanks for reading...
1. 11. 2022 13:26:25, mrpear
[Yellow] Quite a lot of people touch that (isWin8 & 2) part, but to be honest, while it works I do not plan to update it. But looks like a valid comment and a place where the code can be improved. The problem is that I'd like to test the updated code on as many as possible product keys, but I don't have them available now.

So even that it seems as obvious fix, I just don't want to mess with something that works, sorry. You can easily fork my project on GitHub and fix it for yourself and see whether it was worth it (I am pretty sure somebody did this before). I am not looking for perfect code here...

Thanks for comment!
2. 11. 2022 0:31:07, Yellow
Hey, you replied. ;) Thanks.

As it seems, the code works fine if you just clear the four rightmost bits in byte 66 of digitalProductId. But I wanted to fully understand what this part of the code was actually supposed to DO. Do you have any info about the byte structure of the digitalProductId data from your community discussion that you could share? Why is it suggested that byte 66 actually holds info about the Windows version?
2. 11. 2022 0:41:37, Yellow
Urks, I meant it seems enough to just clear bit 3 (AND 0xf7) of course ... not the four rightmost ones.
4. 11. 2022 17:41:41, Rob
Awesome... Worked a treat for Windows 8.1! Thanks!
7. 11. 2022 8:28:01, mrpear
[Yellow] Sorry for a bit late reply :).

I do not have any info about product key structure, sorry :). Well, nothing more that couldn't be extracted by reading the code. I just got that VB script back then and used it to port it to C#. I just needed trustworthy key finder, so making my own was the motivation, I just didn't bother understanding the key itself.

I know that I did not help you to understand the key structure, but anyway, thanks for comments :).

Pavel
22. 11. 2022 23:17:10, Yellow
One more question: do you happen to know the difference between DigitalProductId and DigitalProductId4 ? Some say that on 64-bit-systems, the Product key is stored in DigitalProductId4 instead of DigitalProductId, but this seems NOT bo be true (on my Win10 x64, the correct Product Key is still stored in DigitalProductId) ...

Also, just to note, as I was told, Win11 and up does not store the Product key anywhere in the registry anymore.
25. 11. 2022 8:58:32, mrpear
[Yellow] For me, it always worked getting a key from DigitalProductId, I've never encountered any other key storage. But as you mention, there are probably some others places in registry where keys can be stored, you are not the only one who gave me such feedback.

I think even for Win10 it becomes a bit obsolete to retrieve keys from registry as even Win10 uses digital activation based on hardware fingerprint and thus no need to retrieve the key for e.g. new installation.
13. 3. 2023 20:15:55, Peter Webster
terrrriffffic!!
recovered keys on a crashed ssd
16. 3. 2023 18:41:18, Robert M
This is an excellent tool!!
As sombody else already said "bloddy brilliant"

I was able to discover that my PC has 3 different Product IDs stored in the registry from earlier instalations but of course is only using one actively for the activation. hence I suddenly have 2 spare keys and product ID i canuse on another PC.

I wish something similar would exist for office keys and ID's

Thanks again !!
Robert

What do you think?

:
:
(not requiered and non public, used for further contact)
: