Files and data

What is File extension?

A file extension is the suffix after the final dot in a filename that commonly indicates its format, such as .jpg or .pdf.

How it works

Operating systems use the extension to decide which application opens a file and which icon to show. It is only a naming convention: the bytes inside the file determine its actual structure, and nothing stops a file from carrying the wrong extension.

Mismatches happen more often than you might expect. Downloads sometimes arrive with a generic name, websites serve WebP images named .jpg, and people rename files hoping to convert them. If a file won’t open, inspect its real type before assuming the extension is accurate.

Extension vs file signature vs MIME type

Three labels can describe the same file. The extension is part of the filename and easy to change. The file signature is a pattern of bytes inside the file written by the program that created it. The MIME type is what a web server or email declares when sending the file. When they disagree, the signature is usually the most reliable.

A practical example

Renaming photo.png to photo.jpg changes its name but leaves the PNG data inside unchanged. A converter must decode and re-encode it to create a JPEG.

What to watch out for

An extension isn’t proof of a file’s contents or safety. A file type checker identifies supported signatures but isn’t a malware scanner, and a file named invoice.pdf.exe is still a program.

Tools you can use

Go a little deeper

Common questions

Can I change a file’s format by renaming it?

No. Renaming only changes the label. The data inside stays in its original format, so the file may refuse to open or open in the wrong program. Use a converter to change the format.

How do I see file extensions on Windows or Mac?

On Windows, open File Explorer, choose View and enable File name extensions. On a Mac, open Finder settings, choose Advanced and enable Show all filename extensions.

What if a file has no extension?

Its format can still be identified from the bytes at the start of the file. A file type checker reads that signature and suggests the right extension.

Related terms

Browse the complete file format glossary →