No Login Data Private Local Save

File Name Sanitizer - Online Remove Invalid Characters

14
0
0
0

šŸ”§ File Name Sanitizer

Remove invalid characters from file names — Windows, macOS & Linux compatible

my:awesome?report.pdf CON.txt project//final:v2.docx backup file name .jpg PRN (reserved name)
chars
Windows: 255, leave empty for no limit
Start typing a file name above…

Frequently Asked Questions

What characters are invalid in Windows file names?

Windows prohibits these characters in file names: < > : " / \ | ? * along with ASCII control characters (0-31, 127). Additionally, file names cannot end with a space or period, and certain reserved device names like CON, PRN, AUX, NUL, COM1-COM9, LPT1-LPT9 are not allowed regardless of extension.

What about macOS and Linux restrictions?

macOS and Linux are more permissive. The only characters strictly forbidden are / (forward slash) and the null character (\0). However, on macOS, the Finder may interpret : (colon) as a path separator, converting it to / behind the scenes. It's best practice to avoid colons on macOS too.

Why is "CON" not allowed as a file name on Windows?

CON is a reserved device name in Windows dating back to MS-DOS. It refers to the console (keyboard/screen). Other reserved names include PRN (printer), AUX (auxiliary device), NUL (null device), and COM1-COM9 / LPT1-LPT9 (serial/parallel ports). These names are reserved regardless of file extension — so CON.txt or NUL.pdf are also invalid.

What is the maximum file name length?

On Windows with NTFS, individual file names can be up to 255 characters long. On macOS (APFS/HFS+) the limit is 255 UTF-8 characters. Linux (ext4) allows 255 bytes. The total path length on Windows is traditionally limited to 260 characters (MAX_PATH), though this can be extended in modern Windows versions. This tool offers an optional max-length setting to keep your file names within safe limits.

Should I use underscores or hyphens to replace spaces?

Underscores (_) are more universally compatible across all operating systems and programming languages. Hyphens (-) look cleaner in URLs and are preferred for web-facing files. Both are excellent choices. Avoid using spaces in file names intended for web servers, command-line tools, or cross-platform sharing — spaces often require escaping and can break scripts.

Does this tool handle Unicode and emoji in file names?

Modern operating systems support Unicode characters (including emoji) in file names. This tool preserves Unicode characters and only removes or replaces characters that are explicitly prohibited by the target operating system. However, for maximum compatibility—especially with older software, FTP servers, or cloud storage—you may want to additionally restrict non-ASCII characters.

What are best practices for naming files?

Use descriptive, concise names. Stick to letters (a-z, A-Z), numbers (0-9), underscores, hyphens, and single periods for extensions. Avoid special characters, leading hyphens, and overly long names. For date-based files, use YYYY-MM-DD format for natural sorting. Example: project-report_2024-01-15_v2.pdf

Is this tool free to use?

Yes! This file name sanitizer is completely free and runs entirely in your browser. No data is uploaded to any server — all processing happens locally on your device, ensuring your file names remain private and secure.

Copied to clipboard!