About Filename Cleaner
Messy filenames like "My VACATION photo (1) [edited].JPG" cause problems: they break URLs, don't sort cleanly, and look unprofessional in shared folders. The Filename Cleaner turns them into clean SEO-friendly slugs — "my-vacation-photo-1-edited.jpg" — in one click. Drop any number of files, choose your separator (kebab-case, snake_case, or spaces), preview every rename before exporting, and download the cleaned set as a ZIP. The cleaner handles accented characters (café → cafe), strips parentheses and brackets, normalises whitespace and case, and gracefully handles collisions.
- No uploads
- Browser-only
- Works offline
- 100% free
How it works
- 1
Drop the files
Any file type works — images, documents, data files. Folders aren't supported (browser security); add files individually.
- 2
Pick a separator style
kebab-case (default — best for URLs and SEO), snake_case (database-friendly), or space-separated (human-friendly).
- 3
Preview and export
The preview table shows old → new for every file. Hit Download to get a ZIP under the cleaned names.
Illegal characters differ by operating system
There is no single set of 'banned' filename characters — each OS has its own list, and the safe filename is the intersection of all of them. Windows is the strictest: it forbids a specific set of punctuation outright, won't allow a name to end in a space or a dot, and reserves a handful of legacy device names (CON, PRN, AUX, NUL, COM1-COM9, LPT1-LPT9) that can't be used even with an extension. macOS and Linux are far more permissive — technically almost any byte except the path separator and the null character is legal — but a file that's fine on a Mac can become un-copyable the moment it's synced to a Windows machine or uploaded to a service that rejects those characters.
Because of this, the only truly portable filename uses a conservative character set: letters, digits, hyphens, underscores and dots. Cleaning to that set up front is what keeps a shared Dropbox, a Git repo or a USB stick from throwing 'invalid filename' errors when it meets a different OS.
| Rule | Windows | macOS | Linux |
|---|---|---|---|
| Forbidden characters | backslash slash colon asterisk question-mark quote angle-brackets pipe | slash and colon | slash and null only |
| Reserved device names | CON, PRN, AUX, NUL, COM1-9, LPT1-9 | None | None |
| Trailing space or dot | Not allowed | Allowed | Allowed |
| Case sensitivity | Insensitive (File = file) | Insensitive by default | Sensitive (File and file differ) |
| Max path length | 260 chars (legacy default) | 1024 bytes typical | 4096 bytes typical |
The portable choice is the intersection: stick to a-z, 0-9, hyphen, underscore and a single dot before the extension.
Spaces vs hyphens vs underscores, and slugifying
- Spaces are legal everywhere but painful: they become %20 in URLs, need quoting on the command line, and break naive scripts. Replacing them is the single highest-value cleanup.
- Hyphens (kebab-case: my-file-name) are the web standard — Google treats a hyphen as a word separator in URLs but an underscore as a word-joiner, so my-vacation-photo reads as two words while my_vacation_photo can read as one. For anything web-facing, hyphens win.
- Underscores (snake_case: my_file_name) are the convention in code and databases, where a hyphen can be misread as a minus sign in identifiers. Pick by destination, not by taste.
- Slugifying means going further: lowercase everything, strip accents (cafe with an accent becomes cafe via Unicode normalisation), drop punctuation and emoji, and collapse repeats — producing a clean, predictable token that's safe in a URL, a filename and a database key at once.
Length limits and what this tool deliberately drops
Length is a real constraint people forget. Classic Windows caps a full path at 260 characters, so a deeply nested folder plus a long name can hit the wall and refuse to copy; most filesystems cap a single name component around 255 bytes — and 'bytes', not 'characters', matters because one emoji or accented letter can take several bytes in UTF-8. Cleaning trims overlong names to a safe length while keeping the extension intact.
This cleaner is intentionally lossy in one direction: it removes characters that break filesystems and URLs — emoji, most punctuation, and (in strict slug mode) non-Latin scripts. That's a feature for portability and a problem if you need to preserve Chinese, Arabic or Hindi text in the name, in which case it's the wrong tool. For trimming oversized files rather than their names, see the File Size Analyzer.
Frequently asked questions about Filename Cleaner
What rules does the cleaner apply?
Lowercase, NFKD-normalise (drops accents like café→cafe), replace any non-alphanumeric character with the separator, collapse repeated separators, trim, and cap the basename at 80 characters. The extension is lowercased and reduced to alphanumerics.
Does it handle non-Latin scripts (Chinese, Arabic, Hindi)?
Non-ASCII characters are removed — only [a-z0-9] survives. If your script needs to be preserved, use the Bulk Image Renamer with the cleanOriginal flag turned off, or use snake_case which preserves more punctuation by default.
Why are some characters lost (like emoji)?
Filenames with emoji often break older filesystems and URL slugs. The cleaner drops them deliberately. If you need to keep emoji in a filename, this is the wrong tool.
Privacy, offline use, browser support, and pricing questions are answered on the site-wide FAQ.