Set Custom icon for PDF Files with Chrome or Firefox as the Default PDF Viewer

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.

change firefox pdf file icon

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

  1. Start the Registry Editor (Regedit.exe) and go to:
    HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartmenuInternet\FIREFOX.EXE\Capabilities\FileAssociations
  2. In the right-pane, create a DWORD value named .pdf
  3. Double-click .pdf and set its value data to FirefoxPDFchange firefox pdf file icon
  4. Select HKEY_CLASSES_ROOT, and create a new subkey named FirefoxPDF
  5. With FirefoxPDF selected, double-click (default) and set its value data to PDF Filechange firefox pdf file icon

    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”.

  6. Under FirefoxPDF, create a subkey named DefaultIcon
  7. Select DefaultIcon and double-click the (default) value in the right pane.change firefox pdf file icon
  8. Type in the .ico file with full path there.
  9. 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.

  10. 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"

    change firefox pdf file icon

    That assumes Firefox.exe is located under C:\Program Files (x86) in a Windows x64 system. The Program Files path would be C:\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:

  1. Start the Registry Editor (Regedit.exe) and go to:
    HKEY_LOCAL_MACHINE\SOFTWARE\Clients\StartMenuInternet\Google Chrome\Capabilities\FileAssociations
  2. Double-click .pdf and set its value data as ChromePDFchrome pdf icon default viewer
  3. Select HKEY_CLASSES_ROOT, and create a new subkey named ChromePDF
  4. 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”.
  5. Under ChromePDF, create a subkey named DefaultIcon
  6. Select DefaultIcon and double-click the (default) value in the right pane.
  7. Type in the .ico file with full path there.
  8. 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.

  9. 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"

    chrome pdf icon default viewer

    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 be C:\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.

chrome pdf icon default viewer



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”.

change firefox pdf file icon

Select .pdf from the list, and click Save.

change firefox pdf file icon

That’s it! You’ve now changed the PDF file type icon, and the association set to Google Chrome or Mozilla Firefox.

change firefox pdf file icon


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!
So thank you so much for your support. It won't take more than 10 seconds of your time. The share buttons are right below. :)

Ramesh Srinivasan is passionate about Microsoft technologies and he has been a consecutive ten-time recipient of the Microsoft Most Valuable Professional award in the Windows Shell/Desktop Experience category, from 2003 to 2012. He loves to troubleshoot and write about Windows. Ramesh founded Winhelponline.com in 2005.

11 thoughts on “Set Custom icon for PDF Files with Chrome or Firefox as the Default PDF Viewer”

  1. 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

    Reply
  2. 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 ]

    Reply
    • 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?

  3. 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.

    Reply
  4. 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?

    Reply
  5. 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.

    Reply

Leave a Reply to Rodrigo Chaves Cancel reply