What a file extension is and why you might want to change it
A file extension is the short code at the very end of a filename that tells your computer what kind of file it is. It comes after the dot — the .pdf in "resume.pdf" or the .jpg in "photo.jpg". Your computer uses that extension to decide which program opens the file.
You might want to change an extension if you've saved something in the wrong format, if a file got corrupted and lost its extension, or if you're converting a file from one type to another. Changing the extension itself is straightforward — it's a few clicks or keystrokes. But it's worth understanding what actually happens when you do it, because renaming the extension doesn't change what's inside the file.
Key Takeaways
- A file extension is the three or four letters after the dot in a filename, and it tells your computer which program should open that file.
- You can change an extension by right-clicking the file, selecting Rename, and typing a new extension — but this only changes the label, not the file's actual format.
- Changing a .jpg to a .png won't convert the image; it will just confuse your computer about what program to use.
- To actually convert a file from one format to another, you need to use a program designed for that conversion, like an image editor or a document converter.
- Some files have hidden extensions by default on Windows and Mac, so you may need to turn on "show file extensions" in your settings before you can edit them.
How to change a file extension on Windows
On Windows, file extensions are often hidden by default. First, you need to make them visible. Open File Explorer, click the View tab at the top, and check the box next to "File name extensions". Now you'll see the full filename including the dot and the letters at the end.
Once extensions are visible, right-click the file you want to rename. Select "Rename" from the menu. The entire filename, including the extension, will highlight. Type the new name and extension — for example, change "document.txt" to "document.pdf" — then press Enter. Windows will ask you to confirm that you want to change the extension. Click "Yes" and you're done.
If you don't see the confirmation dialog, it means extensions were still hidden. Go back to View settings and make sure "File name extensions" is checked, then try again.
How to change a file extension on Mac
On Mac, extensions are usually visible by default, but some files hide them. Click once on the file to select it, then press Command and I together to open the file information window. Look for a checkbox that says "Hide extension" — if it's checked, uncheck it. Close the window and the extension will now be visible in the filename.
Now right-click the file and select "Rename". The filename will become editable. Type the new name and extension, then press Enter. Mac will ask whether you want to keep the old extension or use the new one. Choose "Use the new extension" and the change is complete.
The difference between renaming an extension and converting a file
This is the most important part: changing the extension in the filename does not change what the file actually is. If you rename "photo.jpg" to "photo.png", your computer will try to open it with a PNG viewer, but the file is still a JPG inside. It might not open at all, or it might open but look wrong.
To actually convert a file from one format to another, you need to use a program designed for that work. For images, you can use free tools like GIMP or online converters. For documents, you can open a .docx file in Microsoft Word and save it as a .pdf using "Save As". For audio files, programs like Audacity can convert between formats. The program does the real work of changing the file's internal structure — renaming the extension just changes the label.
When changing an extension might cause problems
If you change an extension to something your computer doesn't recognize, the file might not open at all. Windows and Mac will show you a dialog asking which program you want to use, but if you pick the wrong one, the file will open in a program that can't read it.
Some files are critical to how your computer works — like .exe files on Windows or .app files on Mac. Changing the extension on these files can break them. Stick to changing extensions on files you created yourself or downloaded, not on system files.
If you change an extension and the file stops working, you can always change it back. Right-click, rename, and type the original extension. As long as you remember what it was, you can undo the change.
Common file extensions and what they mean
Here are extensions you'll see most often and what they tell your computer:
| Extension | File Type | Common Programs |
|---|---|---|
| Portable Document Format | Adobe Reader, web browsers, most programs can open | |
| .docx | Microsoft Word document | Microsoft Word, Google Docs, LibreOffice |
| .txt | Plain text | Notepad, any text editor |
| .jpg or .jpeg | Image file | Photo viewers, web browsers, image editors |
| .png | Image file with transparency | Photo viewers, web browsers, image editors |
| .mp3 | Audio file | Music players, media players |
| .mp4 | Video file | Video players, media players, web browsers |
| .zip | Compressed folder | File explorer (Windows and Mac can open natively) |
Frequently Asked Questions
Can I change a file extension to make my computer open it with a different program?
Changing the extension will make your computer try to open it with a different program, but it won't work well if the file format doesn't match. A better approach is to right-click the file, select "Open with", and choose the program you want. This doesn't change the file at all — it just tells your computer to use a different program this time.
What happens if I change a .txt file to a .pdf?
Your computer will try to open it with a PDF reader, but the file is still plain text inside. The PDF reader probably won't be able to read it, or it will open and show garbled text. To actually convert a text file to PDF, open it in a word processor like Microsoft Word or Google Docs and use "Save As" to save it as a PDF.
Is it safe to change file extensions?
It's safe to change extensions on files you own — photos, documents, downloads. If you change it wrong, you can always change it back. Avoid changing extensions on files that came with your computer or programs, especially .exe or .app files, because those are system files and changing them can break things.
Why do some files not show an extension?
Windows and Mac hide extensions by default for files they recognize, to make filenames look cleaner. You can turn on "show file extensions" in your settings anytime. On Windows, it's in File Explorer View settings. On Mac, it's in the file's Get Info window.
Can I change a file extension to hide what type of file it is?
You can change the extension, but anyone who opens the file will see what it actually is once a program tries to read it. Changing the extension doesn't hide the file's contents — it just changes the label. If you want to keep a file private, use encryption or password protection instead.