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

If you’ve associated PDF files with Mozilla Firefox to make use of Firefox’s built-in PDF viewing capability, the PDF and HTML files would show up with the same Firefox icon in File Explorer. This post tells you how to set a custom different icon for PDF files, with Firefox as the default PDF viewer.

change firefox pdf file icon

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. For this post, I used this icon from IconsPedia.

Add .PDF File Type to Firefox’s Default Programs Registration

1. Start the Registry Editor (Regedit.exe) and go to:


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:


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) folder, in a Windows x64 system. The Program Files path would be C:\Program Files in a 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.

So you now have the following registry keys/structure.

| FirefoxPDF
|-- DefaultIcon
|-- shell
|---- open
|----- command

REG file for the above settings

To automate steps 1-10 above, you can use the REG file below:

Windows Registry Editor Version 5.00

@="PDF File"

@="C:\\Program Files (x86)\\Mozilla Firefox\\Pdf.ico"


@="\"C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe\" -osint -url \"%1\""



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.

Set Firefox as the Default PDF Viewer

Now, reset the file association for PDF files to Microsoft Edge (or any other program), and then set it back to Mozilla Firefox, using the Open with dialog. Another option is to use the Default Programs applet.

Open classic Control Panel by right-clicking Start, and clicking Control Panel. Set the view type to icons, and click Default Programs.

Click Set your default programs, select 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 Mozilla Firefox.

change firefox pdf file icon

About the author

Ramesh Srinivasan founded back in 2005. He is passionate about Microsoft technologies and has a vast experience in the ITeS industry — delivering support for Microsoft's consumer products. He has been a Microsoft MVP [2003 to 2012] who contributes to various Windows support forums.

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

Comments are closed.