Computers use names for files. A name has a small part at the end. This part has a dot before it. It tells us what the file is. It helps us find the right tool to open it. Do you use a computer?
Computers give files names. A name has a small part at the end. This part has a dot before it. It is like a tag on a box. The tag tells us what is inside. It helps us find the right tool to open it.
Some tags are very short. One system used only three letters. Other systems use long names. A file can even have two tags. This happens when one file is inside another.
Tags help people know what a file is for. They help us see if it is music or a picture. This makes using a computer much easier.
Computers give every file a name. At the end of the name is a small tag. This tag is called a filename extension. It usually starts with a dot. Examples are .txt for text or .mp3 for music. These tags help people know what is inside a file.
Different computer systems use extensions in different ways. Old systems like DOS had strict rules. They used a name with eight letters. Then they used a dot and three more letters. Modern systems like Windows and Unix are more flexible. They can use much longer names.
Sometimes you might see two extensions on one file. This happens when one file is tucked inside another. For example, a .tar.gz file is a compressed archive. The .tar part means it is an archive. The .gz part means it is compressed with a tool called gzip.
Extensions are mostly for people to read. Many programs look at the actual data inside to see what a file is. You should not trust an extension alone. A person can change an extension to hide a bad file. Always be careful when opening new files.
A filename extension is a small tag at the end of a computer file name. It usually starts with a full stop, which is also called a period. You might see examples like .txt for text or .mp3 for music. These tags tell you about the contents of a file or how it should be used. They help people understand what they are looking at on a screen. While they are helpful for humans, they are not the only way computers know what a file is. Many files also have hidden data inside them called metadata that describes the file.
How these tags work depends on the system your computer uses. In some older systems, the extension is a separate part of the file's identity. For example, the FAT file system used in DOS treats the extension as its own thing. In DOS and 16-bit Windows, names were limited to eight characters. Then, you would add a period and an extension of up to three letters. Other systems, like Unix or NTFS, treat the extension as just more characters in the name. In these systems, a dot is just another character that can be used anywhere. This allows for much longer and more flexible names.
History shows how these rules have changed over time. An early operating system called CTSS kept the name and the type separate. Later, systems like CP/M and DOS continued this practice of using a dot to separate them. When Windows 95 arrived, it used a system called VFAT to allow much longer names. This moved away from the old 8.3 rule where names were very short. Even modern systems like Windows NT and ReFS still use suffixes. They do this to make sure they stay compatible with older versions of Windows.
Sometimes you might see a file with more than one extension. This often means one file is tucked inside another through a process called nesting. A common example is a file ending in .tar.gz. The .tar part tells you it is an archive of many files. The .gz part tells you the file has been made smaller using a tool called gzip. You might also find different files sharing the same extension. For instance, .rpm can be used for both package managers and RealPlayer files. This can sometimes make it hard to know exactly what a file is just by looking at its name.
It is important to remember that extensions are not always perfect. A person can change an extension to hide what is actually inside a file. This can be a way to disguise a file that might cause harm to a computer. Because of this, experts suggest not trusting an extension alone. Many modern computers use a different method to stay safe. They look for a "magic number," which is a special sequence of bytes at the start of a file. This helps the computer identify the true type of the file regardless of its name.
A filename extension is a suffix added to the end of a computer file name. It serves as a label to indicate the contents of a file or its intended use. These extensions are typically separated from the main name by a full stop, also known as a period. For example, a file named "readme.txt" uses the extension ".txt" to signal it is a text file. While these suffixes are highly useful for human users, they are actually a form of metadata. Metadata is information that describes other data. In many modern systems, the extension is just one way to identify a file, as many files contain internal metadata that describes their own format.
How a computer handles these extensions depends heavily on its file system. Some older file systems treat the extension as a distinct part of the file's identity. For instance, the FAT file system used in DOS and 16-bit Windows implements extensions as a specific feature. In these systems, filenames followed an "8.3" rule. This meant a name could have a maximum of eight characters, followed by a period, and an extension of up to three letters. However, the period itself was not actually stored by the system. In contrast, many other systems treat the extension as just more characters in a single string. Unix-like systems, VFAT, and NTFS treat the extension as part of the filename without any special distinction. In these environments, the period is simply another character that can appear anywhere in the name.
Different operating systems have developed unique ways to manage file identification. The Multics file system allowed for variable-length filenames and could even include multiple dots. This meant a file could have no suffix at all, or it could have multiple suffixes. The classic Mac OS took a different approach entirely. It did not use filename-based extensions to identify file formats. Instead, it used a distinct file type code and a creator code. The creator code determined which specific application would launch when a user double-clicked the file icon. Modern macOS uses a combination of these methods, including filename suffixes and Uniform Type Identifiers, because it is derived from the UNIX-like NeXTSTEP system.
History shows how these naming conventions have evolved alongside computing power. Early systems like CTSS stored the filename and file type separately. This practice continued through DEC operating systems like RT-11, as well as CP/M and DOS. A major shift occurred with the arrival of Windows 95. This version introduced VFAT, which supported long filenames and removed the strict 8.3 limit for non-NT Windows. Even as newer systems like NTFS and ReFS were developed, they continued to use the suffix convention. They did this to ensure compatibility with existing versions of Windows. Even the High Performance File System (HPFS) used in OS/2 supported extended attributes, yet the convention of using suffixes remained the standard.
Sometimes, a single file may appear to have more than one extension. This is often seen in cases of nested transformations. For example, a file named "files.tar.gz" uses two suffixes. The ".tar" indicates that the file is a tar archive containing one or more files. The ".gz" indicates that this archive has been compressed using a tool called gzip. While some authors define an extension in a way that does not allow more than one per name, these nested labels are common in practice. However, users should be careful because some extensions are not unique. The extension ".rpm" can refer to both RPM Package Manager packages and RealPlayer Media files. Similarly, ".qif" can represent DESQview fonts, Quicken financial ledgers, or QuickTime pictures.
In the world of internet communication, filename extensions are often replaced by MIME types. MIME stands for Multipurpose Internet Mail Extensions. When transferring data via protocols like HTTP, the system uses a "Content-type" line to state the media type of the stream. For example, a server might send "text/plain" to identify a text file. There is no standard mapping between filename extensions and MIME types, which can cause mismatches. If a web server does not recognize a specific extension, like "svgz" for a compressed vector graphic, it might fail to send the correct content type. This can leave web browsers unable to interpret or display the file correctly. To solve this, some desktop environments use a heuristic approach. They examine both the suffix and the actual contents of the file to decide which application to launch.
Finally, it is vital to understand the security implications of filename extensions. An extension is not a reliable indicator of what a file actually contains. A user can easily change an extension to disguise malicious content. Because of this risk, cybersecurity experts look for a "magic number." A magic number is a distinctive sequence of bytes located in the file's header. This internal signature allows the computer to identify the true file format regardless of what the filename says. Relying solely on the suffix can lead to errors or security vulnerabilities, making internal metadata a much more robust method for file identification.
More to explore
✨ What else?
Related topics you might enjoy
🪜 Step back
Simpler topics to build understanding
What is Nepedia?
A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.