How long file extension can be?

by on

File extensions help operating systems and users to identify particular file type so they know which application or program to use for opening it.

In some operating systems (Unix, Linux, Mac OS) the file extension is purely optional, whilst in other systems (OS/8, CP/M, MS-DOS, Microsoft Windows) it is actually required.

Linux shell list of files
Linux shell screenshot

Historical limitations of old operating systems, such as MS-DOS and early versions of Windows, were eight characters for the file name and three characters for the file extension with them being separated by a dot.

These limitations were removed with the introduction of Windows 95 and file names up to 255 characters were allowed. However, detection of file type by its extension remained mandatory in Windows even in the latest Windows 10 version.

In Unix based operating systems these limitations do not exist and you can have up to 255 characters for the file name. The purely optional extension is not even part of the actual file name.

MS-DOS shell
MS-DOS file sample

Nowadays the maximum of 255 characters for the file name is de facto standard in every modern operating system.

This means you can have up to 253 characters long file name, a dot between the extension and a one character extension for a total of 255 characters. The opposite (though very unlikely) is also possible. You could theoretically create a file that has one character in file name, a dot and 253 characters long extension.

You can also have as many dots as you like as part of the file name, because systems that require a file extension separator only look for the last one to determine the actual suffix to file name.

Did this entry help you?
If the information in this article helped you, please share it with your friends!

Subscribe to and get our news everywhere!


Add new comment about “How long file extension can be?

Follow us!

Enter any file extension without dot (e.g. pdf)
Search for file extension details and associated application(s)

RSS feed