If you’ve associated PDF files with Google Chrome or Mozilla Firefox to make use of browser’s built-in PDF viewing capability, the PDF and HTML files would show up with the same Chrome or Firefox icon in File Explorer. This post tells you how to set a custom different icon for PDF files, with Chrome or Firefox as the default PDF viewer.
Set Custom icon for PDF Files with Chrome or Firefox as the Default PDF Viewer
First, create or download a .ico file which you want to set as the default icon for PDF files, and save it to a permanent location. You should be able to find a suitable icon from FindIcons or IconsPedia.
Then, follow the instructions for Google Chrome or Mozilla Firefox below.
With Mozilla Firefox as the default PDF Viewer
- Start the Registry Editor (Regedit.exe) and go to:
HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartmenuInternet\FIREFOX.EXE\Capabilities\FileAssociations
- In the right-pane, create a DWORD value named .pdf
- Double-click .pdf and set its value data to FirefoxPDF
- Select HKEY_CLASSES_ROOT, and create a new subkey named FirefoxPDF
- With FirefoxPDF selected, double-click (default) and set its value data to PDF File
What you mention here is displayed in the Type column in Details view and in the Preview pane. You can type in any description as you’d like, say “Firefox PDF Document”.
- Under FirefoxPDF, create a subkey named DefaultIcon
- Select DefaultIcon and double-click the (default) value in the right pane.
- Type in the .ico file with full path there.
- Then create the following key:
HKEY_CLASSES_ROOT\FirefoxPDF\shell\open\command
Note: The “shell” key doesn’t exist by default. You need to create it, and its subkeys as above, manually.
- With the above key selected, double-click (default) and set it’s value data as follows:
"C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -osint -url "%1"
That assumes Firefox.exe is located under
C:\Program Files (x86)
in a Windows x64 system. The Program Files path would beC:\Program Files
in an x86 system. Or, if you’ve installed Firefox under your user profile, type the appropriate path. You can find the Firefox.exe file location by right-clicking on the Mozilla Firefox shortcut in the Taskbar or Start menu and checking its properties.
You now have the following registry keys/structure.
HKEY_CLASSES_ROOT | FirefoxPDF |_ DefaultIcon |_ shell |__ open |___ command
REG file for the above settings
To automate steps above, you can use this .reg file:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\FirefoxPDF]
@="PDF File"
[HKEY_CLASSES_ROOT\FirefoxPDF\DefaultIcon]
@="C:\\Program Files (x86)\\Mozilla Firefox\\Pdf.ico"
[HKEY_CLASSES_ROOT\FirefoxPDF\shell]
@="open"
[HKEY_CLASSES_ROOT\FirefoxPDF\shell\open\command]
@="\"C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe\" -osint -url \"%1\""
[HKEY_CURRENT_USER\SOFTWARE\Clients\StartmenuInternet\FIREFOX.EXE\Capabilities\FileAssociations]
".pdf"="FirefoxPDF"
[HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartmenuInternet\FIREFOX.EXE\Capabilities\FileAssociations]
".pdf"="FirefoxPDF"
Make a .reg file out of the above contents. To do so, copy the above lines to Notepad, and save it with .reg extension. Double-click the .reg to apply the settings to the registry. Before applying, inspect (and change) the paths for Firefox.exe and the custom icon file accordingly, so as to match the paths in your system.
With Google Chrome as the default PDF Viewer
If Google Chrome is your default PDF viewer, here is how to change the PDF file icon:
- Start the Registry Editor (Regedit.exe) and go to:
HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\Google Chrome\Capabilities\FileAssociations
- Double-click .pdf and set its value data as ChromePDF
- Select HKEY_CLASSES_ROOT, and create a new subkey named ChromePDF
- With ChromePDF selected, double-click (default) and set its value data to PDF FileWhat you mention here is displayed in the Type column in Details view and in the Preview pane. You can type in any description as you’d like, say “Chrome PDF Document”.
- Under ChromePDF, create a subkey named DefaultIcon
- Select DefaultIcon and double-click the (default) value in the right pane.
- Type in the .ico file with full path there.
- Then create the following key:
HKEY_CLASSES_ROOT\ChromePDF\shell\open\command
Note: The “shell” key doesn’t exist by default. You need to create it, and its subkeys as above, manually.
- With the above key selected, double-click (default) and set it’s value data as follows:
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" -- "%1"
That assumes Chrome.exe is located under
C:\Program Files (x86)
, which is the default installation folder in a Windows x64 system. The Program Files path would beC:\Program Files
in an x86 system. Or, if you’ve installed Chrome under your user profile, type the appropriate path. You can find the Chrome.exe file location by right-clicking on the Google Chrome shortcut in the Taskbar or Start menu and checking its properties.
You now have the following registry keys/structure:
HKEY_CLASSES_ROOT | ChromePDF |_ DefaultIcon |_ shell |__ open |___ command
REG file for the above settings
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\ChromePDF] @="Chrome PDF Document" [HKEY_CLASSES_ROOT\ChromePDF\DefaultIcon] @="\"C:\\Program Files (x86)\\Google\\Chrome\\Application\\pdf.ico\"" [HKEY_CLASSES_ROOT\ChromePDF\shell\open\command] @="\"C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe\" -- \"%1\"" [HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\Google Chrome\Capabilities\FileAssociations] ".pdf"="ChromePDF"
Set (Reset) Chrome or Firefox as the Default PDF Viewer
After you apply the registry settings mentioned above, reset the file association for PDF files to Microsoft Edge (or any other program), and then set it back to Google Chrome or Mozilla Firefox, using the Open with dialog, or Default Apps or Default Programs.
In Windows 10, open Settings → Apps → Default Apps to set the default browser.
In earlier versions of Windows, use the Default Programs applet in the Control Panel. Instructions are provided below:
Open classic Control Panel by right-clicking Start, and click Control Panel. Set the view type to icons, and click Default Programs.
Click Set your default programs, select Google Chrome or Mozilla Firefox from the list, and click “Choose defaults for this program”.
Select .pdf from the list, and click Save.
That’s it! You’ve now changed the PDF file type icon, and the association set to Google Chrome or Mozilla Firefox.
One small request: If you liked this post, please share this?
One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:- Pin it!
- Share it to your favorite blog + Facebook, Reddit
- Tweet it!
How can I do The same thing, but with chrome as default PDF reader
Thanks for the info!
I think you have the registry/keys structure diagram (for Chrome PDF viewing) wrong. You show “shell” as a sub-key of “DefaultIcon,” unless I don’t know how to read that kind of diagram
@David. Thanks for the heads up. I’ve fixed it. The .reg file contents are perfect, though.
Make sure you do NOT put .ico at the end of your icon’s name or it will fail. Only include it in the path.
For example, if your path is
“C:\Program Files (x86)\Google\Chrome\Application\pdf.ico”
your icon has to be named
[ pdf ] and not [ pdf.ico ]
I fell into the trap you did mention. But it still doesn’t work after I had made this change. Do I need to make sure the file type stays as an .ico even thou I leave out the extension from the name, and if so – how do I do that?
thank you .it was helpful.I changed my icon
Great explanation and worked fine for me!
If you’re searching for a Windows 11 style PDF icon, I’ve created one: https://t1p.de/976b
2 things for me:
My chrome installation defaulted to Program Files, not Program Files (x86) so I changed that.
Additionally, it wasnt working even after restarting until I actually tried to open a PDF. Then it asked which program I wanted to use. I chose chrome, and made sure the checkbox was checked to always open PDF files in chrome. That’s when the icons changed.
Hey, I used the provided registry text, and it did not work for Firefox. Then I repeated the whole process multiple times, did not work. Tried doing it for Chrome – worked the first time. Could you help me out pls?
@hello: Please run DARF.vbs and run it. Type firefox and press Enter. It outputs a text file, which you please upload and share the link here.
Thank you very much, it worked.
After I finished modifying the registry, nothing changed, so I tried opening a pdf by double-clicking and it made me choose again what program to use, and there was an option for chrome with “new” under it, so I suspected it had to do with my edits. I chose that and sure enough, the icon changed to the on I’ve set and now the pdfs open with chrome.