# File Extension

> The ending after the dot in a file name, like .pdf. It hints at what kind of file it is.

**Field:** Software Development  
**Category:** Files & Formats  
**Also known as:** Filename Extension, File Suffix

## Think of it like

Think of it like a label on a jar. It tells you what is inside before you open it.

## Definition

A file extension is the short ending on a file name, after the last dot. In report.pdf, the extension is .pdf. It hints at the file's format. Your computer uses it to pick which app opens the file. It is only a hint, though. The real format is in the bytes inside.

## Example

Emma double-clicks budget.xlsx. Her computer sees .xlsx and opens it in her spreadsheet app.

## Example code

```console
$ ls
notes.txt  photo.png  report.pdf
```

Three files. The letters after each dot hint at what kind of file it is.

## Why it matters

Extensions decide which app opens a file. Some systems hide them, and that lets a fake file pass as a safe one.

## Common mistake

Renaming photo.png to photo.jpg to change its format. Only the label changed, so some apps refuse to open it.

## Three principles

- **After the last dot.** The extension is the final part of the name.
- **Picks the app.** The system opens the matching program.
- **Only a hint.** The bytes inside are the truth.

## Related terms

- [File Format](https://learn.benibix.com/term/development/file-format)
- [Media Type (MIME Type)](https://learn.benibix.com/term/development/mime-type)
- [File Path](https://learn.benibix.com/term/development/file-path)
- [Plain Text File](https://learn.benibix.com/term/development/plain-text-file)
- [Binary File](https://learn.benibix.com/term/development/binary-file)

## Told apart from

- [File Extension vs MIME Type](https://learn.benibix.com/compare/file-extension-vs-mime-type): People think the ending of a file name says what the file is, and it does not. The extension is a hint that your own computer reads to pick an app. On the web, the browser trusts the media type the server sends instead. When the two disagree, the browser goes with the server's label.

## Taught in

- [File Formats and Extensions](https://learn.benibix.com/learn/development-formats/file-formats-and-extensions): File Formats, 1/11

![Two panels. On the left, notes.txt, with .txt picked out, holds two readable lines, Buy milk and Call Jack at 5, and carries the label text/plain. On the right, photo.png, with .png picked out, holds rows of hex bytes starting 89 50 4E 47, and carries the label image/png. Notes under them say the ending after the dot is the file extension and the label is the media type a server sends.](https://learn.benibix.com/diagrams/dev2-file-types.svg)

---

Source: https://learn.benibix.com/term/development/file-extension
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-18
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
