Filename Sanitizer
Paste a list of filenames and get back a cleaned-up version that will survive any operating system, any ZIP archive, any CDN path. The sanitizer converts accented letters to plain ASCII, strips characters that break on Windows (\ / : * ? " < > |), removes control characters, collapses whitespace and replaces forbidden sequences with your chosen replacement (default: hyphen). Useful before bulk-uploading to S3, shipping a courseware ZIP, or fixing an import of photos off an old NAS.
How to sanitize filenames
-
1
Paste the filenames
One per line, with or without extensions. Extensions are preserved as-is.
-
2
Choose the replacement
Pick the character used to replace unsafe sequences. Hyphen (`-`) is the safest default; underscore (`_`) is the retro choice.
-
3
Run the sanitizer
Each name is trimmed, converted to ASCII, stripped of forbidden characters and collapsed whitespace. A name with nothing left becomes `file`.
-
4
Review before renaming
Output lists only the cleaned names, so scan it for collisions (two inputs becoming the same output) before renaming in place.
What is unsafe, and why
Different filesystems and tools have different blacklists. The safe cross-platform intersection is tighter than most people realize.
Characters and patterns that make filenames unsafe
| Item | Why it is unsafe |
|---|---|
\ / : * ? " < > | |
Forbidden on Windows (NTFS, FAT). |
ASCII control chars 0x00-0x1F |
Illegal on most filesystems; break shell scripts. |
| Leading/trailing spaces | Silently stripped by Windows; invisible bugs. |
| Trailing dots | Silently stripped by Windows. |
| Reserved names | CON, PRN, AUX, NUL, COM1..9, LPT1..9, all blocked on Windows. |
| Unicode combining marks | Cause café to look the same as café but be a different filename on some systems. |
| Emoji and pictograph glyphs | Survive modern systems but break older CI pipelines and CDN paths. |
Normalization steps applied
- ASCII conversion. Accented letters become their plain base:
cafébecomescafe,naïvebecomesnaive. Scripts without an ASCII equivalent (CJK, emoji) are dropped. - Forbidden characters replaced.
\ / : * ? " < > |and control characters become your replacement character (default: hyphen). - Whitespace collapse. Runs of spaces and tabs become a single replacement character.
- Edge trimming. Leading and trailing dots and replacement characters are removed; an empty result becomes
file. - Extensions preserved. Dots inside the name are not replaced, so
.pdf,.jpg,.tar.gzsurvive; only trailing dots are trimmed.
Tips
- Keep the extension. Dots inside a name are kept, so
.pdf,.jpg,.tar.gzsurvive as-is. - Check for collisions.
Résumé.pdfandResume.pdfboth becomeresume.pdf, because accents are always converted. Review the output before renaming in place. - Web paths. For URLs, also percent-encode after sanitizing, or better, keep the URL slug a subset of
[a-z0-9-]so encoding is never needed.
Frequently Asked Questions
For web assets and cross-platform ZIPs, yes, it avoids subtle bugs when a file is uploaded to a case-insensitive Windows server and linked from a case-sensitive Linux CDN. The sanitizer never changes letter case, so lowercase names yourself when you need it. For local work it is taste.
Spaces are legal on every modern OS but they force URL encoding (%20), break many shell pipelines and confuse older tools. Replacing them with a hyphen eliminates a whole category of bugs.
The sanitizer always outputs plain ASCII: accented Latin letters are transliterated (café becomes cafe), Cyrillic is converted to a Latin approximation, and characters without an ASCII equivalent (CJK, Thai, emoji) are dropped. If a target system needs the original non-Latin names, keep them in a separate file.
No, the list is sanitized in memory during the request and is not stored or written to any log afterwards.
Related Tools
Word to Markdown Converter
Convert a Word DOCX file to clean Markdown in your browser. Keep headings, lists, links and simple tables, then copy or download the editable .md file.
Subtitle Converter
Convert SRT subtitles to WebVTT or VTT captions to SRT locally. Validate cue timings, preserve multiline text, then copy or download the result.
Archive Extractor
Inspect ZIP, JAR, XPI, DOCX, XLSX, PPTX and ODT containers locally in your browser, then download individual files without uploading the archive.
Excel Sheet Merger
Combine XLSX, XLS, XLSM, XLSB or ODS files locally. Keep source sheets separate or append rows with matching headers, then download an XLSX.
CSV to Excel
Convert CSV data to a single-sheet XLSX workbook in your browser. Review delimiters, preserve identifiers, infer safe numbers, and keep file contents local.
Excel Sheet Splitter
Split an XLSX or XLS workbook by worksheet tab, data-row chunks or a column value in your browser. Download one XLSX or a local ZIP, with no file upload.
Tool available in other languages
- 파일명 정리기 [KO]
- เครื่องมือทำความสะอาดชื่อไฟล์ [TH]
- Rensa filnamn [SV]
- Bestandsnaam-opschoner [NL]
- 文件名清理工具 [ZH]
- Oczyszczanie nazw plików [PL]
- Công cụ làm sạch tên tệp [VI]
- Pembersih Nama File [ID]
- منقّي أسماء الملفات [AR]
- Dosya Adı Temizleyici [TR]
- ファイル名サニタイザー [JA]
- Sanitizador de Nomes de Arquivo [PT]
- Sanitizador de Nombres de Archivo [ES]
- Dateinamen-Sanitizer [DE]
- Assainisseur de noms de fichiers [FR]
- Sanificatore di Nome File [IT]
- Очистка имён файлов [RU]