
Certain characters cannot be used in file names primarily because they hold special meaning for operating systems or file systems. Forbidden characters include symbols like /
(forward slash) and \
(backslash), used to separate directories in paths; :
(colon), *
(asterisk), ?
(question mark), "
(double quote), <
(less than), >
(greater than), and |
(pipe), often used in commands or file operations. Control characters (non-printable ASCII codes below 32) are also prohibited. These characters would cause confusion or errors if used.

For example, trying to name a file Report:Q1/2024.txt
would fail on Windows due to the colon and slash. On macOS, filenames cannot contain a colon :
. Applications and online platforms may enforce further restrictions; characters like #
, &
, or spaces are often avoided in files meant for databases or web URLs, replaced with underscores (_
) or hyphens (-
) for compatibility.
These restrictions prevent critical file system errors and ensure data integrity. While limitations exist across different operating systems, adhering to basic characters (letters, numbers, underscores, hyphens, periods) guarantees broad compatibility. Avoidance of spaces and special symbols is also recommended for trouble-free use in scripts and web contexts.
What characters are not allowed in file names?
Certain characters cannot be used in file names primarily because they hold special meaning for operating systems or file systems. Forbidden characters include symbols like /
(forward slash) and \
(backslash), used to separate directories in paths; :
(colon), *
(asterisk), ?
(question mark), "
(double quote), <
(less than), >
(greater than), and |
(pipe), often used in commands or file operations. Control characters (non-printable ASCII codes below 32) are also prohibited. These characters would cause confusion or errors if used.

For example, trying to name a file Report:Q1/2024.txt
would fail on Windows due to the colon and slash. On macOS, filenames cannot contain a colon :
. Applications and online platforms may enforce further restrictions; characters like #
, &
, or spaces are often avoided in files meant for databases or web URLs, replaced with underscores (_
) or hyphens (-
) for compatibility.
These restrictions prevent critical file system errors and ensure data integrity. While limitations exist across different operating systems, adhering to basic characters (letters, numbers, underscores, hyphens, periods) guarantees broad compatibility. Avoidance of spaces and special symbols is also recommended for trouble-free use in scripts and web contexts.
Quick Article Links
Why does Windows auto-rename pasted files?
Windows automatically renames pasted files to prevent overwriting existing files with the exact same name in the destina...
Why does antivirus block the file from opening?
Antivirus software blocks files from opening primarily to protect your computer from malicious software, commonly known ...
How do I rename photos with meaningful names instead of IMG_1234?
Renaming photos replaces generic camera-generated names like IMG_1234 with descriptive titles reflecting the image conte...