File Extension: What It Is and How to Find It
A file extension is the suffix at the end of a filename, separated by a dot, that tells the operating system and applications what type of file it is—for example, .jpg in photo.jpg or .docx in report.docx. To find a file's extension, you can enable file name extensions in your system's file explorer, right-click the file and choose Properties (Windows) or Get Info (macOS), or use a terminal command like ls or dir that lists full filenames including extensions.
What a File Extension Actually Does
The extension is a shorthand that helps the operating system decide which program should open a file. When you double-click budget.xlsx, Windows or macOS reads the .xlsx part and launches a spreadsheet application. Without the extension, the system may not know what to do with the file and might ask you to choose an app manually.
Extensions are not magic—they are just part of the filename. You can rename a file to change its extension, but doing so does not convert the file's contents. Renaming image.png to image.txt will not turn a picture into text; it will likely make the file unopenable by the intended program. The extension is a label, not a transformation.
How to Find a File Extension on Windows
By default, Windows hides known file extensions to keep filenames clean. That means report.docx may appear simply as report. To see extensions:
- Open File Explorer.
- Click the View tab at the top.
- In the Show/hide group, check the box labeled File name extensions.
Alternatively, right-click any file and select Properties. The General tab lists the file type, and the full filename including extension appears near the top. In Windows 11, the View menu is a drop-down; the option is still called Show > File name extensions. Menu labels can differ slightly by version.
You can also use Command Prompt or PowerShell. In Command Prompt, navigate to the folder and type dir; the listing shows full filenames with extensions. In PowerShell, Get-ChildItem does the same.
How to Find a File Extension on macOS
macOS also hides extensions by default for many file types. To reveal them:
- Open Finder.
- Choose Finder > Settings (or Preferences in older versions).
- Click the Advanced tab.
- Check Show all filename extensions.
For a single file, select it and press Command+I (Get Info). The Name & Extension section shows the full name, and a checkbox lets you hide or show the extension for that file. In Terminal, the ls command lists filenames with extensions by default.
Finding Extensions on Mobile and in the Cloud
On Android and iOS, file managers often hide extensions. In the Google Files app or the built-in Files app on iOS, you may need to tap a file's info button to see its full name. Cloud services like Google Drive, Dropbox, and OneDrive typically show extensions in their web interfaces when you view file details, but may hide them in list views. If you need to confirm an extension, download the file and check it on a desktop, or use the service's file details panel.
Why Extensions Get Hidden—and Why It Matters
Hiding extensions reduces visual clutter and prevents accidental renames, but it also creates a security risk: malicious files can disguise themselves. A file named invoice.pdf.exe may appear as invoice.pdf when extensions are hidden, tricking users into running an executable. For that reason, many security guides recommend showing extensions at all times. It also helps when troubleshooting: if a program won't open a file, checking the extension is the first step to confirming the file type.
Common File Extensions and What They Mean
Extensions fall into broad categories. Here are some examples:
- Documents:
.docx(Word),.pdf(Portable Document Format),.txt(plain text),.odt(OpenDocument Text) - Images:
.jpgor.jpeg,.png,.gif,.webp,.svg - Audio:
.mp3,.wav,.flac,.aac - Video:
.mp4,.mov,.avi,.mkv - Archives:
.zip,.rar,.7z,.tar.gz - Executables:
.exe(Windows),.app(macOS),.sh(shell script)
Some extensions are ambiguous: .tar.gz is a compound extension indicating a gzipped tar archive. The system treats the last dot-separated segment as the extension, but applications may recognize compound suffixes.
How to Change a File Extension Safely
Changing an extension is sometimes necessary—for example, if a file was saved with the wrong one. But it should be done with care:
- Make a backup copy of the file first.
- Enable file name extensions so you can see what you are editing.
- Right-click the file and choose Rename (Windows) or press Return (macOS).
- Edit only the part after the final dot, then press Enter.
- Confirm the change when prompted.
Remember: renaming does not convert the file. If you change .png to .jpg, the file is still a PNG image; some programs may refuse to open it or may open it with errors. To truly convert a file, use a conversion tool or the application's Save As feature with the desired format.
Frequently Asked Questions
How do I find a file's extension if I can't see it?
Enable file name extensions in your file explorer's view settings, or right-click the file and open its properties/info panel. On Windows, the Properties > General tab shows the file type; on macOS, Get Info shows the full name.
What if a file has no extension?
Some files, especially on Unix-like systems, have no extension. The operating system may still open them if the file's internal header identifies its type, or you may need to specify a program manually. You can inspect the file's content with a text editor or use a tool like the file command in Terminal to guess its type.
Can I hide extensions again after showing them?
Yes. In Windows File Explorer, uncheck File name extensions under the View tab. On macOS, uncheck Show all filename extensions in Finder > Settings > Advanced.
Why does my file have two extensions, like .tar.gz?
That indicates a file that has been compressed and archived. The .tar part means it is a tape archive, and .gz means it was compressed with gzip. You typically need to decompress it first, then extract the archive.
Is it safe to open a file with an unknown extension?
Be cautious. Unknown extensions may belong to specialized software or could be malicious. Research the extension before opening, and ensure you have up-to-date security software. Never open executable files from untrusted sources.