How to change a file extension in Windows 10

In each operating system, the various types of files, for example images, documents, videos etc. they are distinct from each other so that the computer can associate the program with them to open them. In Windows 10, by default, the type of file, which is indicated by the so-called " extension ", is hidden. The files are distinguished from each other only by the icon with which they are represented in the folders and on the desktop, an icon that calls the program that is opened if they are clicked. For some types of files, such as videos or images, a preview appears as an icon as well as for executable files, i.e. those that open programs and games. When you enable the option that shows file extensions, they appear in the file name, with a dot in front of it. For example, pippo.jpg if it is an image or pippo.txt if it is a text file.
It is important to note that changing the file extension (now we are going to see different ways of doing it) does not change the type of file. Therefore, if 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, but giving an error and considering it unreadable.
Changing file extensions is therefore a delicate operation that requires attention, but it is nevertheless important to know how to save the files so that they are opened with the right and most appropriate program. There are several ways to change file extensions, so let's see which ones are simpler and close at hand.

Save a file with a different extension

The following procedure applies to any type of file and is safe because it allows you to change the extension of a file without making mistakes .
  • Open a file in its default program (for example a .jpg text file with the Irfanview viewer).
  • Click on the File menu and click on Save As .
  • Choose the folder where to save the file and give it a name.
  • In the Save As dialog, under the box where you write the name, you will find a drop-down menu with the Save as label that shows a list of all types of files that the program you are using can save (if you are using Irfanview, this will be able to save an image in all the most common image formats, for example a JPG can be saved as a .png, .webp, .bmp file etc.)
  • The original file will not be modified and in this case a copy of that file with a different extension will be created.
This type of editing can be useful for converting images into different formats which can be more or less compressed.

Rename the file to change extension

The extension of a file is found in its name, but is hidden by default. To find out and make it visible, in Windows 10, open any folder and then press at the top on the View menu. In the menu that opens, look for the File name extensions option and activate it. Note that this option would be better then deactivating it as soon as it is finished with the modifications, because leaving it activated you 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 the extension, for example pippo.txt or navigaweb.html .
To change the extension, just press the file with the right 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 extension has been changed to the file and that the file may no longer be usable.
In fact, in case of errors, you can always return the extension by putting the real one. We have seen in another article how to do 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 we need to change extensions to all files of a certain type within a folder, we need to open the command prompt. From the Start menu, search for cmd and open the Windows 10 command prompt. If we need to enter a specific folder on the command prompt, it is better to 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 extensions are as follows:
REN foo.txt foo.html (change the txt file called foo to an html file)
REN * .txt * .html (change all txt files in the folder to html files)
If you want to change the extensions of multiple files together, you can also use a program like Bulk Extension Changer which makes everything easier.

When it may be necessary to change file extensions

There is usually no need to change file extensions, except in some specific cases, such as:
- If you write programming code using the Windows Notepad, you can change the .txt extension of the file to .bat (if you create a batch file) or to .html (if you write a web page) or .js ( if you write javascript code) and so on.
- You can decompose 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 in case 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, which must be done using the visualization program as seen in the first point.
- Convert videos in a different format (for example .mp4) or in audio files (.mp3); to do this, however, you need a program to convert videos.
Finally, remember that it is possible to associate a program with a particular file according to its extension. We have seen how to do it in the guide on how to change a program to open a file in Windows .

Leave Your Comment

Please enter your comment!
Please enter your name here