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 FirefoxPDF

    change 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 File

    change 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 ChromePDF

    chrome 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 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 “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

About the author

Ramesh Srinivasan founded Winhelponline.com back in 2005. He is passionate about Microsoft technologies and he has been a Microsoft Most Valuable Professional (MVP) for 10 consecutive years from 2003 to 2012.

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

Leave a Comment