The quickest way to change a file extension
To change a file extension in Windows 10, right-click the file, select Rename, and edit the text after the final period. For example, change document.txt to document.docx. Press Enter when you're done. Windows will ask you to confirm the change — click Yes.
This method works for any file type, but you need to see the extension first. By default, Windows 10 hides extensions for known file types. If you don't see the period and letters at the end of your filename, you'll need to turn on the display of extensions before you can rename one.
Changing an extension only changes the label Windows uses to identify the file — it doesn't convert the actual contents. A JPEG image renamed to .PNG is still a JPEG file that won't open correctly in programs expecting PNG data. The file extension tells Windows which program to use when you double-click the file, so mismatched extensions can cause errors or prevent the file from opening at all.
Key Takeaways
- Right-click any file, choose Rename, and edit the text after the period to change its extension.
- Windows 10 hides file extensions by default, so you may need to turn on the display of extensions in File Explorer settings first.
- Changing the extension only changes the label — it does not convert the file's actual contents or format.
- Mismatched extensions can prevent files from opening or cause programs to display errors.
- Some system files and protected files cannot be renamed, and Windows will block the change with an error message.
Turn on the display of file extensions
Open File Explorer by pressing Windows key + E or clicking the folder icon on your taskbar. In the top menu bar, click the View tab. On the right side of the ribbon, check the box next to File name extensions. All files in File Explorer will now show their extensions.
Once extensions are visible, you can rename any file by right-clicking it and selecting Rename. The entire filename, including the extension, will be highlighted. Use the arrow keys or mouse to position your cursor, then change only the letters after the final period. Leave the period itself in place — Windows needs it to separate the filename from the extension.
This setting stays on until you turn it off again. It applies to all folders and drives you view in File Explorer, so you won't need to repeat this step for future renames.
Rename a file using the command line
If you prefer using the command line, press Windows key + R, type cmd, and press Enter to open Command Prompt. Navigate to the folder containing your file by typing cd C:\Users\YourUsername\Documents (replace the path with your actual folder location). Then type ren oldname.txt newname.docx and press Enter.
The ren command (short for rename) changes the filename and extension in one step. You must type the full filename with the old extension, then the full filename with the new extension. If your filename contains spaces, wrap it in quotation marks: ren "old file name.txt" "new file name.docx".
This method is faster if you need to rename many files at once, but it requires you to know the exact folder path and current filename. Command Prompt will display an error message if the file doesn't exist or if the name is invalid.
Batch rename multiple files at once
To rename many files with the same extension at once, select all of them in File Explorer by clicking the first file, holding Ctrl, and clicking each additional file. Right-click any selected file and choose Rename. Type the new extension and press Enter. Windows will rename all selected files to the new extension.
This works only when you're changing the extension — the base filename stays the same for each file. If you have files named photo1.jpg, photo2.jpg, and photo3.jpg and you rename them all to .png, they become photo1.png, photo2.png, and photo3.png.
For more complex batch renaming — such as adding a prefix to all filenames or changing only some files in a folder — use the built-in PowerShell or a third-party batch rename tool. These tools let you explore rules to many files at once without selecting each one individually.
Common mistakes and how to avoid them
The most frequent error is changing the extension without understanding what the file actually contains. A video file renamed from .mp4 to .avi won't suddenly become an AVI file — it's still an MP4 file that may not play in programs expecting AVI format. Only change the extension if you've actually converted the file using appropriate software, or if you're correcting a mislabeled file that already contains the right data.
Another common mistake is accidentally deleting the period when editing the extension. If you type documenttxt instead of document.txt, Windows treats the entire string as the filename with no extension. The file will still exist, but Windows won't know which program to use when you try to open it. Always keep the period in place and change only the letters after it.
Some files cannot be renamed because Windows protects them. System files, files currently open in another program, and files in protected folders will display an error message when you try to rename them. Close any programs using the file, or move the file to a folder where you have full permissions, then try renaming again.
When to change a file extension
Change a file extension when you've converted a file to a new format using software designed for that conversion. For example, if you use an image editor to save a JPEG as a PNG file, the software will automatically give it the .png extension. You should never need to rename it manually.
You may also need to change an extension if a file was mislabeled — for instance, if a document was saved as resume.txt but should be resume.docx because it contains Word formatting. In this case, the file's actual contents match the new extension, so the rename will work correctly.
Do not change extensions to trick Windows into opening a file with a specific program. If you rename a text file to .docx to force it to open in Microsoft Word, Word will display an error because the file doesn't contain Word data. The correct approach is to open the file with the program you want, then save it in the format that program supports.
Frequently Asked Questions
Why does Windows hide file extensions by default?
Windows hides extensions to make filenames cleaner and less confusing for users who don't need to see them. Most people interact with files by double-clicking them, and the extension is invisible in that workflow. Hiding extensions also prevents accidental changes that could break a file. You can turn the display back on in File Explorer's View settings whenever you need to see or edit extensions.
Can I change a file extension to make it open in a different program?
Changing the extension will make Windows try to open the file with a different program, but the file's contents won't change. If the contents don't match the new extension, the program will display an error or refuse to open the file. To actually convert a file to a new format, use software designed for that conversion — for example, use an image editor to save a JPEG as PNG, not just rename it.
What happens if I change a file extension by mistake?
You can undo the change when ready by pressing Ctrl + Z in File Explorer, or by right-clicking the file again, selecting Rename, and typing the correct extension back. If you've already closed File Explorer, you can still rename the file manually using the same right-click method. Windows keeps the file's data intact — only the label changes.
Can I remove the file extension entirely?
Yes, you can rename a file to have no extension at all. Right-click the file, select Rename, delete the period and the letters after it, and press Enter. Windows will ask you to confirm. The file will still exist and contain the same data, but Windows won't know which program to use when you double-click it. You'll need to right-click and choose "Open with" to select a program manually.
Do I need administrator permission to change a file extension?
For most files in your Documents, Downloads, or Desktop folders, you do not need administrator permission. If you're trying to rename a file in a protected system folder or a file that's currently in use by another program, Windows will display a permission error. Close the program using the file, or move the file to a folder where you have full permissions, then try renaming again.