File name

Updated: 03/06/2020 by Computer Hope

A file name is the complete title of a file and file extension. For example, "readme.txt" is a complete file name. A file name may also describe only the first portion of the file. For example, "readme" is the name of the file and ".txt" is its file name extension.

File list in explorer with name and file extension

In the example above, the first file shown in Explorer is Regedit.exe. "Regedit" is the name of the file, and ".exe" is the file extension, identifying as an executable file. The next file, "RtlExUpd.dll," which is a DLL file, is another example.

Invalid file name characters

Today, almost all programs support long file names and the file name can contain every character (including letters and numbers), except those shown below.

Invalid file name characters

/ \ : * ? " < > |

File names with spaces

Although all operating systems today support spaces in file names, a command line you may encounter errors because the command line doesn't know where the file name starts and ends. To prevent errors with file names with spaces, surround the file name with quotes when used in a command line.

File names with capital letters

File names can contain uppercase and lowercase characters. However, the operating system that uses the files may be case sensitive. For example, Microsoft Windows is not case sensitive and treats all files the same regardless if they have all lowercase characters or some uppercase characters. However, Linux and macOS are case sensitive, which means the file "readme.txt" and "README.TXT" are treated as two different files even though they have the same file name.

Tip

When designing a web page or uploading any images or other files to the Internet, they are case sensitive. We always recommend keeping all your file names in all lowercase characters when they are used online to help prevent any confusion or errors.

What is the file name character length limit?

Every operating system has a limit to how many characters can be used in a file name that is around 255 characters long. When determining the length of a file, both the file name and the file extension are used together to get the total length. For example, the file "myfile.txt" is ten characters long. Below is a list of Microsoft Windows versions and their file name character limits.

Windows 10 - 260 character limit.
Windows 8 - 260 character limit.
Windows 7 - 260 character limit.
Windows Vista - 260 character limit.
Windows XP - 255 character limit.
Windows 2000 - 254 character limit.

Note

When renaming a file, the full path and file name are used, which means the directory names, separating slashes, and the file name should not exceed the set limits above (e.g., 260 characters).

Linux operating systems have a 255 character limit for a file name, and a 4096 character limit for the full path and file name combined.

Should I be using "file name" or "filename" in my writing?

Today, both "file name" and "filename" are widely used and accepted. The original form of the word was "file name" and "filename" became popular as more people and software programs began to use that version of the word. According to the Microsoft Manual of Style, a file name is "Two words both as an adjective and as a noun when referring to the name of a file. Do not hyphenate."

Note

When referring to a programming term such as the FileName property or fileName variable, use the same capitalization of the word in the program you're describing.

Should "file name" or "filename" be capitalized in my writing?

No. Unless "file name" is at the beginning of a sentence, no part of the word should be capitalized in your writing.

8.3 format, File, File extension, Name, Operating system terms, Path, Untitled