Some characters are forbidden, some break scripts, and some corrupt silently when files move between systems.

The short version

Start here if you only have one minute. The full guide below explains each point.

01

Some characters are banned

Windows rejects nine outright.

02

Legal is not safe

Spaces and ampersands break scripts.

03

Stick to a boring set

Letters, digits, hyphens and underscores.

01

Some characters are outright forbidden

Windows rejects nine characters in file names outright, and reserves a set of legacy device names such as CON and PRN regardless of extension.

These fail immediately and visibly, which makes them the least of the problems here.

Key points
  • Forbidden on Windows: < > : " / \ | ? *
  • Forbidden on macOS and Linux: / and the null byte
  • Reserved names on Windows: CON, PRN, AUX, NUL, COM1 to COM9, LPT1 to LPT9

02

Some break scripts and commands

Spaces, ampersands, dollar signs, semicolons and parentheses all have meaning in a shell. A file name containing them breaks any command that does not quote it.

They are legal file names, which is exactly why they cause trouble. Nothing rejects them until something tries to process them.

03

Some corrupt silently across systems

Accented characters can survive a copy and be mangled by a transfer protocol, a zip file created on another platform, or an older backup system.

macOS and Linux also store accented characters differently by default, which means two files can look identically named and not match.

✦

Silent corruption is the real risk. A rejected file name is a nuisance; a file whose name changed during a backup can be genuinely lost.

04

Some break URLs

Any file served on the web becomes part of a URL. Spaces become %20, and non-ASCII characters become long percent-encoded sequences.

The link still works and becomes unreadable, unshareable in plain text and awkward in any system that truncates long URLs.

05

Case sensitivity is a separate trap

Linux treats Report.pdf and report.pdf as different files. Windows and macOS usually do not.

Moving a project between them can silently overwrite one file with another, which no character choice protects you from.

06

What to use instead

Letters, digits, hyphens and underscores. Lower case throughout. Dates in year-month-day form so that alphabetical order is also chronological order.

It is a dull convention and it survives every operating system, transfer method, backup system and web server without exception.

How each character class actually fails

Sorted by how easy the failure is to notice. The last row is the one that loses data.

CharactersFailureNoticeable
< > : " / \ | ? *Rejected by WindowsImmediately
Spaces and & $ ; ( )Break unquoted shell commandsAt the point of use
Any non-ASCIIPercent-encoded in URLsIn the address bar
Accented lettersRenamed by transfers and archivesOften not
Zero-width charactersInvisible mismatchNever, until a lookup fails

Everything above the fourth row is an inconvenience. The bottom two rows can produce files that exist and cannot be found by name.

07

Copy the symbols discussed in this guide

This guide explains the topic. Use invisible characters for the main copyable set, compare it with punctuation symbols, and browse technical symbols for another useful angle. Each collection includes searchable Unicode names and HTML references.

08

Questions, answered

Can I use spaces in file names?+

They are legal everywhere and break unquoted shell commands and produce %20 in URLs. Hyphens do the same job with none of the cost.

Are emoji allowed in file names?+

Most modern systems accept them. They break in transfers, archives and older backup software, which makes them a poor choice for anything you need to keep.

Why did my accented file name change?+

macOS and Linux store accented characters in different normalisation forms by default, so a name can be altered when files move between them.

09

Sources and review notes

Recommendations were checked against published platform, Unicode and accessibility guidance. This is a standards review, not a claim of testing every screen reader, app or device combination.