Invalid Filename Characters on Windows, Mac and Linux
Quick answer: Windows does not allow these nine characters in file or folder names: < > : " / \ | ? *. It also rejects control characters, names such as CON, PRN, AUX, NUL, COM1 and LPT1, and names that end in a space or a period. macOS and Linux are much more relaxed, so a name that works on a Mac can fail when copied to Windows.
Quick reference: every method
Every Alt code below is verified against the real Windows code pages — where none exists we say so, rather than list one that won’t work.
| Char | Name | Windows | Mac | HTML | Word (Alt+X) | Unicode |
|---|---|---|---|---|---|---|
| ∕ | Division Slash | Copy / paste | Copy / paste | ∕ |
2215 + Alt+X |
U+2215 |
| ‐ | Hyphen | Copy / paste | Copy / paste | ‐ |
2010 + Alt+X |
U+2010 |
| – | En Dash | Alt+0150 |
Option+- |
– |
2013 + Alt+X |
U+2013 |
| · | Middle Dot | Alt+0183 |
Copy / paste | · |
00B7 + Alt+X |
U+00B7 |
| • | Bullet | Alt+0149 |
Option+8 |
• |
2022 + Alt+X |
U+2022 |
The nine Windows characters and why
| Character | Name | Reserved because… |
|---|---|---|
\ | backslash | separates folders in a path |
/ | forward slash | also accepted as a path separator |
: | colon | drive letters (C:) and alternate data streams |
* ? | asterisk, question mark | wildcards in commands |
" | double quote | wraps names that contain spaces |
< > | | angle brackets, pipe | redirection and pipes in the command line |
Rules that aren't about characters
- Reserved names: CON, PRN, AUX, NUL, COM1–COM9, LPT1–LPT9, plus COM and LPT followed by the superscript digits ¹ ² ³. They are blocked in any letter case and with any extension.
- No trailing space or period: "report." and "report " are not allowed by Windows Explorer. A leading period (".config") is fine.
- Case: Windows treats Report.txt and report.txt as the same name.
- Length: the classic limit for a full path is 260 characters. Windows 10 version 1607 and later can lift it with a setting, but many programs still use the old limit. A single name is usually limited to 255 characters.
Source for these rules: Microsoft's "Naming Files, Paths, and Namespaces" documentation.
Mac and Linux
- Linux: only
/and the null character are forbidden. Names are case-sensitive. - macOS: in the system, only
/is forbidden at the file system level. Finder swaps colon and slash between what you see and what is stored, so Finder won't accept a colon. Names are case-insensitive by default. - Cloud and network drives (OneDrive, SharePoint, network shares) usually apply the Windows rules and may add their own, so a Mac file named "Q&A: notes?" may fail to sync.
Safe replacements
| You wanted | Use |
|---|---|
| Date 25/10/2026 | 2026-10-25 (sorts correctly) |
| Time 10:30 | 10-30 or 1030 |
| "Q&A?" | Q-and-A |
| Draft | Final | draft_final or draft - final |
Look-alike characters such as the division slash ∕, the modifier letter colon ꞉ or full-width ? are allowed by Windows and look almost like the forbidden ones. Use them only for names people read, never for files that scripts, links or searches must find: to a computer they are different characters (look-alike characters explained).
Invisible trouble
Names copied from web pages or documents may contain non-breaking spaces, zero-width spaces or curly quotes. They look normal but make files hard to find or open from scripts. Retype the name, or see invisible characters and straight vs curly quotes.
Related: the backslash and the pipe symbol.
Frequently asked questions
Which characters are not allowed in Windows file names?
Nine characters: the less-than sign, the greater-than sign, colon, double quote, forward slash, backslash, vertical bar, question mark and asterisk. Control characters 0 to 31 are also not allowed.
Why can't I name a file CON or NUL?
CON, PRN, AUX, NUL, COM1 to COM9 and LPT1 to LPT9 are reserved device names in Windows, even with an extension such as NUL.txt.
Can I use a colon in a file name?
Not on Windows. A Mac Finder name can show a slash or colon in some cases but this does not survive copying to Windows. Use a hyphen or a period instead, as in 10-30 or 10.30.
Can file names contain emoji or accented letters?
Yes on modern Windows, macOS and Linux. Old programs, some ZIP tools and some web servers may handle them badly, so keep important file names to letters, numbers, hyphens and underscores.
Looking for something else? Browse 1,000+ copy-paste symbols, the full Alt Codes finder, or the emoji picker.