What a file extension is and why you might need to change it
A file extension is the short code at the end of a filename — the part after the dot. For example, a photo might be named "vacation.jpg" where "jpg" is the extension. The extension tells your computer what program should open the file and how to read its contents.
You might need to change an extension when you save a file in a different format, when a file loses its extension by accident, or when you want to open a file with a different program. Changing the extension itself is straightforward, but it does not actually convert the file — it just changes what your computer thinks the file is. If you rename a photo from .jpg to .txt, the photo data stays the same; you just told your computer to treat it as text.
The steps differ slightly depending on whether you use Windows, Mac, or Linux, and whether your system is set to show extensions at all. Most people find their extensions are hidden by default, so the first step is usually to turn that visibility on.
Key Takeaways
- File extensions are hidden by default on most computers, so you must turn on visibility before you can change them.
- On Windows, open File Explorer settings and check "File name extensions" under the View tab.
- On Mac, select a file, press Command+I, and uncheck "Hide extension" in the General section.
- Changing an extension only tells your computer what program to use; it does not convert the actual file data.
- If a file refuses to open after you change its extension, change it back and try a different approach.
How to show file extensions on Windows
Windows hides extensions by default to keep the interface cleaner for everyday users. To change an extension, you need to see it first. Open File Explorer — the folder icon on your taskbar or in your Start menu — and look at the top menu bar.
Click the View tab. You will see a row of options. Look for a checkbox labeled File name extensions and click it to turn it on. From now on, every file in File Explorer will show its extension. You only need to do this once; the setting stays on until you turn it off again.
Once extensions are visible, right-click the file you want to change and select Rename. The entire filename, including the extension, becomes editable. Change only the extension part — the letters after the final dot — and press Enter. Windows will ask you to confirm that you want to change the extension. Click Yes.
How to show and change file extensions on Mac
Mac shows extensions by default in most cases, but some files hide them. To check whether an extension is hidden, click the file once to select it, then press Command+I on your keyboard. A window titled "Get Info" opens.
Look for a section called General near the top. If you see a checkbox that says Hide extension and it is checked, click it to uncheck it. The extension now appears in the filename. Close the Get Info window.
Now right-click the file and select Rename, or simply click the filename once and start typing. Change only the extension — the part after the final dot — and press Enter. Mac will ask whether you want to keep the old extension or use the new one. Choose Use the new extension.
How to change file extensions on Linux
Linux file managers show extensions by default. Open your file manager — usually called Files, Nautilus, or Dolphin depending on your desktop — and navigate to the file you want to change.
Right-click the file and select Rename. The filename becomes editable. Change only the extension — the part after the final dot — and press Enter. Linux does not ask for confirmation; the change takes effect immediately. If you want to undo it, right-click again and rename it back.
What happens when you change an extension
Changing an extension tells your computer which program to use when you double-click the file, but it does not change what the file actually contains. If you rename a Word document from .docx to .txt, your computer will try to open it as plain text, and you will see a jumbled mess of characters. The document data has not changed — only your computer's instructions for reading it.
This matters because some file conversions require actual conversion software. If you need to turn a photo from JPG format into PNG format, renaming the extension alone will not work. You need image editing software or an online converter that actually rewrites the file data. Renaming only works when the file is already in the format you want but has the wrong extension label.
If you change an extension and the file will not open or looks wrong, change the extension back to what it was. You have not damaged anything — you just gave your computer the wrong instructions.
Common mistakes and how to avoid them
The most common mistake is changing the extension when you actually need to convert the file. If you have a video in MP4 format and you need it as MOV format, renaming the extension will not work. You need video conversion software. Before you change an extension, ask yourself: is this file already in the format I want, or do I need to actually convert it?
Another mistake is changing only part of the extension. If your filename is "document.backup.docx" and you want to change it to "document.backup.txt", make sure you change only the final ".docx" to ".txt". Changing the middle ".backup" part will confuse your computer.
A third mistake is changing the extension of a system file or a file you do not own. If you are working with files in a shared folder or a system directory, ask the file owner or your IT support before changing anything. Changing the wrong file's extension can break programs or prevent others from accessing what they need.
When renaming the extension is not enough
If you need to actually convert a file from one format to another — not just rename it — you will need conversion software. For photos, programs like GIMP (free) or Photoshop let you open a file and save it as a different format. For videos, HandBrake (free) or Adobe Media Encoder can convert between formats. For documents, Microsoft Word or Google Docs can open one format and save as another.
Online converters also exist for most file types. Search for "[your file type] to [desired file type] converter" and you will find web-based tools that do the conversion for you. Upload your file, download the converted version, and you are done. These are useful when you do not want to install software, though they do upload your file to someone else's server.
Frequently Asked Questions
Can I change an extension if the file is open in another program?
No. Close the file and the program first, then change the extension. If the file is open, your computer is using it and will not let you rename it. Once you close it, the rename works immediately.
What if I change an extension and now nothing will open the file?
Change the extension back to what it was. You have not damaged the file — you just told your computer to treat it as the wrong type. Once you restore the original extension, it should open normally again. If it still will not open, the problem existed before you renamed it.
Do I need to change the extension if I save a file with a different name?
No. When you use "Save As" in most programs, you choose the format you want, and the program adds the correct extension automatically. You only need to manually change an extension if the file already exists and has the wrong label.
Is it safe to change extensions on files I downloaded?
It depends on the file. If you downloaded a photo and it has no extension, adding .jpg is safe. If you downloaded something from an untrusted source and you are not sure what it is, do not change the extension or open it. Ask someone you trust first.
Can I change multiple file extensions at once?
Most file managers do not let you bulk-rename extensions directly. You can select multiple files and rename them together, but you have to change each extension individually. Some advanced tools and scripts can do batch renaming, but they require command-line knowledge.