By Tim King · Updated
Filename Generator
Clean, Safe File Names in kebab-case, snake_case or camelCase
OneTask is free, with no sign-up, and built by one person.
If this tool saved you time, a coffee helps keep new ones coming.
How the Filename Generator works
This filename generator turns a plain description into a clean, safe file name that works on Windows, macOS, Linux and in web addresses. Pick kebab-case, snake_case, camelCase or Title-Case, add today's date first or last, and add a random or numbered suffix for batches of files.
How the filename generator works
The tool splits your text into words, removes accents (é becomes e), drops apostrophes and every character that is forbidden or risky in file names, and joins the words in the style you chose. The date is added in ISO form, year-month-day, so files sort in date order. Windows reserved names such as CON and NUL get "-file" added, and the base name is capped at 80 characters so long paths stay well under the usual 255-character limit.
The formula for the random suffix is 16⁶ = 16,777,216: six hexadecimal characters give that many possible endings, so two files from the same description almost never clash.
First example. "Quarterly sales report: Q3 draft" in kebab-case with the date first becomes 2026-10-01-quarterly-sales-report-q3-draft.pdf. The colon is gone and every letter is lower case.
Second example. "Café menu – été" in snake_case with a numbered suffix and a count of 3 gives cafe_menu_ete_1, cafe_menu_ete_2 and cafe_menu_ete_3, each with the extension you typed.
How many files can share a random suffix before a clash is likely? About 4,800, the point where the birthday-problem chance of two matching endings out of 16.7 million reaches 50 percent.
Characters and names that cause trouble in filenames, and what this generator does with them
| Character or name | Rule | This generator | Why it matters |
|---|---|---|---|
| / | Path separator on every system | Removed | Folder separator |
| \ | Path separator on Windows | Removed | Folder separator |
| : | Reserved on Windows, old Mac separator | Removed | Drive letter |
| * | Reserved on Windows | Removed | Wildcard |
| ? | Reserved on Windows | Removed | Wildcard |
| " | Reserved on Windows | Removed | Quoting |
| < | Reserved on Windows | Removed | Redirection |
| > | Reserved on Windows | Removed | Redirection |
| | | Reserved on Windows | Removed | Pipe |
| Space | Allowed, but awkward | Separator | Breaks shell commands and URLs (%20) |
| # | Allowed | Removed | Starts a URL fragment |
| % | Allowed | Removed | URL escape character |
| & | Allowed | Removed | Shell and URL query separator |
| ' | Allowed | Removed | Shell quoting |
| $ | Allowed | Removed | Shell variable |
| ! | Allowed | Removed | Shell history |
| Accented letters (é, ü) | Allowed | Accent dropped (e, u) | Different byte forms on macOS and Windows |
| Emoji | Allowed | Removed | Breaks older tools and zip files |
| Leading dot | Allowed | Removed | Hides the file on macOS and Linux |
| Trailing dot or space | Stripped by Windows | Removed | File becomes hard to delete |
| CON, PRN, AUX, NUL | Reserved device names on Windows | "-file" added | Cannot be created |
| COM1–COM9, LPT1–LPT9 | Reserved device names on Windows | "-file" added | Cannot be created |
| Upper case | Allowed | Kept or lowered by style | Case-insensitive on Windows and macOS, sensitive on Linux |
| Over 255 characters | Limit on most file systems | Base cut at 80 | Copy and sync failures |
Tips and pitfalls
Pick one style per project and stick to it. Lower-case names avoid a classic bug where report.PDF and report.pdf are the same file on a Mac but two files on a Linux server. Put the date first when you want files to sort by date, and last when you want them grouped by subject.
FAQ
What makes a file name safe?
A safe file name uses only letters, digits, hyphens, underscores and one dot before the extension. It avoids spaces, the characters Windows forbids, reserved names such as CON, and leading dots, so it works on every system and in a web address.
Should I use hyphens or underscores in file names?
Hyphens (kebab-case) are the usual choice for anything on the web, because search engines treat a hyphen as a word break. Underscores (snake_case) are common in code and data files. Either works if you use it consistently.
Why add a date in year-month-day order?
Year-month-day dates sort correctly as plain text, so files list in date order in any folder. Day-first and month-first dates sort by day number instead, which scatters a year's files across the list.
What does the random suffix do?
It adds six random hexadecimal characters, giving 16,777,216 possible endings. That keeps names unique when several files share the same description, such as photo exports or downloaded reports, without needing to track a counter.
Does the filename generator upload my text?
No. The name is built entirely in your browser with a short script, and nothing you type is sent anywhere. You can use it offline once the page has loaded.
See also: all Lists & Lines tools, Writing & Editing, Markdown & HTML, Ciphers & Alphabets.
Related tools
Random String Generator
Cryptographically random strings in any length and character set.
UUID Generator
Random v4 or time-ordered v7 UUIDs, generated in your browser.
Random Word Generator (Noun, Verb, Adjective Filters)
Random English nouns, verbs, adjectives and adverbs, filtered by length.
Password Generator
Strong random passwords generated in your own browser.
Random Number Generator
Fair random whole numbers in any range, with or without repeats.