Filename & file compatibility, at a glance

What breaks when files move between ๐ŸชŸ Windows, ๐ŸŽ macOS and ๐Ÿง Linux โ€” characters, reserved names, path separators, zero-byte files and more. Scan the matrix, then dig into any row.

โœ“ Allowed โœ— Forbidden / breaks ! Silently changed / risky
Rule ๐ŸชŸWindows ๐ŸŽmacOS ๐ŸงLinux
Special chars : * ? " < > | โœ—forbidden !avoid : โœ“allowed
Backslash \ in a name โœ—path separator โœ“ordinary char โœ“ordinary char
Reserved names CON NUL โœ—forbidden โœ“allowed โœ“allowed
Case-sensitive names โœ—merges โœ—merges (default) โœ“distinct
Unicode NFC = NFD !bytes as-is !stores NFD !bytes as-is
Trailing . or space โœ—stripped โœ“kept โœ“kept
Path length !260 default โœ“1024 โœ“4096
Zero-byte file โœ“"0 KB" โœ“"Zero bytes" โœ“0
Text line endings !CRLF !LF !LF

Forbidden characters

Windows rejects these outright. Linux allows almost anything.

<>:"/\|?*
๐ŸชŸ
Windows
โœ— all 9
๐ŸŽ
macOS
! / and :
๐Ÿง
Linux
โœ“ only /

Trap: report:2024.txt is legal on Linux, impossible on Windows โ€” sync skips it.

Try: question?name.txt ยท double"quote.txt

Path separators: / vs \

The single biggest cross-platform path bug.

๐ŸชŸ
Windows
\ (also /)
๐ŸŽ
macOS
/ only
๐Ÿง
Linux
/ only

Trap: on Linux, folder\file is one filename containing a backslash. Move it to Windows and it becomes a folder โžœ file path โ€” or fails. Web URLs are always /.

Try: backslash\name.txt

Reserved device names

Windows keeps legacy device names โ€” even with an extension.

CONPRNAUXNULCOM1โ€“9LPT1โ€“9
๐ŸชŸ
Windows
โœ— forbidden
๐ŸŽ
macOS
โœ“ fine
๐Ÿง
Linux
โœ“ fine

Trap: CON.txt and nul.log can't be created or extracted on Windows.

Try: CON.txt ยท NUL.txt

Case sensitivity

Are File.txt and file.txt the same file?

๐ŸชŸ
Windows
Same โ†’ merge
๐ŸŽ
macOS
Same (default)
๐Ÿง
Linux
Two files

Trap: a repo with README.md + Readme.md loses one file when cloned on Windows/Mac.

Unicode normalization

cafรฉ can be 4 code points (NFC) or 5 (NFD). Same look, different bytes.

๐ŸชŸ
Windows
as-is (NFC)
๐ŸŽ
macOS
stores NFD
๐Ÿง
Linux
as-is (NFC)

Trap: a Mac-saved cafรฉ.txt won't match the same name typed on Windows โ€” "file not found" for a name you can see.

Try: nfc-cafรฉ.txt vs nfd-cafรฉ.txt

Trailing dots & spaces

Windows silently strips a trailing . or space.

๐ŸชŸ
Windows
โœ— stripped
๐ŸŽ
macOS
โœ“ kept
๐Ÿง
Linux
โœ“ kept

Trap: report. becomes report โ€” two files collide into one.

Try: trailing-dot.txt.

Length limits

Per-name and full-path caps.

๐ŸชŸ
Windows
260 path*
๐ŸŽ
macOS
1024 path
๐Ÿง
Linux
4096 path

Names: 255 units (Win/Mac) or 255 bytes (Linux โ€” so ~63 emoji). *Windows lifts 260 only with long-path mode.

Try: a 204-char name

Zero-byte files

A file with no content is valid everywhere โ€” but shown and handled differently.

๐ŸชŸ Explorer
empty.txt
0 KB
๐ŸŽ Finder
empty.txt
Zero bytes
๐Ÿง ls -l
-rw-r--r-- 1 0 empty.txt

Trap: upload validators that check MIME but not size > 0 accept empty files; some sync clients skip them; Git needs an explicit add. Used deliberately as markers (.gitkeep).

Try: 0b.bin (exactly 0 bytes)

Text line endings

Same text, different bytes per platform.

๐ŸชŸ
Windows
\r\n CRLF
๐ŸŽ
macOS
\n LF
๐Ÿง
Linux
\n LF

Trap: breaks diffs, checksums and line-by-line parsers. Classic Mac used bare \r (CR).

Try: crlf.txt vs lf.txt

Cloud sync services add their own rules

OneDrive, Dropbox and Drive apply the strictest (Windows-style) rules on every platform, plus extra reserved names and path caps.

โ˜๏ธ
OneDrive / SharePoint
Blocks " * : < > ? / \ |, .lock, CONโ€ฆLPT9, ~$โ€ฆ, leading/trailing spaces, ~400-char paths
๐Ÿ“ฆ
Dropbox
Blocks / \ < > : " | ? *, .dropbox, desktop.ini; case-insensitive; no trailing spaces/dots
๐Ÿ—‚๏ธ
Google Drive
Permissive storage, but case- & normalization-insensitive matching can conflict on the desktop client

Safe-everywhere rule: use only Aโ€“Z aโ€“z 0โ€“9 . _ -, no leading/trailing dots or spaces, avoid Windows reserved names, keep paths under ~255 chars, normalize Unicode to NFC.

Prove your app handles these

Every rule above has a matching test file in the catalog โ€” upload one and confirm your app fails gracefully, not silently.

โ†’ Browse the filename & encoding test files