What Is a File Extension? Common File Types Explained
Every file on your computer ends with a short code that most people barely notice, yet that tiny code does a surprising amount of work. If you have ever wondered what is a file extension, the answer is simple: it is the short suffix after the period in a file name, such as .docx, .jpg, or .pdf. That suffix tells your computer, at a glance, what kind of file it is dealing with and which program should open it.
In this guide, we explain what is a file extension, how operating systems use extensions, how to show them in Windows 11 and macOS, and which common extensions you are most likely to meet. We also look in detail at image file extensions and explain why a hidden extension can sometimes be a safety risk.
What Is a File Extension?
A file extension is the group of letters, and sometimes numbers, that appears after the final period in a file name. In the name holiday-photos.jpg, for example, the extension is .jpg. In report.docx, it is .docx. The main part before the period is the file name you choose; the extension is the suffix that follows it. Together, they make the complete file name. Extensions are usually two to five characters long, although some are longer, such as .html or .pptx.
Think of a file extension as a label on a box. The label does not change what is inside the box, but it helps everyone who handles the box to know what to expect. A music player knows that an .mp3 file contains audio, a photo viewer knows that a .png file contains an image, and a word processor knows that a .docx file contains a document. Without that label, your computer would have to inspect the contents of every file before deciding what to do with it.
It is also worth knowing that the extension is part of the file name, not a separate property hidden inside the file. If you rename a file and change its extension, you do not convert the file into a different format. You simply change the label. That is why renaming holiday.jpg to holiday.png does not turn a JPEG photograph into a PNG image; it usually just confuses the program that tries to open it.
How Operating Systems Use File Extensions
Operating systems use file extensions mainly to decide which application should open a file when you double-click it. Windows, macOS, and Linux all keep a list of associations: a mapping between extensions and programs. When you double-click a .pdf file, the system looks up .pdf in that list and opens your default PDF reader. When you double-click a .mp4 file, it opens your default video player.
Extensions also help operating systems choose an icon for a file, decide which options to show in a right-click menu, and warn you when a file type might be risky. For example, Windows treats .exe files as executable programs, so it may ask for confirmation before running one downloaded from the internet. Modern systems also check a file header, so some programs can open a file even if its extension is wrong, but keeping extensions accurate avoids confusion.
How to Show File Extensions in Windows 11
By default, Windows hides extensions for files whose type it recognizes. That keeps file names tidy, but it also hides useful information. To show file extensions in Windows 11, open File Explorer, click View in the toolbar, point to Show, and then check File name extensions. Extensions will immediately appear after file names.
How to Show File Extensions on macOS
On a Mac, open Finder, then choose Finder, then Settings, or Preferences on older versions of macOS. Click the Advanced tab and check Show all filename extensions. From then on, Finder will display the full name of each file, including its extension. If you rename a file in Finder and change its extension, macOS will usually ask you to confirm the change.
Common File Extensions by Type
The table below lists many of the extensions you will meet most often, grouped by what the file is used for. You do not need to memorize them all, but recognizing the main groups will help you choose the right program and format when you save your own work. For example, an XML file is a structured text format, while a CSV file is a plain-text way to store tables.
| Type | Common extensions | Typical use |
|---|---|---|
| Documents | .docx, .pdf, .txt, .rtf, .odt | Word processing, reports, plain text, and documents designed to look the same everywhere |
| Spreadsheets and data | .xlsx, .csv, .ods | Tables, budgets, lists, and data that can be opened in a spreadsheet |
| Presentations | .pptx, .key, .odp | Slide shows and presentations |
| Images | .jpg, .png, .gif, .webp, .svg, .bmp, .tiff | Photographs, graphics, logos, and scanned images |
| Audio | .mp3, .wav, .aac, .flac, .ogg | Music, podcasts, voice recordings, and sound effects |
| Video | .mp4, .mov, .avi, .mkv, .webm | Films, clips, screen recordings, and saved video |
| Archives | .zip, .rar, .7z, .tar.gz | Compressed folders containing one or more files |
| Executables and installers | .exe, .msi, .dmg, .app | Programs and installers that run on a computer |
| Web files | .html, .css, .js | Web pages, stylesheets, and scripts |
Image File Extensions Explained
Images deserve a closer look because the choice of image extension affects quality, file size, and whether transparency is possible. Photographs, screenshots, logos, and illustrations are not interchangeable, and saving a picture in the wrong format can make it look worse or much larger than it needs to be.
| Extension | Best use | Key points |
|---|---|---|
| JPG / JPEG | Photographs | Small files with lossy compression; no transparency |
| PNG | Logos, screenshots, and graphics with sharp edges | Lossless quality and transparency, but larger files for photos |
| GIF | Simple animations and small graphics | Limited colors; supports short animations and transparency |
| WebP | Photos and graphics on the web | Modern format with good compression and transparency |
| SVG | Logos and icons | Vector format that scales cleanly to any size |
| TIFF | High-quality printing and archiving | Excellent quality, but large files |
| BMP | Uncompressed images | Very large files; rarely the best choice today |
For everyday photographs, JPG is usually the sensible choice because it keeps file sizes manageable. For a logo or a screenshot with text, PNG is usually better because it preserves sharp edges and can include transparency. For a modern website, WebP often offers a good balance of quality and size. Meanwhile, SVG is different from the rest because it describes shapes mathematically rather than storing pixels, which is why a logo saved as SVG can be enlarged without becoming blurry.
Can You Change a File Extension?
Yes, you can rename a file and change its extension, but that does not convert its contents. A genuine conversion requires opening the file in a suitable program and using Save As or Export to create a new file in the desired format. For example, to turn a .png screenshot into a .jpg photograph, open it in an image editor and export it as a JPEG. The editor will then rewrite the image data in the new format.
There are also dedicated converters, including free tools built into Windows, macOS, and many websites, for documents, images, audio, and video. Before using an online converter, think about privacy: avoid uploading sensitive documents or personal photographs to a service you do not trust.
Safety: How Extensions Can Hide Malware
File extensions matter for safety as well as convenience. One common trick is the double extension. An attacker may name a harmful program invoice.pdf.exe or photo.jpg.exe. If extensions are hidden, Windows may display only the first part of the name, so invoice.pdf.exe can look like invoice.pdf. The file, however, is still an executable program, and opening it can install malware.
That is one of the strongest reasons to show file extensions on your computer. Once extensions are visible, a double extension becomes obvious, and you can pause before opening an unexpected .exe, .bat, .scr, or .js file. Be especially careful with attachments that arrive unexpectedly, and never run a program simply because its name includes a familiar word such as invoice, photo, or document.
Frequently Asked Questions
What is a file extension in simple terms?
A file extension is the short suffix after the period in a file name, such as .docx, .jpg, or .mp3. It identifies the type of file and helps your computer choose the right program to open it.
How do I show file extensions in Windows 11?
Open File Explorer, click View, point to Show, and check File name extensions. The extensions will then appear after the names of your files.
How do I show file extensions on a Mac?
Open Finder, choose Finder and then Settings, click Advanced, and check Show all filename extensions. Finder will then display the full file name for every file.
Does changing a file extension convert the file?
No. Changing an extension only changes the label, not the contents. To convert a file properly, open it in a suitable program and use Save As or Export to save it in the new format.
What is a double extension, and why is it risky?
A double extension is a name such as invoice.pdf.exe, where the real extension is hidden at the end. If extensions are hidden, the file can look like a harmless document when it is actually an executable program, so always show extensions and be cautious with unexpected attachments.
Once you know what is a file extension, file names stop looking like random codes and start making sense. Show extensions on your computer, choose the right format when you save a file, and treat unexpected executable files with care. Those three habits will save time, prevent avoidable mistakes, and help you stay safer online.
-
-
-
-
-
-
Show Comments[…] What Is a File Extension? Common File Types Explained […]
[…] What Is a File Extension? Common File Types Explained […]
[…] What Is a File Extension? Common File Types Explained […]
[…] What Is a File Extension? Common File Types Explained […]
[…] formats can be confusing, and DDS is one of many specialised formats. Our guide to what a file extension means explains how Windows decides which program opens a file, and our guide to what JPEG is explains why […]
[…] the parts are in the same folder. If you are unsure how file types work in general, our guide on what a file extension is and the most common file types explains the letters after the dot and what they tell Windows about a […]