Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm finishing up my app for iPad, and the filename extension (used mostly so that Mail and Dropbox know what program to open the files in) is 12 characters long. The only filename extension that is anywhere near as long is tax2010. Why is there so little variation on this topic, and what kind of problems can I expect by using a long filename extension for my app? These files will be mailed, copied, and shared*.

In all tests, it works perfectly.

* I hope.

share|improve this question
I've seen a few more file extensions that long (just a few hours ago while browsing a Visual Studio project: .resources and .csproj). But yeah, most file extensions are shorter. – delnan Dec 21 '11 at 17:42
Historical bias from the days of yore when storage and processing power weren't as plentiful. – Anthony Pegram Dec 21 '11 at 17:43
No, actually, historical bias from the days when we did not have command-prompt autocomplete. You know how programmers are oh-so bored to hit keystrokes. – Mike Nakis Dec 21 '11 at 18:15
There is no such thing as a file extension, at least not in more recent operating systems. – Ingo Jul 17 '13 at 14:50
@Ingo explain yourself... – Zack Oct 27 '14 at 18:31
up vote 12 down vote accepted

A lot of developers were at least using computers back when long extensions where a technical restriction. Even today, there are still programs in active use that choke on things such as spaces in file paths and long extensions.

As long as you don't suspect that your files will need to be used by these programs, there isn't a technical reason to stop you.

Do please remember though, that the short extensions that can be comprehended in a single glance will be much better for your users. So while .resources is a great example, .customhatbymycompany is definitely not.

share|improve this answer
What about .customHatByMyCompany or .custom_hat_by_my_company ? <evil grin> Or even .custom hat by my company (both Windows & Linux seem to have no problems with spaces in file name extensions) – Mawg Feb 6 '15 at 15:33

Longer filenames:

  • Take more typing, resulting in more effort / misskeys
  • Take up more screen space
  • Are a break with tradition
  • Are not important because file extensions are for machines not people
  • Take up valuable characters in systems with a restriction on path length

Whether or not these considerations are a problem for your application is a matter for you and your users.

share|improve this answer
I disagree with your fourth point: extensions have normally had human associations. An operating system doesn't care if an executable is .exe or .df, after all, as long as there's a convention. Such extensions as .cpp, .jpeg, and so forth are designed for easy human reading. – David Thornley Dec 21 '11 at 20:44
@DavidThornley: It is arguable that,iIn modern versions of Windows, file extensions are hidden by default, so are not meant to be seen by "normal" users. However, in many other cases I'd agree that this isn't relevant - hence my disclaimer. – Kramii Dec 21 '11 at 22:39

As @Anthony said in the comments, a three letter (on DOS->Windows line) file extension is a historical remain. Nowadays, it is no longer a restriction with modern operating systems although it remains curiosly common.

Since it is expected that as time goes by, that practice will slowly be abandoned, I chance that you could go with a longer file extension, expecially if your tests confirmed that in your environment it "works okay".

The only problem that I can guess is that in some cases it will be shortened to "tax".

share|improve this answer
Thanks. Just to be clear, my extension is not tax2010, which is just an example of a longer one. – Dan Rosenstark Dec 21 '11 at 17:57

File extensions are used to distinguish between different types of files, not to tell a story. That's why they are short: even with three letters length, the chances to have a collision on the same machine are pretty small.

Long extensions mean less space for the remaining path and file name. Maybe in modern operating systems and software it doesn't matter since they accept very long file paths. Sadly, this is not the case with Microsoft, where .NET Framework still cannot manage paths longer than 259 characters. 12 characters taken for extension means 246 characters left for the path without extension. In some cases, it may be a problem.

Since this issue does not apply in your particular case, the only reason to avoid long extensions is if file names, including extensions, are typed by the user, especially on mobile devices where typing can be hard.

share|improve this answer

File extensions are a rudimentary form of metadata about a file. Hopefully someday we'll move away from archaic naming conventions and start storing more metadata as file attributes.

share|improve this answer
Metadata is fine, but its hard to beat the simple convenience of looking at a file name and knowing what type of file it is. – GrandmasterB Dec 21 '11 at 19:32
File extensions also allow the same folder to contain "foo.dll" and "foo.pdb". If you try to replace that system with naming each file just "foo" with meta data indicating that they are respectively compiled code and metadata about that code relevent to debugging, you get a name collision. – JGWeissman Dec 21 '11 at 19:40
MacOS, before MacOSX, had two four-byte fields in each file to identify file type and application it belonged to. The user would determine file type from the icon. – David Thornley Dec 21 '11 at 20:48
Fascinating, but is it an answer to the question? – Dan Rosenstark Dec 22 '11 at 21:43
It is a very important piece of meta data that needs to be immediately available. It makes a big difference if the file I downloaded is file.png, file.txt, or file.exe. – Lawtonfogle Feb 5 '15 at 20:23

I cant speak for iPad apps, but I've been using 5 and 6 character extensions for file types for my Windows apps for quite a while now with no problems. And I dont think linux ever had an issue with it, so its no problem there either. Just dont use spaces or special characters, as some programs may not properly deal with them if they try to use the file name as part of a command line parameter.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.