What changing a file type means and when you need to do it

Changing a file type means renaming the file extension — the letters after the dot at the end of a filename — so your computer treats it as a different kind of file. For example, changing a file from .txt (plain text) to .csv (comma-separated values) tells your computer the data inside is formatted differently and should open in a different program.

You might need to do this when you download a file without an extension, when you save something in the wrong format by accident, or when a program needs a specific file type to open your work. Changing the extension itself is simple; the real question is whether the file's contents are actually formatted the way the new extension promises.

Renaming the extension does not convert the file's contents. If you have a Word document and change the extension from .docx to .pdf, you now have a file that claims to be a PDF but contains Word data — it will not open correctly. True conversion requires saving or exporting the file in the new format using the original program.

Key Takeaways

  • On Windows, right-click the file, select Rename, change the letters after the dot, and press Enter; you may need to enable viewing file extensions first in Folder Options.
  • On Mac, select the file, press Return or Space to enter rename mode, change the extension, and confirm the warning that appears.
  • Changing only the extension does not change what the file contains — the data inside stays the same, so the file may not open in the new program.
  • To truly convert a file to a different format, use the original program's Save As or Export option rather than just renaming the extension.
  • Some file types are blocked by your operating system for security reasons, and renaming to those extensions will not let you open them.

How to change a file extension on Windows

First, make sure you can see file extensions. By default, Windows hides them. Open File Explorer, click the View tab at the top, and check the box next to File name extensions. Now you will see the full filename including the dot and letters at the end.

Right-click the file you want to rename. Select Rename from the menu. The filename will highlight and become editable. Use your keyboard to move to the end of the name and change only the letters after the dot. For example, change document.txt to document.csv. Press Enter when you are done.

Windows will ask you to confirm the change, warning that changing the extension might make the file unusable. Click Yes to proceed. The file extension is now changed, though remember that the contents inside have not been converted — only the label has changed.

How to change a file extension on Mac

On Mac, file extensions are usually hidden by default, but you do not need to unhide them to change one. Select the file in Finder and press Return (or Space, depending on your macOS version). The filename becomes editable.

Change the letters after the dot to the new extension you want. For example, change data.txt to data.csv. Press Return to confirm. Mac will show a dialog asking whether you want to use the new extension or keep the old one. Click Use [new extension] to proceed.

If you want to see all file extensions on your Mac going forward, open Finder, click Finder in the menu bar, select Settings, go to the Advanced tab, and check Show all filename extensions.

When renaming the extension is not enough

Changing the extension works only if the file's contents are already in the format the new extension represents. If you have a photo saved as .jpg and rename it to .png, the file will not become a PNG — it will still be a JPG with a PNG label, and programs expecting a real PNG may refuse to open it or display it incorrectly.

To actually convert a file to a different format, use the program that created it. In Microsoft Word, use File > Save As and choose a different format from the dropdown menu. In Photoshop, use File > Export As to save as PNG, JPEG, or another image format. Most programs have a Save As or Export option that handles the real conversion work.

Some online tools can convert files between formats — for example, CloudConvert or Zamzar let you upload a file and download it in a different format. These services actually reprocess the file's contents rather than just renaming it, so the result will open correctly in programs that expect the new format.

File types your operating system will not let you change

Windows and Mac block certain file extensions for security reasons. You cannot rename a file to .exe (Windows executable), .bat (batch script), .com, or .scr (screensaver) on Windows, or to .app or .deb on Mac, even if you try. The operating system recognizes these as programs and prevents you from accidentally running malicious code.

If you need to work with these file types, you are usually doing something that requires a developer environment or specialized knowledge. If you are not sure why you need to change to one of these extensions, you probably do not need to.

Common file extensions and what they mean

Understanding what different extensions represent helps you know whether renaming alone will work or whether you need real conversion. Here are the most common ones you will encounter:

ExtensionFile TypeCommon Programs
.txtPlain textNotepad, Word, any text editor
.docxWord documentMicrosoft Word, Google Docs
.pdfPortable documentAdobe Reader, web browsers
.csvComma-separated values (spreadsheet data)Excel, Google Sheets, any spreadsheet program
.jpg or .jpegImage (compressed)Photos, web browsers, image viewers
.pngImage (lossless)Photos, web browsers, image editors
.mp3Audio (compressed)Media players, music apps
.mp4VideoMedia players, video editors
.zipCompressed archiveFile compression tools, Windows/Mac built-in

Troubleshooting: file will not open after changing the extension

If you renamed a file and now it will not open, the most likely reason is that the contents do not match the new extension. Change the extension back to the original, and the file should open again in its original program.

If you need the file in a different format, open it in the original program and use Save As or Export to create a properly converted copy. This is slower than just renaming, but it produces a file that actually works in the new format.

If you are not sure what the original extension was, right-click the file, select Properties (Windows) or Get Info (Mac), and look for the file type listed in the details. That tells you what format the file actually contains, even if the extension is wrong.

Frequently Asked Questions

Can I change a file extension to make it open in a different program?

Renaming the extension will make your computer try to open it in a different program, but the file will likely not display correctly unless the contents are actually in that format. If you want a file to open in a specific program, use that program's Save As or Export feature to create a properly converted version.

What happens if I change a file extension and then change it back?

Changing it back restores the original extension label. The file's contents have not changed, so it will open normally again in the program that created it. No data is lost by renaming back and forth.

Why does Windows hide file extensions by default?

Windows hides extensions to make filenames simpler for everyday users. The downside is that malicious files can disguise themselves — for example, a program might be named document.txt.exe, but with extensions hidden you would see only document.txt and think it was safe. Showing extensions helps you spot this trick.

Can I change multiple file extensions at once?

You can select multiple files at once and rename them together, but the process varies by operating system. On Windows, select all the files, right-click, and choose Rename — you can type a new name and Windows will number them automatically. On Mac, select the files, right-click, and choose Rename Items, then use the dialog to change the extension for all of them at once.

Is it safe to change a file extension?

Renaming the extension itself is safe — you are just changing a label. The file's contents do not change, so you can always rename it back. The risk comes from opening a file in the wrong program after renaming it, which might display garbage or cause an error. As long as you keep a backup or remember the original extension, you can always undo the change.