39790: Illegal Characters on Various Operating Systems

Also read in:

use Google Translate

Last update: 21-07-2014


Illegal file/folder names and conventions for the following operating systems:
Mac OS 9
Mac OS X



In the realm of cross-platform file sharing, sometimes the end users are not aware of the limitations posed by the operating system. This article will explain which characters can cause problems with files that use these characters.


The Windows operating system can use two different file systems, Protected-Mode File Allocation Table (FAT) file system and the New Technology File System (NTFS). The two systems have much in common, but the characters permitted in a file or folder name may differ. In the conventions listed below, it is true for both systems unless otherwise specified. Specifically there are cases where NTFS does not have the limitations (see note below).

The following characters are invalid as file or folder names on Windows using NTFS:
/ ? < > \ : * | " and any character you can type with the Ctrl key

In addition to the above illegal characters the caret ^ is also not permitted under Windows Operating Systems using the FAT file system.

Under Windows using the FAT file system file and folder names may be up to 255 characters long

Under Windows using the NTFS file system file and folder names may be up to 256 characters long

Under Window the length of a full path under both systems is 260 characters

In addition to these characters, the following conventions are also illegal:
Placing a space at the end of the name
Placing a period at the end of the name

The following file names are also reserved under Windows:
com1, com2, com3, com4, com5, com6, com7, com8, com9, lpt1, lpt2, lpt3, lpt4, lpt5, lpt6, lpt7, lpt8, lpt9, con, nul, and prn

The previous conventions are true only if the application used in managing them is does not use the Unicode API. Although the file system may support most of the above mentioned conventions the operating system may not. For example the NTFS file system allow paths to have a length up to 32,767 characters with each component (folder, file, etc.) being limited to 255 characters. However some windows applications like Explorer, for example, may not behave correctly in this circumstance. Other software, like ExtremeZ-IP uses the Unicode API so that file and folder names with invalid characters may be stored onto the NTFS file system.
Below the Macintosh conventions will touch the fact that the colon ":" is an invalid character in the Macintosh Operating Systems. Under Windows and the NTFS file system the colon is an illegal character, because it is used to open alternate file streams. However all other characters can be moved on and off the NTFS file system if a program with Unicode support is used. Both ExtremeZ-IP and MassTransit support this Unicode filenaming convention.


The only illegal character for file and folder names in Mac OS 9 is the colon ":"

File and folder names may be up to 31 characters in length


Since Mac OS X is build on top of UNIX there are a few inherent conventions that OS 9 users may not expect. Because of this, migrating certain files and folders from OS 9 to OS X may cause unexpected behavior.

The only illegal character for file and folder names in Mac OS X is the colon ":"

File and folder names are not permitted to begin with a dot "."

File and folder names may be up to 255 characters in length


Below are a few scenarios that show what can happen if file names that are acceptable on one operating system are moved to another:

Example 1:
Create a file named com1 on Mac OS 9
Move the file to a Windows machine
Under Windows 2000 viewing the folder which contains the file via Explorer will result in Explorer crashing
Under Windows 2003 the file name cannot be changed because the file will require inherent access permissions

Example 2:
Create a file named .text on Windows
Move the file to a Mac OS X machine
The file will not be visible via the Finder
(File and folder names beginning with a dot mean the file or folder is hidden)

Example 3:
Create a file named foo/ on Mac OS X
Move the file to a Windows machine
If the file is viewed via Explorer the file name will not appear as it did on the OS X machine

Related Article: