What a file extension is and why you might change it
A file extension is the short code at the end of a filename — the part after the dot. A file named "budget.xlsx" has the extension .xlsx, which tells your computer that the file is an Excel spreadsheet. A file named "photo.jpg" has the extension .jpg, which tells your computer it is a photograph.
You might need to change an extension when you save a file in a different format than the original. For example, if you export a photo from your phone as a .heic file but need it as a .jpg to upload somewhere, you would change the extension. Or if you receive a document that was saved as .doc but your software only opens .docx files, renaming the extension might let you open it.
Changing the extension itself does not convert the file — it only changes the label. If you rename a photo from .jpg to .txt, your computer will try to read it as text, and you will see garbage. The actual data inside stays the same. To truly convert a file from one format to another, you need software that understands both formats and can rewrite the data.
Key Takeaways
- On Windows, right-click the file, select Rename, change the text after the dot, and press Enter.
- On Mac, select the file, press Return (not Enter), change the text after the dot, and click Rename in the dialog that appears.
- On Linux, right-click the file, select Rename, change the text after the dot, and press Enter — or use the command line with the mv command.
- Changing the extension only relabels the file; it does not convert the data inside, so the file may not open or work correctly unless you have actually converted it with software first.
- If you cannot see the extension at all, you need to turn on the display of file extensions in your system settings.
How to change an extension on Windows
On Windows 10 and 11, extensions are usually hidden by default. To see them, open File Explorer, click the View tab at the top, and check the box next to "File name extensions." Now you will see the full filename including the dot and the extension.
Once you can see the extension, right-click the file you want to rename. A menu will appear. Click "Rename" (or press F2 while the file is selected). The filename will become editable — the text will be highlighted in a box. Use your keyboard to move to the end of the filename and change only the extension part (the letters after the dot). For example, change "photo.jpg" to "photo.png". Press Enter when you are done.
Windows will ask you to confirm the change, because changing an extension can break a file if the new extension does not match what is actually inside. Click "Yes" to confirm. The file is now renamed, though it may not open correctly in the new format unless you have already converted it with software.
How to change an extension on Mac
On Mac, extensions are usually visible by default. If you do not see the extension, open Finder, click Finder in the menu bar, select Preferences, click the Advanced tab, and check "Show all filename extensions."
Once you can see the extension, select the file you want to rename and press Return (the key labeled Return on a Mac keyboard, not the numeric keypad). The filename will become editable in a box. Change only the extension part — the letters after the dot. For example, change "document.doc" to "document.docx". When you are done typing, press Return again.
A dialog box will appear asking whether you want to use the new extension or keep the old one. Click "Use [new extension]" to confirm the change. The file is now renamed, though opening it may fail if the new extension does not match the actual file format.
How to change an extension on Linux
On Linux, the method depends on whether you are using a graphical file manager or the command line. Most Linux desktop environments (like Ubuntu with GNOME or Fedora with KDE) show extensions by default in their file managers.
In a graphical file manager, right-click the file and select "Rename." The filename will become editable. Change the extension part — the letters after the dot — and press Enter. The file is renamed when ready without a confirmation dialog.
If you prefer the command line, open a terminal and use the mv command (short for move, which also renames files). The syntax is: mv oldfilename.oldextension newfilename.newextension. For example, mv photo.jpg photo.png. Press Enter to execute the command. The file is renamed when ready.
When changing an extension actually works
Changing an extension works smoothly when the file has already been saved in the format you want, but with the wrong label. This happens most often when you export or read a file and the extension gets lost or mismatched. For example, if you read a photo from a website and it arrives as "image" with no extension, you can rename it to "image.jpg" and it will open as a photo.
It also works when you are moving a file between systems that use different naming conventions. Some older software saves files with extensions like .doc or .xls, while newer versions use .docx or .xlsx. If the file was actually saved in the newer format but labeled with the old extension, renaming it to the new extension will let the new software recognize and open it.
You can test whether a rename will work by trying to open the file after you change the extension. If it opens and looks correct, the rename was successful. If it does not open, or opens but shows corrupted data, the file needs actual conversion, not just a rename.
When you need to convert instead of just rename
If you need to change a file from one true format to another — for example, from .jpg to .png, or from .doc to .pdf — renaming the extension will not work. You need software that can read the original format and write the new format.
For photos, you can use free tools like GIMP (available on Windows, Mac, and Linux) or online converters like CloudConvert or Zamzar. Open the file in the software, then use "Export As" or "Save As" to save it in the new format. The software will rewrite the data so the photo actually becomes a .png or .webp or whatever format you chose.
For documents, Microsoft Word can open .doc files and save them as .docx. Google Docs can import a .doc file and export it as .pdf. LibreOffice (free, on all platforms) can open and convert between many document formats. The key is that the software must understand both the format you are starting with and the format you want to end with.
Troubleshooting: File extensions you cannot see
If you cannot see the extension at all, your system is hiding it. This is the default on Windows and can be turned on or off on Mac and Linux.
On Windows, open File Explorer, click View at the top, and check "File name extensions." On Mac, open Finder, go to Finder > Preferences > Advanced, and check "Show all filename extensions." On Linux, the method varies by desktop environment, but usually you can right-click in the file manager window, select View Options or Preferences, and find a checkbox for showing extensions.
Once extensions are visible, you can rename them the same way you rename any other part of the filename. If you turn extensions back off later, the file will still have the new extension — you just will not see it displayed.
Frequently Asked Questions
Will changing the extension convert my file to the new format?
No. Changing the extension only changes the label on the file. The data inside stays exactly the same. If you rename a Word document from .docx to .pdf, it will not become a real PDF — it will just be a Word document with the wrong label, and it may not open in PDF software. To truly convert a file, you need software that can read the original format and write the new one.
What happens if I change the extension to something wrong?
The file will not open, or it will open in the wrong program and show corrupted data. You can always change the extension back to the original. If you are not sure what the original extension was, look in your file manager's history or trash, or ask whoever sent you the file.
Can I change the extension of a file that is currently open?
On Windows and Mac, the system will usually prevent you from renaming a file that is open in another program. Close the file first, rename it, then open it again with the new extension. On Linux, you can rename a file even while it is open, but the program that has it open may not recognize the change until you close and reopen the file.
Is it safe to change file extensions?
It is safe to change the extension itself — you cannot damage your computer by typing a new extension. However, changing an extension to something that does not match the actual file format can make the file unusable. Always keep a backup of the original file before experimenting with extension changes.
Why does my file manager not show extensions by default?
Windows hides extensions by default to make filenames look simpler to new users. The theory is that most people do not need to see them. However, hiding extensions can make it harder to organize files by type, which is why turning them on is usually the first step in file management.