Home › Guides

What Is a File Extension and Why It Matters

What Is a File Extension and Why It Matters

A file extension is the group of letters after the last dot in a file name, such as .docx or .jpg. It tells the computer which program should open the file. Understanding extensions helps you open files correctly, spot suspicious downloads and save files in the format you need.

Common file extensions

ExtensionTypeUsually opened by
.docxWord documentMicrosoft Word, Google Docs
.xlsxExcel spreadsheetExcel, Google Sheets
.pdfPortable documentAny PDF reader, browsers
.jpg or .pngPicturesPhoto viewers, browsers
.mp4VideoVideo players
.zipCompressed archiveBuilt-in unzip tools

Show extensions on Windows

By default Windows may hide known extensions. Open File Explorer, select the View menu, then Show, and turn on File name extensions. This lets you see the real type of each file.

Show extensions on Mac

In Finder, press Command + Shift + Period to show hidden files, or open Finder settings under Advanced and choose to show all filename extensions.

Why extensions matter for safety

Criminals sometimes disguise a dangerous file as a harmless one. A file named "invoice.pdf.exe" is a program, not a PDF, even though the first part looks like a document. Always check the last extension before opening a file from an email or download.

Change an extension correctly

Changing the extension does not convert the file. A photo renamed to .png may not open. Use the program's Export or Save As command to convert a file to a different format.

Frequently asked questions

Can a file have two extensions?

Yes. Archives such as .tar.gz have two layers. The last extension usually describes the outer format.

What if the extension is missing?

Open the file with a program you expect, or ask the sender which program they used. Do not open unknown files from unknown senders.

See also how to spot phishing emails, which uses similar signs.

Extensions for code and data

Developers and analysts meet extensions such as .csv, .json and .txt often. A CSV file is plain text with values separated by commas, and it can be opened in a spreadsheet. A JSON file is structured text used by many apps and web services. Knowing these extensions helps you choose the right program and avoid corrupting data by opening it in the wrong editor.

Keep the extension when you rename

When renaming a file, keep the extension at the end of the name. Removing it can make the system guess the wrong program. If you type a new name without a dot and extension, Windows may warn you, and macOS may ask for confirmation. Always check the extension after a rename.

Related reading