File names and file name extensions: frequently asked questions

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.


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 when you double-click a file, see Change the program that opens a type of file.

How long can a file name be?

It depends on the length of the complete path to the file (such as C:\Program Files\filename.txt). Windows limits a single path to 260 characters. This is why you might occasionally get an error when copying a file with a very long file name to a location that has a longer path than the file's original 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?

Windows hides file name extensions to make file names easier to read, but you can choose to make extensions visible. To learn how, 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

  1. Make sure that file name extensions are visible. To learn how to do this, see Show or hide file name extensions.

  2. Right-click the file you want to change, and then click Rename.

  3. Delete the file name extension, type the new extension, and then press Enter.

  4. 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 will work with the program you're using, click Yes to confirm the change.

Need more help?