File extensions are the letters after the period in a filename that tell the operating system which program to use when opening a file. This content covers how extensions work, how to show or hide them in Windows, and how to manage default app associations.
File Extensions
When you double-click a Microsoft Word document, it opens up Microsoft Word. When you double-click a PDF document, it opens up a PDF reader. Your computer knows what programs created, or what programs can read, these different documents. But there has to be a mechanism that tells the computer what type of document it is.
Extensions are the letters that come after the period in one of our files. For instance, if we see a TXT, that's a text document, or if we see an RTF, that's a rich text format.
I'm on my demo laptop, and I'm going to right-click on this screen and I'm going to say new, and we're going to create a new text document. And we're just going to call this a test doc and we'll leave it at that. And as you can see, it's got a certain icon that looks like a page, and if I open this up, it knows to open it up in Notepad. So the computer knows that this is a Notepad document, or that Notepad is what we want to use to edit that.
The extension shows up at the end of the name. So this document right here, the name is actually test.txt. However, this operating system hides the TXT at the end, and so what we want to do is we want to be able to see that. So I'm going to do a show file extensions, and so we'll hit enter on there. And I'm going to shrink this down a little bit so we can actually see this. So right now it's hidden, but watch what happens to this document if I were to turn this on to show file extensions. So I'm going to turn it on, and now it's TXT. So that's what's being hidden right here.
Now let's do a little experiment. Let's actually delete that .txt. So I'm going to go in here and let me change the name of this. I'm going to delete the TXT and hit enter, and it says, warning, if you change this file name extension the file might become unusable. And I'm going to still proceed. So there we go — now it loses its document look. That is, it still looks like a document but doesn't have words on it. And then if I were to open this up, it wouldn't know what program to open it up with, and then I've got a few options here that I could actually open this program up with. I'd have to choose which option I want.
And so I'm going to click on this and I'm going to put that TXT extension back on it and hit enter. Notice it changes the look of that a little bit, and now if I double-click on it, it knows to open this up.
Here are some common extensions that you might see out there. ODF, DOC or DOCX — which is interesting, it brings up the point that a lot of our extensions are just three characters, like DOC, but it can have four characters, like DOCX. In fact, it actually can have many different characters to it, so we see a lot of different options here. PPT for PowerPoint, PDF for portable document format. We can see here there's extensions that are associated with images. JPEG is a big one that's out there, same thing GIF, so those are some common image ones. And we've got some video in there as well, we've got some audio formats here, we've got some scripts, and we also have some compression formats, or compression extensions, there.
When I right-click on this document, what happens is there's this open with, and I have options that I can open this with. What I'm going to do is I'm going to go through the install process and actually install a program called Notepad++. I really love it for doing things like scripting and coding, and so I'm going to download that program so I can have another text editor on here.
Now that I have Notepad++ installed here, I'm going to right-click this text document and open with and choose another app, and then I'm going to navigate this PC and choose Notepad++. Now notice what happens here: I have the option now to choose Notepad or Notepad++, and so I can click one of these or the other one, and I can choose to do it just once or choose to do it always. If I select always, then always in the future this text document — or the TXT documents — will by default open in that. And we'll see what happens here: you can see that the icon of this document right here is now changed.
To reassociate TXT files with the Notepad program rather than Notepad++, I could go through that same process and choose the different program. Or what I can also do is click on here and say default apps and hit enter. And what this is going to do is it's going to show me all of the extensions and all the default apps depending on what extensions there are. So what I'm going to do in this window is scroll down to where I get to the Notepad. Here's the different files that are associated with Notepad: soin ini log. So one of them happens to be this text, and as you can see it's associated with Notepad++. So instead I can choose to associate that with a different program like Notepad, and I'll set that as the default. So this is another way that I could go about setting these extensions, correlating them with the default program that would then open it up. Notice now that my test.txt is back to that Notepad symbol.
TechKnowSurge builds IT and cybersecurity professionals through hands-on, concept-first training built around real understanding — not memorization. Free interactive tools, structured programs, and 25+ years of real-world experience, all in one place.
Explore free tools and programs →