It `s important to note that changing the file extension (now we’re going to look at different ways of doing it), the file type doesn’t change. If therefore, you change the extension to an image file making it look like a text file, the system will try to open it with the program that opens text files, giving however error and considering it not readable.
The change file extension is, therefore, a delicate operation that requires attention, but which however is important to know how to do to save the files so that they are opened with the right program and more appropriate. There are different ways to change the file extension, so let’s see the ones that are simpler and within reach.
Save a file with a different extension
The following procedure applies to any type of file and is safe because it allows changing the file extension without being able to make mistakes.
- Open a file in its default program (for example a text file .jpg with the Irfanview viewer).
- Click on the File menu and press Save with name.
- Choose the folder where to save the file and give it a name.
- In the dialog box Save with name, below the box where the name is written, you will find a drop-down menu with a label Save as which shows a list of all file types that can save the program you are using (if you are using Irfanview, it will be able to save an image in all the most common image formats, for example, a JPG can be saved as .png, .webp, .bmp, etc. files)
- The original file will not be modified and in this case, a copy of that file will be created with a different extension.
This type of modification can be useful for converting images to different formats that may be more or less compressed.
Rename the file to change the extension
The extension of a file is found in its name, but it is hidden by default. To discover it and make it visible, in Windows 10, open any folder and then press top on the menu View. In the menu that opens, look for the option File name extensions and activate it. Note that this option would then be better to turn it off when finished with the changes because leaving it activated will run the risk of inadvertently changing the extension of a file every time you try to rename it).
At this point, the file names will all be displayed with a dot and extension, for example, test.txt or How2do.org.
To change the extension, simply press the file with the right mouse button, go to rename and change the part to the right of the point. Before saving the change, Windows 10 will ask for confirmation, warning that the file extension has been changed and that the file may no longer be usable.
In reality, in case of errors, you can always return the extension by putting the real one. We have seen in another article how to do it if a file does not open because the extension is unknown or if it uses the wrong program.
Change the extension of all files in a folder
If you need to change the extension of all files of a certain type in a folder, you need to open the command prompt. From the Start menu, search cmd and open the command prompt of Windows 10. If we need to enter a specific folder on the command prompt, we should instead right-click on that folder while holding down the Shift key and then select Open command prompt from here or Open Powershell window from here.
The commands to use to change extension are the following:
REN foo.txt foo.html (change the txt file called Pippo in an Html file)
REN * .txt * .html (change all txt files in the folder to html file)
If you want to change multiple file extensions together you can also use a program like Bulk Extension Changer that makes everything easier.
When it may be necessary to change file extensions
Usually, it is not necessary to change file extensions, except in some specific cases, such as:
– You can break down a file generated by an Office program such as Word or Excel into its elements, by changing the file extension from .docx or .xlsx to .zip.
– You can change the extension to a system file to save an intact copy if you make changes (as seen, for example, for the trick that allows you to enter Windows without a password).
– Convert the format of an image file, but this must be done using the visualization program as seen in the first point.
– Convert video to a different format (eg .mp4) or to an audio file (.mp3); to do this, however, a program is needed to convert video.
Finally, remember that it is possible to associate a program with a particular file depending on its extension. We have seen how to do this in the guide on how to change the program to open a file in Windows.