File extension

A file extension usually defines the file format of a file. It is the final part of a filename, following the dot in the name of the file. For example, in "index.html", the file extension is "html" (or more frequently ".html"). This defines the file index as an HTML file.

The main advantage of a file extension is that it defines the type of the file, "doc" for document, "txt" for text file, "html" for a web page, "exe" for an executable, and so on. File extensions enable the recognizing of the type of a file for both humans and computers.

The main purpose of a file extension for humans is to be an indicator of what a file does, for example, a file with the .exe extension is an executable, and therefore it is usually the main file in a program or game which executes all of the code.