Filename Sanitizer
Sanitize a filename by replacing control and Windows-forbidden characters, trimming trailing dots/spaces, and limiting length.
How to use
- Enter the proposed filename and run the sanitizer.
Capabilities and scope
After NFKC normalization, control codes below 32 and <>:"/\|?* become hyphens, then the result is sliced to 255 UTF-16 code units.
How it works
The runner replaces control and forbidden characters, removes /[. ]+$/ at the end, and applies slice(0,255).
Example
report:2026?.txt becomes a form such as report-2026-.txt.
Useful for
- Clean user-entered text into a more portable filename candidate
Before you use it
- Reserved Windows device names such as CON, path-length rules, OS-specific restrictions, and duplicate names are not validated.
Frequently asked questions
Does it block reserved names like CON?
No. The current implementation only sanitizes characters, trailing characters, and length.