What a file extension is and why you might change it
A file extension is the short code at the end of a filename — the part after the final dot. For example, a photo might be named vacation.jpg, where jpg is the extension. It tells your computer what program should open the file and how to read the data inside.
You might need to change an extension when you convert a file to a different format (like turning a photo from .jpg to .png), when a file was saved with the wrong extension by mistake, or when a program needs a specific format to work. Changing the extension itself doesn't convert the file — it just changes the label. If you need to actually convert a photo from one format to another, you'll need conversion software, not just a name change.
The steps differ depending on whether you use Windows, Mac, or Linux, and whether your system is set to hide extensions by default (most are).
Key Takeaways
- File extensions are the letters after the final dot in a filename, and changing the name doesn't convert the file's actual format — it only changes the label.
- On Windows, you must turn off "Hide extensions for known file types" in File Explorer settings before you can edit an extension.
- On Mac, right-click a file, select "Get Info", and change the name in the filename field, including the new extension.
- On Linux, use the terminal command mv oldname.old newname.new or rename the file in your file manager the same way you would on Mac.
- Changing an extension to something your computer doesn't recognize may make the file impossible to open until you change it back.
How to change a file extension on Windows
Windows hides file extensions by default, so your first step is to make them visible. Open File Explorer and click the "View" tab at the top. Look for a checkbox labeled "File name extensions" and click it to turn it on. Now you'll see the full filename including the extension on every file.
Right-click the file you want to rename and select "Rename" from the menu. The entire filename, including the extension, will now be editable. Change only the extension part (the letters after the final dot) to what you need. For example, change document.txt to document.csv. Press Enter when you're done.
Windows will ask you to confirm that you want to change the extension. Click "Yes" to proceed. If you don't see this confirmation, it means the extension didn't actually change — go back and check that you edited the right part of the filename.
How to change a file extension on Mac
On Mac, extensions are usually hidden in Finder, but you can still change them. Click once on the file to select it, then press Command+I (or right-click and select "Get Info"). A window will open showing the file's details.
Look for the "Name & Extension" field near the top of this window. Click in that field and edit the filename, making sure to include the new extension at the end. For example, change photo.jpg to photo.png. Press Enter to save the change.
Mac will ask you to confirm that you want to change the extension. Click "Use the new name" to proceed. If the extension field is grayed out and you can't click it, the file may be locked — right-click the file, select "Get Info", and uncheck "Locked" at the bottom of the window.
How to change a file extension on Linux
Linux file managers work similarly to Mac Finder. Right-click the file and select "Rename" (the exact wording depends on which file manager you're using — it might say "Edit Name" or just show a rename option). The filename will become editable. Change the extension and press Enter.
If you prefer the terminal, open it and use the mv command. Type mv oldfilename.old newfilename.new and press Enter. For example: mv report.txt report.csv. Make sure you're in the correct directory first, or include the full path to the file.
What happens when you change an extension
Changing the extension changes only the label — it doesn't change what's actually inside the file. If you rename a photo from .jpg to .txt, the file still contains image data. Your computer will try to open it with a text editor, which will show garbage characters instead of the photo.
Some programs are forgiving and will open the file anyway if they recognize the actual format inside. Others will refuse to open it or will crash. The safest approach is to change the extension back if something doesn't work.
If you need to actually convert a file from one format to another (like turning a .jpg photo into a .png), you need conversion software. Changing the extension alone won't do it. Most operating systems include basic converters — for example, Mac's Preview app can open a photo and save it in a different format.
Common mistakes and how to avoid them
The most common mistake is changing the extension to something your computer doesn't recognize, then being unable to open the file. If this happens, simply change the extension back to the original. You can always right-click the file and select "Open with" to choose a different program if the default one doesn't work.
Another mistake is typing the extension wrong. Double-check the spelling — for example, .jpg and .jpeg are both valid image formats, but they're not the same thing. If you're unsure of the correct extension for what you need, search for "file extension for [format]" to confirm.
On Windows, make sure you've actually turned on "File name extensions" in View settings. Many people think they're editing the extension when they're actually only editing the visible part of the filename, leaving the real extension unchanged.
When to change an extension versus when to convert a file
Change the extension when: you know the file is already in the format you need but was labeled wrong, or when a specific program requires a certain extension even though the file format is correct inside.
Convert the file when: you need to actually change the data format (like making a photo smaller, changing a Word document to PDF, or turning an audio file from one format to another). Use your operating system's built-in tools when possible — Windows has Paint for images, Mac has Preview, and most Linux systems include command-line tools like ImageMagick or FFmpeg.
Frequently Asked Questions
Can I change a file extension to something random and still open it?
Not reliably. Your computer uses the extension to decide which program to use. If you change it to something unrecognized, the file may not open at all, or it may open in the wrong program and display as garbage. Change it back to the original if this happens.
Will changing the extension damage the file?
Changing the extension itself doesn't damage the file's data. However, if you open it in the wrong program and that program tries to modify it, the file could become corrupted. It's safest to change the extension back if you can't open the file properly.
What if I can't see the extension on my file?
On Windows, go to File Explorer's View tab and turn on "File name extensions". On Mac, select the file, press Command+I, and look at the "Name & Extension" field. On Linux, it depends on your file manager, but right-clicking and selecting Rename should show the full name.
Is changing a file extension the same as converting it?
No. Changing the extension only changes the label. Converting actually transforms the file's data into a new format. To convert, use software designed for that purpose — Preview on Mac, Paint on Windows, or online converters for formats like PDF or audio.
Can I change multiple file extensions at once?
Most file managers let you select multiple files and rename them one at a time, but not all at once. Some advanced tools and scripts can batch-rename files, but for most users, changing them individually is the safest approach to avoid mistakes.