What is a File Extension?
Lawrence Abrams
- July 17, 2012
- Read 261,178 times
A file extension, or file name extension, is the letters immediately shown after the last period in a file name. For example, the file extension.txt has an extension of .txt. This extension allows the operating system to know what type of file it is and what program to run when you double-click on it. There are no particular rules regarding how an extension should be formatted other than it must begin with a period and have at least one character after it. For the most part, file extensions consist of three characters, which are typically letters or digits, that textually represent the type of file it is. Some examples of file extensions include .txt, .mp3, .jpg, and .gz, which represent text files, mp3 files, jpeg image files, and files compressed with the gzip program. As you can see, the actual extension name gives clues as to the type of file it is.
When trying to determine a file's extension it is important to remember that the extension is simply the last period in a file and the characters that follow it. If there is no period in a file, then it does not have an extension. To make it easier to see what a files extension are, please see the examples in the chart below:
Filename | Extension | Notes |
report_card.txt | .txt | The extension is the period followed by the remaining characters. |
Terminal.app | .app | The extension is the period followed by the remaining characters. |
Postcard.pdf.exe | .exe | This one is a bit tricky, because there are two periods in this file. The important thing to remember is the extension is the last period and the characters that follow it. |
As already said, an operating system knows what programs to use in order to view, print, or edit a particular file by looking at its file extension. It is able to do this because each operating system has in its configuration a default mapping between a particular file extension and a particular program. Using this information, when a user clicks on a file, the operating reads the file extension and then launches the mapped application. Typically, if the extension is unknown to the operating system or no application mapping exists, it will prompt the user to specify the program that it would like to open the file with.
By defaults, Windows and the Mac OS do not show file extensions. To view file extensions you would first need to enable them using the following guides:
It is also possible to change the program that your operating system uses to open a particular extension. This will be described in tutorials that can be found in the Further Reading section below.
How to change the program associated with a file extension
As already mentioned, file extensions are mapped to a particular program so that when you attempt to use the file, the operating system knows which application to launch. There may come a time that you wish to change a default association so that you can use a different program to automatically open the file. For example, when you open a image file on Windows it defaults to using the pre-installed Windows Photo Viewer. In the future if you find a new program that you would like to use instead, you can change the associations for image files so that they instead are opened by the new program.
For more information about how to change the default program a file extension opens with, please select one of the tutorials below based upon your particular operating system:
- How to open a file with a different program on your Mac
- How to change the default program a file opens with in Windows XP
- How to change the default program a file opens with in Windows Vista and Windows 7
- How to change or select which program starts when you double-click a file in Windows 8
How malware writers use extensions to trick you into running a virus
A common trick that malware developers will use to trick you into running a computer infection is to send an email attachment that has a file name that contains two periods in it. An example of this type of file name is sales_report.xls.exe. As you can see the file has an .exe extension on it, which means it is an executable. Seeing that a file has this name and is an executable is enough of a hint that you should probably not run the program. On the other hand, what happens if there was a way to make it so that the .exe extension was stripped from the file name so that it appears as sales_reports.xls? That is a much more innocuous looking name, and if you receive this from someone you work with who may be infected, there is a good chance you will think it is legitimate and therefore double-click on it. Once you double-click on it, the file will then execute, because it is actually an executable, and infect your computer.
The malware developers know that this method works because by default Windows does not show you file extensions. Therefore, if you do not have file extensions enabled, windows will just show you everything before the last period in the file name and you may think that it is the full name. Therefore, it is a common tactic for network worms or spammers to send out attachments containing these "double" extensions as they know that Microsoft will strip off the last one and thus making it seem like a safe file.
Due to this, it is important to always show file extensions in Windows so that you cannot mistakenly fall for this trick. For information on how to enable file extensions, please see this tutorial:
Below are a list of common file extensions that you may find on your computer or over the Internet.
Audio Extensions
Extension | Description |
.aif | A Audio Interchange File is an audio file format that is most commonly used on Apple Macintosh computer systems. |
.m3u | M3U files are used to store multimedia play lists. |
.mp3 | An MP3 file is the most common file format used to store digital audio for use on computers and digital media devices. |
.ra | Audio files created by RealAudio. |
.wav | A WAV, or Waveform Audio File Format, is a audio file format used to store audio on PCs. |
.wma | Windows Media Audio, or WMA, files is a audio file format developed by Microsoft. |
Video Extensions
Extension | Description |
.avi | A Audio Video Interleave, or AVI, file is a video and audio file created by Microsoft. |
.flv | Flash video files. |
.mov | Apple QuickTime movie. |
.mp4 | A video file. |
.mpg | A MPEG video file. |
wmv | A Windows Media Video, or WMV, file is a video file type created by Microsoft. |
Image Extensions
Extension | Description |
.bmp | A Bitmap, or BMP, file is an image file used to store bitmap digital images. These files are typically found in Windows. |
.cur | The CUR file format is used to store non-animated cursors in Windows. |
.ico | The ICO file format is used to store computer icons in Microsoft Windows. |
.gif | A Graphics Interchange Format, or GIF, is an image file format created by Compuserve. This is a common format to find on a computer and the Internet. |
.jpg | A JPEG image file is a common file found on computers and the Internet. |
.jpeg | Another extension that corresponds to a JPEG image file. |
.png | A Portable Network Graphic, or PNG, is an image file that was created to replace GIF files. This is a common format to find on a computer and the Internet. |
.psd | A Photoshop Document, or PSD, file is used to store images created by Adobe Photoshop. |
.raw | The raw image format is commonly used by digital cameras to save a picture in a format that has not currently been processed. |
.tif | The Tagged Image File Format, or TIF, is an image file that is commonly used by graphic artists and photographers. |
Workplace Applications and Text Files Extensions
Extension | Description |
.csv | A Comma Separated Value, or CSV, file is a text file that contains lines of data that are separated by commas. |
.doc | A Word Document, or DOC, file is the extension that Word would save its documents. |
.docx | Starting in Word 2007, the .docx file format became the standard file that Microsoft Word would save files as. |
.log | A text file typically containing a textual log of what an application or computer process has done or transmitted. |
A Portable Document Format, or PDF, file is a file format that was created by Adobe Systems. This file format is used to create documents that contain a specific fixed layout regardless of the operating system or application that opens them. | |
.pps | A Microsoft PowerPoint slide show file. |
.ppt | A PowerPoint Document, or PPT, file is the extension that PowerPoint would save its documents. |
.pptx | Starting in PowerPoint 2007, the .pptx file format became the standard file that Microsoft PowerPoint would save files as. |
.rtf | A Rich Text Format, or RTF, file was created by Microsoft to allow the formatting of text, such as bold or underline, in a text document. |
.txt | A text file is a file that contains textual data without any formatting. |
.wpd | The standard file format for saving WordPerfect documents. |
.wps | A Microsoft Works document. |
.xlr | A Microsoft Works spreadsheet file. |
.xls | A Excel Document, or XLS, was the standard file format that Microsoft Excel would saved files as. This was changed to .xlsx starting with Excel 2007. |
.xlsx | Starting in Excel 2007, the .docx file format became the standard file that Microsoft Excel would save files as. |
Compressed Files or Archive Extensions
Extension | Description |
.7z | An archive format that was originally created by the 7-Zip archiver. |
.bz2 | A file that was compressed using bzip2. This file format is commonly used on Linux and Unix systems. |
.cab | A Cabinet, or CAB, file is a compressed archive format used by Microsoft. |
.deb | A Debian Software Package, or DEB, file is a file used to install applications in Debian. |
.gz | A file that was compressed using gzip. This file format is commonly used on Linux and Unix systems. |
.pkg | A Package, or PKG, file is a file used to install applications in Apple OS. |
.rar | A Roshal Archive, or RAR, file is an archive format used by WinRar. |
.rpm | A RPM Package Manager, or RPM, is a file that used to install applications in Linux operating systems. |
.sit | A Stuffit, or SIT, file is a compressed archive that was developed by Stuffit. |
.sitx | A Stuffit X-compressed, or SITX, file is a compressed archive from Stuffit. |
.tar | An archive file created by the Tar utility. This type of file format is commonly found on the Linux & Unix operating systems. |
.tar.gz | A Tar file that was compressed using the Gzip utility. |
.zip | A ZIP file is a compress archive file. This is the most common and popular compressed archive that you will find on a computer and in the Internet. Windows and Macintosh have built-in support for Zip files. |
.Z | A file that has been compressed with the Linux or Unix compress command. |
Web & Internet Extensions
Extension | Description |
.css | A Cascading Style Sheets, or CSS, file contains style sheet language that dictates how the HTML in a HTML file should be displayed. |
.htm | A Hypertext Markup Language, or HTML, files contain HTML markup language, which is used to display formatted content on web pages. |
.html | A Hypertext Markup Language, or HTML, files contain HTML markup language, which is used to display formatted content on web pages. |
.js | A Javascript, or JS, file contains scripts that should be executed by your web browser. |
.part | When you download a file, the downloaded information will be stored in a part file until it is completed. Once it is completed, the file will then be renamed into the files' actual name. |
Disk Image Extensions
Extension | Description |
.dmg | An Apple Disk Image, or DMG, file is a file that contains a archive of a hard disk or CD/DVD. |
.iso | An ISO image is an archive of an optical drive, such as a CD or DVD drive. |
E-Mail Extensions
Extension | Description |
.eml | Some applications like Microsoft Outlook Express, Windows Mail, and Mozilla Thunderbird save your e-mail as individual eml files on your hard drive. If you double-click them, your mail client will open the individual email that it represents. |
.emlx | Similar as the .eml files, but are for Apple Mail messages. |
.mbx | A MBX file that represents a particular folder in your mail client. The name of the file will typically be named after the actual folder it represents. |
.pst | A Microsoft Outlook data file that contains all of your contacts, e-mail, mailboxes, and calendar. |
.vcf | A vCard, or VCF, is a file that acts as an electronic business card. When you receive these via email, you can open them and have the details of the contact imported into your Mail Client. |
Executable Extensions
Extension | Description |
.app | An Application, or APP, is a Mac OS application. These applications are actually folders with the extension of .App. |
.bat | A batch file is a text file containing a series of commands that will be executed when the batch file is launched. |
.cgi | A Common Gateway Interface, or CGI, file is an executable file that is allowed to run on a web server. |
.com | This is an executable file for Dos & Windows operating systems. |
.exe | This is an executable file for Dos & Windows operating systems. |
.pif | A Program Information File, or PIF, file is used to launch a DOS program in a Windows multi-tasking environment using certain settings. |
.vbs | A file containing visual basic script that can be executed by double-clicking on it. |
Windows Extensions
Extension | Description |
.cpl | A Windows Control Panel file. Double-clicking this will launch the associated control panel. |
.dll | A Dynamic Link Library, or DLL, is a shared library in Windows. Executables will use these DLL files in order to properly run. |
.dmp | A memory dump file that was generated by Windows when a program crashed. These memory dump files can be used to determine why a particular program crashed. |
.lnk | These types of files are links or shortcuts to an executable located elsewhere on the Windows operating system. These .lnk files are just a pointer to the executable and can be deleted without affecting the executable itself. |
.msi | A Windows installer file that can be used to install an application on your computer. |
.reg | A Windows Registry file that can be used to make modifications to the Windows Registry. You should never double-click on these unless you know what they are going to do. |
.sys | A Windows driver files that allows Windows to communicate with the hardware installed on your computer. |
.tmp | A temp file created by a program. These temp files should be deleted automatically when a program is closed. They are safe to remove. |
Settings Extensions
Extension | Description |
.cfg | A config file that contains configuration information on how a piece of software should operate. |
.conf | A config file that contains configuration information on how a piece of software should operate. |
.ini | An initialization file that contains settings a program will configure itself with when it starts. |
Font Extensions
Extension | Description |
.fnt | A Windows font file. If you double-click this type of file you will be able to see the particular font in numerous sizes. |
.fon | A Windows font file. If you double-click this type of file you will be able to see the particular font in numerous sizes. |
.ttf | A TrueType font file. If you double-click this type of file you will be able to see the particular font in numerous sizes. |
Programming & Source File Extensions
Extension | Description |
.asp | An Active Server Pages, or ASP, source file that contains source code for Microsoft's ASP server-side scripting language. |
.c | A C file contains source code for the C programming language. |
.cpp | A CPP file contains source for the C++ programming language. |
.h | A header file for the C/C++ programming language. |
.java | A Java file contains the source code file for the JAVA programming language. |
.php | A PHP file contains the source code file for the PHP programming language. |
.pl | A PL file contains the source code file for the PERL programming language. |
.py | A PY file contains the source code file for the Python programming language. |
.xml | An Extensible Markup Language file. These types of files offer a way to textual data in a manner that it can be used by any program that supports the XML language. |
Below are other tutorials about file name extensions: