Renaming a file type means changing the extension, not just the filename
When you rename a file type — technically called changing the file extension — you are changing the three or four letters after the dot at the end of the filename. A file called report.pdf has the extension .pdf. If you change it to report.docx, you have changed the file type from a PDF to a Word document. Your operating system uses that extension to decide which program opens the file, so changing it can break how the file works.
The process itself is straightforward on any operating system: you find the file, locate the extension, and type a new one. But before you do, you should understand what actually happens when you change an extension, and when it is safe to do so.
Key Takeaways
- Changing a file extension does not convert the file's contents — it only tells your computer which program should open it, so renaming a PDF to .docx will not make it editable in Word.
- On Windows, you must turn on "Show file extensions" in File Explorer settings before you can see or edit the extension.
- On Mac, right-click the file, select "Get Info", and change the extension in the "Name & Extension" field at the top.
- Safe extension changes include renaming image files between formats that your photo software already supports, or renaming text files to match the format they actually contain.
- Renaming system files or files you do not recognize can prevent programs from working — only change extensions on files you created or downloaded yourself.
Why changing an extension does not change what the file actually is
A file extension is a label, not a container. Changing photo.jpg to photo.png does not convert the image data inside — it just tells your computer to treat it as a PNG. If you open it in an image viewer, it may display correctly because many viewers can read both formats. But if you open it in a program that strictly expects PNG data, it may fail or display corrupted.
This matters most when you are trying to make a file work with a specific program. If you have a Word document saved as a text file (.txt) and you rename it to .docx, Word may open it, but it will not have any of Word's formatting — bold, italics, tables, or styles. The file contents have not changed; only the label has. Conversely, if you rename a Word document to .txt, you lose all formatting when you open it in a text editor, because the text editor ignores the formatting data that Word stored.
The only time renaming an extension actually converts a file is when you use a program designed to do that conversion. For example, using an image converter tool to change a JPG to a PNG creates a new file with converted data. Simply renaming the extension does not do this work.
How to rename a file extension on Windows
Windows hides file extensions by default, so your first step is to make them visible. Open File Explorer, click the "View" tab at the top, and check the box next to "File name extensions". Now all your files will show their extensions.
Find the file you want to rename, right-click it, and select "Rename". The entire filename including the extension will be highlighted. You can now edit the extension. For example, if the file is document.txt, you can change it to document.docx. Press Enter when you are done. Windows will ask you to confirm that you want to change the extension — click "Yes".
If you only want to rename the filename itself and keep the extension the same, click once on the file to select it, then click again slowly on just the filename part (before the dot). This lets you edit only that part without touching the extension.
How to rename a file extension on Mac
On a Mac, right-click the file and select "Get Info" from the menu. A window will open showing details about the file. At the top, you will see a field labeled "Name & Extension" with the full filename. Click in that field and edit the extension. For example, change photo.jpg to photo.png. Press Enter to save the change.
If the extension field is grayed out and you cannot edit it, the file may be locked. In the same Get Info window, look for a checkbox at the bottom that says "Locked". Uncheck it, then try editing the extension again.
You can also rename just the filename without the extension by clicking once on the file, waiting a moment, then clicking again on only the name part before the dot. This works the same way as on Windows.
How to rename a file extension on Linux
On Linux, the process depends on which file manager you use, but the principle is the same. In most file managers (like Nautilus on GNOME or Dolphin on KDE), right-click the file and select "Rename". The filename including extension will be highlighted. Edit the extension and press Enter.
If you prefer the command line, you can use the mv command. For example, to rename document.txt to document.md, you would type: mv document.txt document.md and press Enter. This is faster if you are renaming many files at once, but it requires familiarity with terminal commands.
When it is safe to rename a file extension
Renaming an extension is safe when you know what the file actually contains and you are changing it to match. If you have a text file that contains Markdown code but it is named notes.txt, renaming it to notes.md is safe — the contents have not changed, you are just telling your computer to open it with a Markdown editor instead of a plain text editor.
It is also safe to rename image files between formats that your image viewer or editor already supports. If you have a JPG file and you rename it to PNG, most image viewers will still open it correctly because they can read both formats. However, if you then try to edit it in a program that strictly expects PNG data, you may run into problems.
Never rename the extension of system files, program files, or files you do not recognize. If you rename system32.dll to system32.txt, Windows may stop working. If you rename a file that came with an installed program, that program may fail to launch. Only change extensions on files you created yourself or downloaded from a source you trust.
What to do if you renamed a file and it will not open
If you renamed a file and now it will not open, the most likely reason is that the extension does not match what the file actually contains. The simplest fix is to rename it back to its original extension and try again.
If you cannot remember the original extension, you can try opening the file with a different program. Right-click the file, select "Open with" (on Windows or Mac) or "Open With" (on Linux), and choose a different program from the list. For example, if a file will not open in Word, try opening it in a text editor to see if it contains readable text. This can help you figure out what the file actually is and what extension it should have.
If the file is important and you are not sure what went wrong, do not keep trying different extensions. Instead, check if you have a backup of the file, or ask the person who sent it to you what program it is supposed to open in.
Frequently Asked Questions
Can I change a file extension to make it open in a different program?
Changing the extension will make your computer try to open it with a different program, but the file contents will not change. If the program expects a different format, it may fail to open or display incorrectly. This works best when you are changing between formats that the program actually supports.
What happens if I rename a file extension and then change it back?
If you rename a file and then rename it back to the original extension, the file will work exactly as it did before. The file contents are never altered by renaming the extension, so reverting the name restores normal function.
Can I remove the extension entirely?
Technically yes, but it is not recommended. Without an extension, your operating system will not know which program should open the file. You can still open it by right-clicking and choosing a program manually, but it becomes harder to work with.
Is it safe to rename a file extension if I do not know what the file is?
No. If you do not recognize a file or do not know what it contains, do not change its extension. Renaming system files or program files can break your computer. Only rename files you created yourself or files you downloaded and understand.
Do I need special software to rename a file extension?
No. Your operating system's built-in file manager has everything you need. On Windows, Mac, and Linux, you can rename any file extension by right-clicking and selecting rename, or by using the rename function in your file manager.