Stands for "Long Filename." LFN is an extension to the "short filename" standard used in DOS, which only allowed eight uppercase characters plus a three-character file extension. LFN filenames can be up to 255 characters long, including the file extension, which may be longer or shorter than three characters. They can include lowercase and uppercase characters, as well as spaces, numbers, and symbols.
Microsoft introduced long filename support with the VFAT file system in 1994. VFAT was first included with Windows NT 3.5 and later in Windows 95. To maintain backward compatibility with the previous FAT file system, Microsoft provided an automatic way to shorten long filenames using a tilde followed by a number. If the shortened filename conflicted with another filename, the number would be incremented by one. For example:
- EXAMPLE.DOC → EXAMPLE.DOC
- Example.doc → EXAMPLE.DOC
- Sample File.doc → SAMPLE~1.DOC
- Sample File copy.doc → SAMPLE~2.DOC
- Verylongfilename.txt → VERYLO~1.TXT
NOTE: While Windows, macOS, and Unix have supported long filenames for over two decades, a filename may still be truncated if the file is copied or edited by a Windows system using the FAT file system.