What Is a File Type? A Beginner’s Guide to File Extensions
Here is a quick test. You see a file named photo on your screen. But photo what, exactly? Is it a picture, a video, or a document? You cannot really tell, and neither can your computer, unless there is one tiny clue attached to the name. That clue sits right after the dot, and it is called the file type. By the end of this article, you will know exactly what a file type is and why it matters.
What is a file type?
A file type is a short tag at the end of a file name that tells the computer what kind of information is inside the file. It sits right after the dot, like the jpg in photo.jpg. Those few little letters carry big meaning: they let your computer know whether the file is a picture, a video, a document, or plain text, before it ever opens it.
If you are just starting out, this is one of the first ideas we cover in the free Zero to AI Hero course, because it shows up everywhere once you begin working with a computer.
Where do I find the file type?
Look at almost any file name and you will notice something. It nearly always has a dot in it. The part after that dot is the file type, also called the extension.
photo.jpg— the type is.jpgmovie.mp4— the type is.mp4resume.pdf— the type is.pdfnotes.txt— the type is.txt
Six little letters, big meaning. The name in front of the dot is your choice, but the type after the dot is what tells the computer what to expect.
What is an easy way to picture a file type?
Think of a tray of snacks at a party. A triangle is a samosa. A spiral is a jalebi. A round one is a laddoo. You do not have to taste any of them to know what they are. The shape tells you what is inside before you take a bite.
A file type works the same way. The part after the dot is the “shape” of the file. The computer reads that tag and instantly knows what is inside, without having to open the file first.
- The name is your choice, like
photoorresume. - The type comes after the dot and describes the content.
The name and the type work together. That small dot does all the work of separating the two.
What do common file types mean?
You will run into the same handful of file types again and again. Here are the ones worth memorising:
.jpgmeans a photo or picture..mp4means a video..pdfmeans a document you can read..txtmeans plain text, just simple words..pymeans a Python program, a file full of code instructions.
So when you see holiday.mp4, you already know it is a video. When you see script.py, you know it is Python code. You are reading the hints, just like that.
Why does the file type matter?
The file type does one very important job: it decides which app opens the file. When you double-click a file, your computer looks at the type and picks the right program to handle it.
- A
.jpgopens in your photo gallery or image viewer. - An
.mp4opens in a video player. - A
.pdfopens in a document reader. - A
.pyfile is run by Python or opened in a code editor.
This is also why renaming a file the wrong way can confuse your computer. If you change photo.jpg to photo.txt, the computer will try to read a picture as plain text, and it simply will not look right. The type is a promise about what is inside, so it pays to keep it accurate.
Can I see file types myself right now?
Yes, and it takes less than a minute. If you have access to a terminal (a simple text window where you type commands to your computer), open it and type this:
ls
The command ls is short for “list”. Press Enter, and your computer shows you the files in your current location. Now look at each file name and find the part after the dot. That is the file type you just learned about.
Can you guess what each one holds? A .txt file has text, a .jpg file has a picture, a .pdf file is a document, and a .py file is Python code. Just like that, you are reading file types like a developer.
Quick recap
- A file type is the tag after the dot that tells the computer what is inside a file.
- The name in front of the dot is your choice; the type after the dot describes the content.
- Common types include
.jpg(photo),.mp4(video),.pdf(document),.txt(text), and.py(Python code). - The type decides which app opens the file, so keeping it accurate matters.
- You can spot file types by listing files in a terminal with the
lscommand.
That is what a file type is, fully explained. Want to keep building these foundations? You can learn step by step with a fresh two-minute lesson every day. Next up, we will explore what a program actually is.
🚀 Take the full free course: Zero to AI Hero — learn to build with AI from scratch. New lessons daily, in Hindi & English.
Want to actually learn this?
151 free 2-minute lessons — from "what's a file?" to building with AI.
▶ Start the free course