
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 do some search results show outdated file paths?
Search results sometimes display outdated file paths due to delays in how search engines index and update website change...
How can I recover a file that didn’t save properly?
File recovery for unsaved work refers to retrieving a document that was being edited but never properly saved to its per...
How do I manage exported files in bulk?
Bulk exported file management involves processing numerous files simultaneously after exporting data from a system, as o...