The fastest way to change a file extension
Right-click the file, select Rename, and change the letters after the final dot. Windows will warn you that changing the extension may make the file unusable — click Yes to confirm. That is the entire process for most files.
The warning appears because Windows uses the extension to decide which program opens the file. If you rename a .txt file to .jpg, Windows will try to open it as an image even though it is still text. The file itself does not change — only the label does. Whether the file actually works in its new format depends on what is inside it, not on what you call it.
If you cannot see the file extension at all, you need to turn on the setting that shows it. This is the most common reason people think they cannot rename extensions.
Key Takeaways
- Right-click any file, select Rename, and edit the three or four letters after the final dot to change its extension.
- Windows hides file extensions by default in File Explorer, so you may need to turn on "Show file name extensions" in the View tab first.
- Changing the extension only changes the label — the actual file content stays the same, so the file may not work in the new format.
- Some files are locked by Windows and cannot be renamed; these usually have a padlock icon or are in use by another program.
How to show file extensions if they are hidden
Open File Explorer and look at the top menu bar. Click the View tab. In the ribbon that appears, look for a checkbox labeled File name extensions — it may be under a Show group. Click it to turn it on.
Once this is on, every file will display its extension. A document that was called "Budget" will now show as "Budget.xlsx". A photo that showed as "Vacation" will now show as "Vacation.jpg". The extensions were always there; Windows was just hiding them from view.
This setting stays on for all folders until you turn it off again. You only need to do this once.
What happens when you change an extension
The file itself does not change — only its name changes. If you have a Word document called "Letter.docx" and rename it to "Letter.txt", the file still contains all the Word formatting, images, and styles. But Windows will now try to open it with Notepad, and Notepad will display all that formatting as gibberish because it only reads plain text.
Some conversions work fine. A .jpg image file renamed to .png will usually open in image viewers because both formats are image files and many programs can read both. Other conversions fail completely. A .docx file renamed to .mp3 will not play as audio — it will just be unreadable noise.
The only way to know if a conversion will work is to try it. If it does not work, rename it back to the original extension and the file will function normally again.
When you cannot rename a file
Some files have a small padlock icon on them, which means Windows or another program is using the file and has locked it. You cannot rename a locked file until it is closed. Close any program that might be using it — if you have a document open in Word, close Word. If you have a photo open in an image viewer, close the viewer.
System files in Windows folders are also protected and cannot be renamed without administrator permission. If you try to rename one, Windows will ask for permission or tell you that access is denied. Do not force your way past this — these files are protected because Windows needs them to run.
If a file is not locked and you still cannot rename it, restart your computer. Sometimes a program holds onto a file even after you close it, and a restart clears those invisible locks.
Renaming multiple files at once
If you have many files with the wrong extension, you can rename them in bulk using the Command Prompt. Open Command Prompt by pressing Windows key + R, typing cmd, and pressing Enter.
Navigate to the folder containing your files by typing cd followed by the folder path — for example, cd C:\Users\YourName\Documents. Then type a command like ren *.old *.new, replacing "old" with the current extension and "new" with the extension you want. Press Enter and all files with the .old extension will be renamed to .new.
This is faster than right-clicking each file individually, but it renames every file in that folder at once. Make sure you are in the correct folder and that you want to rename all files before you run the command.
Common extensions and what they mean
File extensions are three or four letters that tell Windows what kind of file it is. Here are the ones you will see most often:
- .txt — plain text, no formatting
- .docx — Microsoft Word document
- .xlsx — Microsoft Excel spreadsheet
- .pdf — portable document format, read-only
- .jpg — compressed image format
- .png — image format with transparency
- .mp3 — compressed audio
- .mp4 — video file
- .zip — compressed folder
- .exe — executable program
If you see an extension you do not recognize, you can search for it online to find out what program opens it. Do not rename a file to an extension you do not understand unless you know what you are doing.
Why you might need to change an extension
The most common reason is that a file was saved with the wrong extension by mistake. A photo might be saved as .jpg when it should be .png, or a document might be saved as .txt when it should be .docx. Renaming fixes this quickly.
Another reason is that you are converting a file from one format to another. Some programs export files in a format you do not need, and renaming lets you tell Windows to open it with a different program. This does not always work — the file content has to actually be in the new format — but it is worth trying if the file was created by a program that supports both formats.
You might also rename a file to hide it or to prevent it from opening automatically. Renaming a .exe file to .txt will stop Windows from treating it as a program, though the file will still be unreadable as text.
Frequently Asked Questions
Can I change a file extension without right-clicking?
Yes. Click the file once to select it, press F2, and the name becomes editable. Change the extension and press Enter. This is faster than right-clicking if you are renaming many files one after another.
Will changing the extension damage the file?
Changing the extension does not damage the file itself. The data inside stays exactly the same. The file may not open or work correctly in the new format, but you can always rename it back to the original extension and it will work again.
What if I change a file extension and it stops working?
Rename it back to the original extension. Right-click the file, select Rename, and change the extension back to what it was before. The file will work normally again because the content inside has not changed.
Can I change the extension of a file that is currently open?
No. Windows will not let you rename a file that another program is using. Close the program first, then rename the file. If you try to rename while the file is open, Windows will tell you the file is in use.
Is it safe to change a .exe file extension?
Yes, it is safe. Renaming a .exe file to something else stops Windows from treating it as a program, so it will not run even if you double-click it. This is sometimes done to prevent accidental launches, but the file itself is not harmed.