Here are answers to some common questions about file names and file name extensions.

Show all

What is a file name extension?

A file name extension is a set of characters that helps Windows understand what kind of information is in a file and what program should open it. It is called an extension because it appears at the end of the file name, following a period. In the file name myfile.txt, the extension is txt. It tells Windows that this is a text file that can be opened by programs associated with that extension, such as WordPad or Notepad.

How can I control which programs are associated with a file name extension?

Every program that's installed on your computer is designed to open one or more particular file types, each of which is identified by a file name extension. If you have more than one program on your computer capable of opening a file type, then one program is set as the default. To change the program that automatically opens a type of file, see Change the program that opens a type of file.

What is the maximum length of a file name?

Windows usually limits file names to 260 characters. But the file name must actually be shorter than that, since the complete path (such as C:\Program Files\filename.txt) is included in this character count. This is why you might occasionally encounter an error when copying a file with a very long file name to a location that has a longer path than its current location.

Which characters can't be used in a file name?

You can't use any of the following characters in a file name: \ / ? : * " > < |

How can I see file name extensions in the file name?

By default, Windows hides file name extensions to make file names easier to read, but you can choose to make extensions visible. For more information, see Show or hide file name extensions.

How do I change a file name extension?

Usually, file name extensions should not be changed because you might not be able to open or edit the file after doing so. Sometimes, however, changing the file name extension can be useful—such as when you need to change a text file (.txt) to an HTML file (.htm) so that you can view it in a web browser. To change a file name extension, first ensure that file name extensions are visible. Then, right-click the file you want to change and click Rename. Delete the file name extension, type the new extension, and then press ENTER. Windows will warn you that changing the file name extension might cause the file to stop working properly. If you are certain that the extension you typed is one that the program you are using will understand, click Yes to confirm the change.