What changing a file extension means and why you might need to do it
A file extension is the short code at the end of a filename — the part after the dot. When you see document.docx or photo.jpg, those last four characters tell your computer what program should open the file and how to read its contents. Changing the extension means renaming that suffix to a different one, which tells your computer to treat the file as a different type.
You might need to change an extension because you received a file in the wrong format, you want to open it with a different program, or you're converting between formats. For example, changing image.jpg to image.png tells your computer the file is now a PNG image instead of a JPG. However, simply changing the extension does not actually convert the file's contents — it only changes how your computer interprets it. If you change document.docx to document.txt, the file will still contain Word formatting that a text editor may not display correctly.
The process itself is straightforward on any operating system: you rename the file and change the extension. The tricky part is knowing whether the file will actually work in its new format, and understanding that some conversions require actual conversion software rather than just a rename.
Key Takeaways
- Changing a file extension is a rename operation — you right-click the file, select rename, and type a new name with a different extension.
- On Windows, you may need to turn on the option to show file extensions in File Explorer before you can edit them.
- Changing the extension does not convert the file's actual contents, only how your computer interprets it — a renamed Word document will still contain Word formatting.
- Some file format changes require actual conversion software rather than just renaming the extension.
- Always keep a backup of the original file before changing its extension, in case the new format does not work as expected.
How to change a file extension on Windows
On Windows, file extensions are often hidden by default, so your first step is usually to make them visible. Open File Explorer, click the View tab at the top, and check the box next to "File name extensions." Now you'll see the full filename including the extension on every file.
Once extensions are visible, right-click the file you want to change and select "Rename." The entire filename, including the extension, will become editable. Change only the extension part — the letters after the final dot — to the new format you want. For example, change report.docx to report.txt. Press Enter when you're done. Windows will ask you to confirm that you want to change the extension; click "Yes."
If you want to change extensions regularly, you can leave the "File name extensions" option turned on permanently so you don't have to enable it each time. This also helps you avoid accidentally changing the wrong part of the filename.
How to change a file extension on Mac
On Mac, extensions are usually visible by default, but the system sometimes hides them. To make sure extensions show, open Finder, click Finder in the menu bar, then select Preferences. Click the Advanced tab and check "Show all filename extensions."
To change the extension, click once on the file to select it, then press Enter (or Return). The filename becomes editable. You can now change the extension at the end. For example, change image.jpg to image.png. Press Enter when finished. Mac will ask whether you want to use the new extension; click "Use the new extension."
Alternatively, right-click the file, select "Rename," and edit the extension the same way. Both methods work identically on modern versions of macOS.
How to change a file extension on Linux
Linux file managers vary depending on which desktop environment you're using, but the principle is the same across all of them. In GNOME Files (the default on Ubuntu and many other distributions), right-click the file and select "Rename." Edit the extension just as you would on Windows or Mac — change only the letters after the final dot.
If you prefer the command line, you can use the mv command to rename a file. For example, typing mv document.docx document.txt and pressing Enter will change the extension from .docx to .txt. This method is faster if you're changing many files at once, but it requires familiarity with terminal commands.
Linux does not hide extensions by default, so you'll always see them in your file manager. This makes accidental changes less likely, but it also means you need to be careful when editing to change only the extension and not the rest of the filename.
When renaming the extension is not enough
Simply changing the extension works when you're telling your computer to open a file with a different program that understands the same underlying format. For example, some image viewers can open both .jpg and .png files, so renaming between those formats may work fine depending on the viewer.
However, many format changes require actual conversion software. If you change a Word document from .docx to .txt by renaming alone, the file will open as plain text but will display all the hidden formatting codes that Word uses. If you change an audio file from .mp3 to .wav by renaming, the file will not play correctly because the audio data inside is still compressed in MP3 format, not uncompressed WAV format.
Before you rename a file, research whether the two formats are compatible or whether you need conversion software. If you're unsure, keep the original file and test the renamed version first. If it doesn't work, you still have the original to fall back on.
Common mistakes to avoid when changing extensions
The most common mistake is changing the extension when you actually need to convert the file. Renaming a .pdf to .docx will not let you edit the PDF in Word — it will just confuse your computer about what the file actually is. If you need to convert between formats, search for "[original format] to [new format] converter" and use actual conversion software.
Another mistake is changing the extension of a file you're not sure about. If you rename a system file or a file that another program depends on, you can break that program. Always work with files you created yourself or files you downloaded, and always keep the original as a backup.
A third mistake is changing only part of the extension. If you have a file named photo.backup.jpg and you want to change it to PNG, you need to change it to photo.backup.png, not photo.backup.jpg.png. The extension is only the part after the final dot.
When to use batch renaming tools for multiple files
If you need to change the extension on many files at once, doing it one by one is tedious. Windows includes a built-in batch rename feature: select all the files you want to change, right-click the first one, select "Rename," change the name, and press Enter. Windows will automatically number the rest. However, this method renames the entire filename, not just the extension.
For changing only extensions on multiple files, third-party tools work better. On Windows, Bulk Rename Utility is free and lets you change extensions while keeping filenames the same. On Mac, Rename (available in the App Store) does the same thing. On Linux, the command line is often fastest: the command for f in *.jpg; do mv "$f" "${f%.jpg}.png"; done will change all .jpg files in a folder to .png in one step.
Batch tools are useful when you have dozens of files, but for a handful of files, renaming one by one is safer because you can check each result before moving to the next.
Frequently Asked Questions
Will changing the extension actually convert my file to the new format?
No. Changing the extension only tells your computer what program to use to open the file. The actual data inside stays the same. If you need the file to actually be in a new format — like converting a Word document to PDF or an MP3 to WAV — you need conversion software, not just a rename.
What happens if I change the extension of a file I'm not sure about?
If the file is one you created or downloaded, the worst that usually happens is the file won't open correctly. If it's a system file or a file another program uses, you could break that program. Always keep a backup of the original file before changing its extension, and test the renamed version before deleting the original.
Can I change a file extension back to what it was?
Yes, the same way you changed it the first time. Right-click, rename, and change the extension back to the original. This works as long as you remember what the original extension was. If you're unsure, look at your file's properties or check your download history to see what format it originally was.
Why does my file manager not show file extensions?
On Windows and Mac, extensions are often hidden by default to make filenames look cleaner. You can turn them on in the View or Preferences settings. On Linux, extensions are usually visible by default. If you can't see them, check your file manager's View menu for an option to show hidden files or file extensions.
Is it safe to change the extension of files I downloaded from the internet?
It depends on the file. If you downloaded a document or image and want to open it with a different program, changing the extension is usually safe as long as the two formats are compatible. If you downloaded an executable file (.exe, .app, .sh), do not change its extension — this could prevent security features from working correctly. When in doubt, keep the original and test the renamed version first.