How to See and Change a File Extension
In this article
Changing a file extension lets you tell your operating system which program should open a file. For example, renaming a .txt file to .csv can make spreadsheet software read it as a table, or converting a .jpg to .png changes the image format. This guide shows you how to display and edit file extensions on Windows, macOS, and Linux, plus what to watch out for so you don't break your files.
What You'll Need
- A computer running Windows, macOS, or Linux
- The file whose extension you want to view or change
- Basic permission to rename files (you usually have this for your own files)
- Optional: a backup copy of the file before making changes
Step-by-Step
On Windows
- Open File Explorer (press Win + E).
- Click the View tab at the top of the window.
- Check the box labeled File name extensions in the Show/hide group. Now every file shows its extension (like .txt, .jpg, .pdf).
- Right-click the file you want to change and select Rename (or press F2).
- Type the new extension after the dot. For example, change
report.txttoreport.csv. - Press Enter. If a warning appears, click Yes to confirm.
On macOS
- Open Finder.
- Go to Finder > Settings (or Preferences on older macOS) from the menu bar.
- Click the Advanced tab.
- Check the box next to Show all filename extensions.
- Close the settings window. Now extensions are visible for all files.
- Right-click the file and choose Rename (or select the file and press Return).
- Edit the extension part after the dot. For example, change
photo.jpgtophoto.png. - Press Return. If prompted, click Use .png or Keep .jpg to confirm the change.
On Linux (GNOME Files / Nautilus)
- Open the Files app (Nautilus).
- Click the menu (three horizontal lines) in the top-right corner and select Preferences.
- Go to the View tab.
- Toggle on Show Hidden and Backup Files if you want to see hidden files too, but for extensions, look for the option Show file extensions – if it's not there, extensions are shown by default in most Linux file managers.
- If extensions are hidden, press Ctrl + H to toggle hidden files (this also reveals extensions for many file types).
- Right-click the file and select Rename (or press F2).
- Change the part after the dot to the new extension.
- Press Enter to apply.
Using the Command Line (All Systems)
- Open Terminal (macOS/Linux) or Command Prompt/PowerShell (Windows).
- Navigate to the folder containing the file. For example:
cd Documents - Use the
mv(move/rename) command to change the extension. For example:mv report.txt report.csv - Press Enter. The file is renamed immediately.
Common Mistakes
- Renaming without knowing the original format: Changing a .docx to .pdf does not convert the file – it just changes the label. The file may become unreadable.
- Hiding extensions and renaming the whole name: If extensions are hidden, typing a new name like
report.csvactually createsreport.csv.txton Windows, which is not what you intended. - Adding an extra dot: A file named
archive.tar.gzhas two extensions. Changing only the last one may break the archive. - Forgetting to confirm warnings: Windows and macOS will warn you that the file might become unusable. Ignoring the warning can lead to a corrupted file.
Tips
- Always make a backup copy before changing an extension, especially for important files.
- If you need to actually convert a file (e.g., from .docx to .pdf), use a proper converter tool or the “Save As” feature in the original program.
- On Windows, you can also use the Rename option in the right-click menu, but make sure extensions are visible first.
- On macOS, you can right-click and select Get Info to see the full name and extension, then edit it there.
- For bulk renaming, use a batch rename tool or a simple script – but test on a copy first.
Troubleshooting
- The extension is still not visible after enabling the option: On Windows, check if the file is a system file or if the option is grayed out – you may need to restart File Explorer. On macOS, make sure you closed the settings window properly.
- I changed the extension and now the file won’t open: This is expected if the file content doesn’t match the new extension. Rename it back to the original extension. If that doesn’t work, restore from your backup.
- I see “If you change a file name extension, the file might become unusable” on Windows: This is a warning, not an error. Click Yes only if you are sure the new extension is correct. Otherwise, click No.
- On macOS, the extension is grayed out in the rename box: This happens when the file is locked or you don’t have write permission. Unlock the file via Get Info or copy it to a location you own.
- On Linux, the file manager doesn’t show extensions at all: Some file managers hide extensions for known types. Try pressing Ctrl + H or switch to a different file manager like Dolphin (KDE) which shows extensions by default.
Frequently Asked Questions
Why can’t I see file extensions by default?
Operating systems hide extensions for known file types to keep names clean and reduce accidental changes. You can enable them in settings as described above.
Does changing an extension actually convert the file?
No. Changing the extension only changes the label. The file’s internal data remains the same. To convert, use a converter or save as a different format from the original program.
Can I change multiple file extensions at once?
Yes, but it’s risky. On Windows, you can select multiple files and press F2 to rename them all with the same base name, but the extensions will be the same as the first file. For true batch extension changes, use a script or a dedicated tool.
What is the difference between .txt and .csv?
Both are plain text, but .csv is structured with commas separating values, so spreadsheet programs treat it as a table. Changing .txt to .csv doesn’t add commas – you’d need to edit the content.
Is it safe to change an extension to something else?
Only if you know the file’s actual format matches the new extension. For example, a file saved as .txt but containing CSV data can be safely renamed to .csv. Otherwise, you risk making the file unreadable.
How do I see the extension of a file without changing it?
Just enable the “show file extensions” option in your file manager, or right-click the file and select Properties (Windows) or Get Info (macOS) to see the full name.