You can change a file extension by renaming the file, but the file type itself does not change
A file extension is the short code after the dot at the end of a filename — like .txt, .jpg, or .pdf. Changing the extension is as straightforward as renaming the file. Right-click the file, select rename, and type a new name with a different extension. However, this only changes the label. The actual file format stays the same. A photo saved as .jpg will still be a photo if you rename it to .txt — it just will not open correctly in a text editor.
The reason this matters: your computer uses the extension to decide which program opens the file. If you change .jpg to .pdf, your computer will try to open it with a PDF reader, which will fail. The file itself has not transformed into a PDF. To actually convert a file from one format to another, you need conversion software or a program that can save in the new format.
Key Takeaways
- Renaming a file extension takes seconds but does not change what the file actually is — only what program your computer tries to use to open it.
- Windows hides file extensions by default, so you may need to turn on the option to see them before you can rename them.
- Changing an extension can break a file if the new extension does not match the actual format, so only change it if you know what you are doing.
- To actually convert a file from one format to another — like JPG to PNG — you need conversion software, not just a rename.
How to see file extensions on Windows
Windows hides file extensions by default, so you may see "photo" instead of "photo.jpg". To turn them on, open File Explorer and look at the top menu. Click the View tab, then check the box next to "File name extensions". From then on, you will see the full filename with the extension.
Once extensions are visible, right-click any file and select Rename. The entire filename, including the extension, will highlight. Type the new name with the new extension and press Enter. Windows will ask if you are sure you want to change the extension — click Yes.
How to see and change file extensions on Mac
On Mac, extensions are usually hidden too. To see them, click the file once to select it, then press Command and I together to open the Info window. Look for the filename field at the top. You can edit it there and add a new extension.
Alternatively, right-click the file and select Rename. The filename will become editable. Type the new name with the new extension and press Enter. Mac will warn you that changing the extension may make the file unusable — this is the warning mentioned above. Click Use the new name if you want to proceed.
How to change file extensions on Linux
Linux shows file extensions by default in most file managers. Right-click the file and select Rename, or press F2 with the file selected. Type the new filename with the new extension and press Enter. Linux does not warn you before allowing the change, so be certain of what you are doing.
If you are using the terminal, the command is straightforward: mv oldname.oldext newname.newext. Replace the parts in italics with your actual filename and extensions. Press Enter and the rename is done.
When changing an extension actually works
Changing an extension works without breaking anything when the file format and the extension already match, but you just want the computer to treat it differently. For example, some text editors save files as .txt by default, but you want to use the file as code. You can rename it to .html or .py and the file will open in the right program — because the content inside is already HTML or Python code.
Another case: you have a file that is actually a ZIP archive but was saved with a .rar extension by mistake. If you rename it to .zip, your computer will open it with the correct program. The file itself was always a ZIP — only the label was wrong.
When changing an extension breaks things
Renaming a JPG photo to .pdf will not turn it into a PDF. Your computer will try to open it with a PDF reader, which will fail because the file is still image data, not PDF data. The same goes for renaming a Word document to .txt or a video file to .mp3. The content does not change, only the label.
If you need to actually convert a file to a different format, use software designed for that. For photos, use an image editor like GIMP or Photoshop, or an online converter. For documents, use the Save As option in the program that created it — Word can save to PDF, for example. For video, use a converter like HandBrake or FFmpeg.
Why file extensions matter for organization
Extensions help you organize files by type. When you sort by extension, all your photos group together, all your documents group together, and so on. If you change extensions randomly, you lose that organization and make it harder to find things. It also confuses your computer about which program should open each file.
If you are organizing files and want to change how they are grouped, rename them in a way that makes sense — add a category prefix like "2024_photo_" or "invoice_" — but keep the original extension. That way the file still works and you still get the organization you want.
Frequently Asked Questions
Will changing a file extension delete or damage the file?
No. The file itself stays exactly the same. Only the label changes. However, your computer may not be able to open it if the new extension does not match what the file actually is. The file is not damaged — it just will not open in the program your computer tries to use.
Can I change a file extension back if I make a mistake?
Yes. Right-click the file, select Rename, and type the original extension back. Press Enter and you are done. As long as you remember what the original extension was, you can undo any rename.
What if I need to convert a file to a completely different format?
Renaming the extension will not do it. You need software that actually converts the file. For photos, use an image editor or online converter. For documents, use Save As in the program that created it. For video, use a dedicated converter like HandBrake.
Why does Windows hide file extensions by default?
Microsoft hides them to make filenames look cleaner to new users. However, hiding them also makes it easier to accidentally change an extension and break a file. Most people who organize files regularly turn extensions back on.
Can I have a file with no extension?
Yes. You can rename a file to have no extension at all. However, your computer will not know which program to use to open it, so you will have to choose manually every time. It is not recommended unless you have a specific reason.