File Types & Extensions Explained

Middle & High School Depth 0 in the knowledge graph I know this Set as goal
Unlocks 5 downstream topics
files extensions formats file-management

Core Idea

Files have extensions (like .txt, .doc, .jpg, .pdf) that tell your computer what type of file it is and which program should open it. Understanding file types helps you save correctly and know which program to use.

How It's Best Learned

Look at files on your computer and note their extensions. Open a file and see what program opens it. Save the same content in different formats and observe what changes.

Common Misconceptions

Explainer

Every file on your computer has a name that usually ends with a dot and a short code — .txt, .jpg, .pdf, .mp3. This code is the file extension, and it serves as a label that tells your computer (and you) two things: what kind of information is stored inside, and which program should open it. Your operating system uses the extension to automatically launch the right program — double-click a .pdf and Adobe Reader or your PDF viewer opens; double-click an .mp3 and your music player opens. Without extensions, you'd have to manually tell the computer which program to use every single time.

Different extensions represent different file formats — different ways of organizing and encoding information. Documents alone have many formats: .txt stores plain text with no formatting at all; .docx stores text plus formatting, images, and layout in Microsoft Word's format; .pdf stores a fixed, print-ready layout that looks identical on any device. Images have their own families: .jpg (or .jpeg) compresses photos by discarding some detail, making files small; .png compresses without losing any detail, making files larger but pixel-perfect; .gif stores short animations and simple graphics. Videos, audio, spreadsheets, and programs all have their own format families for similar reasons.

The critical thing to understand is that the extension is just a label — it does not change what's inside the file. If you rename a photo from photo.jpg to photo.txt, the bytes inside are still the image data. But now your computer thinks it's a text document and will try to open it with a text editor, producing gibberish. The file is not broken; it's just mislabeled. This is why renaming an extension rarely helps and can cause confusion — you haven't converted the file, only confused the labeling system.

To actually convert a file from one format to another, you use software that reads the original format and writes the new one. "Save as" in a word processor lets you save a .docx as .pdf — the program reads your document, renders it into fixed layout, and writes a new file in PDF format. Online converters do the same thing. Extensions are only meaningful when they accurately describe what's inside. On most computers, extensions are hidden by default; you can turn on "show file extensions" in your file manager settings, which makes the system more transparent and helps you understand what you're actually working with.

Practice Questions 5 questions

Prerequisite Chain

This is a foundational topic with no prerequisites.

Prerequisites (0)

No prerequisites — this is a starting point.

Leads To (1)