How to change 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 file type, 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 recalls the program that opens 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, ie those that open programs and games. When you activate the option that show file extensions, these appear in the name of the file itself, with a dot in front. For example, foo.jpg if it's an image or foo.txt if it's a text file.
It `s important to note that changing the file extension (now we're going to see different ways of doing this), it doesn't change the file type. Therefore, if you change the extension of 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.
Change file extension it is, therefore, a delicate operation that requires attention, but which is nevertheless important to know how to do for save the files so they can be opened with the right program and more appropriate. There are different ways of changing file extensions, so let's see which ones are simpler and at hand.

Save a file with a different extension

The following procedure applies to any type of file and is safe because it allows change the extension of a file without being able to make 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 box, below the box where you type the name, you will find a drop-down menu labeled Save as that shows a list of all the file types that can save the program you are using (if you are using Irfanview, this will be able to save an image in all 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 will be created with a different extension.
This type of editing can be useful for converting images into different formats that can be more or less compressed.

Rename the file to change extension

A file's extension 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 the View menu at the top. In the menu that opens, look for theoption Extensions file names and activate it. Note that this option would be better then deactivate it as soon as you are done with the changes, because leaving it activated you run the risk of inadvertently changing the extension of a file every time you try to rename it).
At this point the filenames will all be displayed with a period and extension, for example foo.txt or convertresources.html.
To change the extension, just right click on the file, go to rename and change the part to the right of the point. Before saving the change, Windows 10 will ask for confirmation, informing you 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 within a folder, you 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 extension are as follows:
REN foo.txt foo.html (change the txt file named foo to an html file)
REN * .txt * .html (change all folder txt files to html files)
If you want to change the extensions of several 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

It is usually not necessary to change extension to files, except in some specific cases, such as:
- If you write programming code using Windows Notepad, you can change the .txt extension of the file to .bat (if you are creating a batch file) or to .html (if you are writing a web page) or .js ( if you write javascript code) and so on.
- 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 of a system file to save a copy intact 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 viewer program as seen in the first point.
- Convert video to a different format (eg .mp4) or audio file (.mp3); to do this, however, you need a program to convert video.

Finally, remember that it is possible to associate a program to a particular file according to its extension. We have seen how to do it in the guide above how to change program to open a file in windows.

add a comment of How to change File Extension in Windows 10
Comment sent successfully! We will review it in the next few hours.