Search Authority

What Characters Are Not Allowed in a File Name? (SEO-Friendly Guide)

Operating systems and file systems enforce specific rules on file names to protect system integrity and avoid conflicts. Understanding which characters are not allowed in a file...

Mara Ellison
What Characters Are Not Allowed in a File Name? (SEO-Friendly Guide)

Operating systems and file systems enforce specific rules on file names to protect system integrity and avoid conflicts. Understanding which characters are not allowed in a file name helps you avoid errors during save, upload, or transfer operations.

Reserved symbols can trigger parsing failures, security blocks, or data corruption, so recognizing these forbidden characters is essential for developers, content creators, and IT teams.

Platform Forbidden Characters Typical Behavior Workaround Tips
Windows < > : " / \ | ? * Save or rename fails with error Replace with dash or underscore
macOS (HFS+/APFS) : / Colon disallowed; slash reserved Use dash or parentheses instead
Linux / null byte Slash reserved as path separator Use underscore or period safely
Web Services " # ? URL encoding or upload rejection Use alphanumeric names with hyphens

Windows File Naming Rules

Windows blocks a wide set of characters to maintain compatibility with its internal APIs and command shell. Attempting to create a file name containing any of these symbols results in an immediate error.

Character Categories in Windows

The system treats these symbols as control elements or separators, so they cannot appear in ordinary file or folder names.

Consequences of Violation

Ignoring these restrictions leads to failed saves, sync errors, and tooling crashes across Office apps, PowerShell, and Explorer.

macOS and Linux File Naming Rules

macOS and Linux are more permissive but still rely on key restrictions. The directory separator and a few control characters remain off-limits to ensure filesystem stability.

Path and Separator Dependencies

Because slash defines paths, both systems reject it in names, while macOS also forbids the classic colon in newer workflows.

Best Practices Across Unix-like Systems

Stick to letters, numbers, dashes, and underscores to maximize portability across tools, editors, and command lines sessions.

Web and Cloud Service Restrictions

When file names travel over HTTP or enter cloud storage, additional characters are disallowed to protect URLs, prevent injection, and keep APIs predictable.

URL and Query Sensitivity

Symbols like question mark, hash, and ampersand carry special meaning in URLs and must be encoded or avoided in file names used for public links.

Storage and Compatibility Impact

Platforms may automatically rename or reject uploads containing curly braces, percent signs, or backticks, so it is safer to use plain alphanumeric identifiers.

Secure and Portable File Naming Guidelines

  • Use letters, numbers, dashes, and underscores as safe building blocks
  • Avoid Windows reserved characters < > : " / \ | ? *
  • Skip macOS-specific colon and Linux slash in names
  • Strip or encode symbols problematic for web services: quotes, ampersand, hash, percent, curly braces
  • Test file transfers across target platforms before relying on them in production workflows

FAQ

Reader questions

Why does my file name with an asterisk fail to save on Windows?

Asterisk is a reserved wildcard character in Windows command shells, so the system blocks it to prevent parsing conflicts during file operations.

Can I use a colon in file names on macOS?

No, colon is reserved as a separator in older macOS file systems and remains disallowed in common workflows to maintain path consistency.

Will a slash break file transfers between Linux servers?

Yes, because slash is the directory separator in Linux, any file name containing it will cause path resolution errors and transfer failures.

Do cloud platforms treat percent signs the same as local systems?

Cloud services often reject or URL-encode percent signs to avoid confusion with encoded characters, so you should remove or replace them in file names.

Related Reading

More pages in this topic cluster.

Who Designed the Nike Logo? The Story Behind the Swoosh

The Nike swoosh is one of the most recognizable symbols in the world, but few people know the story behind its creation. This piece explores who designed the Nike logo, why it h...

Read next
What is the World's Hottest Pepper? 🌶️🔥

When people ask about the world's hottest pepper, they usually mean the variety that currently holds the Guinness World Record and pushes the boundaries of capsaicin heat. Peppe...

Read next
Jon Huertas in This Is Us:角色, 出演时期与剧情影响详解

Jon Huertas 在《这就是我们》中饰演成年 Kevin Pearson,这一角色从2016年首播持续至2022年最终季,构成了剧集核心家庭叙事的重要组成部�...

Read next