4 Ways to Change a File Extension in Windows 11

Change the extension for one file, or do it in bulk with a command

What to Know

  • To change a file extension in File Explorer, first go to View > Show > File name extensions.
  • Then, right-click the file, select Properties, change the file extension, and press OK > Yes.
  • Use the ren Command Prompt command to change the file extension for several files at once.

This article explains how to change the file extension of a file in Windows 11. It also discusses the difference between file extension and file type.

Change a File Extension the Easy Way

For most people, the easiest way to change a file extension in Windows 11 is to do so from the same place you change the file name. However, Windows doesn't show file extensions by default, so we must first make a small change to that before we're given the option to edit the file extension.

  1. Open File Explorer. A quick method is to use the WIN+E keyboard shortcut.

  2. Select View at the top of the window, followed by Show > File name extensions.

    View > Show > File Name Extensions in File Explorer
  3. Now that Windows 11 displays file extensions, right-click the file you want to edit the extension for and choose Properties.

    Properties in a file's context menu

    If you're in a hurry, left-click the file once (don't open it), press F2, edit the file extension, press Enter, and then select Save.

  4. In the General tab, rename the characters after the period to change the file extension.

  5. Press OK, and then Yes, to save.

    The 'TXT' file extension highlighted, and the 'Yes' button highlighted, in a file's Properties window

Changing the file extension does not change the file type. See the bottom of this page for more on that.

Change a File Extension From Command Prompt

If you're familiar with Command Prompt, you might prefer to use the rename/ren command to change a file extension. This method lets you skip having to edit the File Explorer options (i.e., you can keep file extensions hidden, and this will still work).

  1. Open Command Prompt.

  2. Change to the directory where your file is located.

    For example, if Command Prompt opens to C:\Users\jonfi, but the file is on your desktop, type this into Command Prompt:

     cd C:\Users\jonfi\Desktop
    
    An example of the CD command in the Windows 11 Command Prompt
  3. Type ren followed by the original file and then the new name for the file.

    Here's an example where I'm changing the file extension from DOCX to TXT:

     ren file.docx file.txt
    
  4. Press Enter to immediately change the file extension.

    Using the REN command to change a file extension in Windows 11

How to Change File Extensions in Bulk

Command Prompt also makes it super easy to edit the file extension for multiple files simultaneously, assuming they're in the same folder. The trick is using asterisks so you don't have to call out any specific file by name.

  1. Put all the files you want to edit into their own folder.

  2. Right-click an empty area next to the files, and select Open in Terminal.

    The "Open in Terminal" command in a folder's context menu
  3. Confirm that Command Prompt shows the correct folder. In my example, it says C:\files>.

    If PowerShell opens instead, press Ctrl+Shift+2 to get to Command Prompt. Learn more about Terminal if you need help.

    Don't breeze through this step. If you're in the wrong folder, there's no easy way to undo the command you're about to perform.

  4. Type the following, but change *.jpg to be whatever it is you want your files to have:

     ren *.* *.jpg
    

    This command will rename everything in this folder. Make sure you're in the correct folder, and want to change the file extension for every file in there.

    If you only need to rename a group of similar file extensions, you can modify the command slightly. Here's what to type if you want to make all the GIF files have the JPG file extension (everything else will be left untouched):

     ren *.gif *.jpg
    
  5. Press Enter. All of the file extensions will change automatically.

    An example of the REN command highlighted in Command Prompt

Convert the File to Change the File Type

A file conversion tool can change the file extension, too. The primary reason you'd do this is if you want to change the actual file format (i.e., file type), like if you need the file to be compatible with a specific device or software program.

Here's an example where we're using the Zamzar file converter to change the file extension of an audio file from MP3 to WAV.

  1. Visit Zamzar, and select Choose Files.

    'Choose Files' button highlighted on the Zamzar website
  2. Select the MP3 file you want to change to WAV, and then press Open.

    An MP3 file highlighted, and the 'Open' button highlighted, in the Open box on Zamzar's website
  3. Select Convert To, and then pick WAV from the list.

    'Convert To' and 'wav' highlighted on the Zamzar website
  4. Select Convert Now to start the file conversion.

    'Convert Now' button highlighted on the Zamzar website
  5. Choose Download to save the file to your device.

    'Download' button highlighted on the Zamzar website

Some software programs have built-in file conversion tools. This is often the case for programs that can open several file types. Adobe Photoshop, for example, can open a PNG file and convert it to over a dozen other image formats, which then changes the file extension (to JPG, GIF, TIFF, etc.).

What Does Changing the File Extension Do?

The Windows operating system uses the file extension to understand how to open a file. For example, when you double-click to open a TXT file, Notepad probably opens it. This happens because Notepad is configured to open TXT files.

If I changed the TXT file to the DOCX file extension, Microsoft Word would open it instead because my PC is configured to use Word for that file type.

See How to Change File Associations in Windows if you want a different program to open any particular file type. This lets you change which app plays MP3s or pick an other image viewer for your GIF files.

Reasons to Change the File Extension

One reason to change a file extension is if the original one was appended to the file by mistake. This sometimes happens when a file is downloaded from a website. If you were supposed to get a PDF file, for example, but the web service exported your file to something else, you can change the file extension to PDF to make it work correctly with your PDF reader.

Another example is if you're working with a BAT file. Building it as a TXT document makes more sense, so you can quickly double-click to open it in a text editor when you need to make changes. But when you're done, you have to change the file extension to BAT to work as intended.

You might think about changing the file extension to make the file work with a different program or device. For example, changing the file extension sounds helpful if your eReader supports PDF files, but your book is an FB2 file. In reality, you'd need to change the file type.

The File 'Type' Is Different

When you change a file extension, it doesn't affect the file type. It might look like it does if the icon changes and a different program opens when you double-click it. But really, the file extension only serves as a way to tell Windows which program to trigger when you open the file.

The file type is the format that the file exists in. For instance, an SVG file is an image format, but it's very different from the JPG image format, and both are even less like an ISO file. Those are three different file types.

The DAT file extension is another great example. If you follow that link, you'll see that one kind of DAT file is a video, another is a text file, and yet another is used to store backed-up data. That's three different file types that are using the same file extension.

One way to understand why the differences matter is to think about what would happen if you changed the MP3 file extension to DOCX. MP3 is an audio file format, and DOCX is a document format. Changing the file extension would not magically display all the MP3's lyrics in a document format you can look through in Microsoft Word.

Instead, use a file converter to change the file type. If you need your MKV video to be an MP4 file, maybe so it opens in your favorite video player that only accepts MP4s, then a file conversion tool is the best way to do it. The same is true for other file types.

Was this page helpful?