Zero Signup ToolsFree browser tools

Developer Tools

Filename Sanitizer

Turn any title or string into a safe filename. Strip illegal characters, dodge Windows device names, preserve extensions, and respect byte limits.

Filename sanitizer

Paste one or more names to begin
Try a sample:

Quick presets

Start from a preset and fine-tune below.

Target platform

Strips every character forbidden on Windows, macOS Finder, and Linux Samba shares. Use this for filenames that need to round-trip through email, zip archives, or USB sticks.

Replace illegal characters with

Used in place of stripped characters and inside runs of whitespace.

Most filesystems cap a single segment at 255 bytes. Set this lower for SharePoint, iCloud Drive, or strict cloud sync paths.

Unicode handling

Keep accents and emoji, transliterate to ASCII, or strip everything outside printable ASCII.

Letter case

Lowercase is safer for case-insensitive filesystems like Windows NTFS and macOS APFS-default.

Extra rules

Names are processed locally in your browser. Nothing is uploaded.

How to use

  1. Paste one filename (or one title you want to turn into a filename) into the input. For batch use, paste one name per line.
  2. Pick a quick preset if it fits: Cross-platform safe for everyday use, Web-safe lowercase ASCII for URLs and CDN keys, SharePoint and OneDrive for strict corporate sync, Windows-only, or snake_case ASCII.
  3. Set the target platform to match where the files will live. Cross-platform is the safest default; SharePoint adds the strictest extra block list.
  4. Choose how to handle Unicode (keep, transliterate to ASCII, or strip), how to handle letter case (keep, lowercase, or uppercase), and the replacement character (hyphen, underscore, dot, space, or custom).
  5. Tune the byte limit (255 by default) if you are targeting a filesystem with a smaller cap, then toggle extra rules: preserve extension, lowercase the extension, collapse whitespace and separator runs, avoid Windows device names, and trim trailing dots and spaces.
  6. Read each result row: the cleaned name appears with byte length and a chip for every change applied (stripped, replaced, transliterated, truncated, collision-renamed).
  7. Click Copy cleaned on any row, Copy all cleaned for the full list, or Copy report to grab a plain-text summary of original and cleaned pairs with notes.

About this tool

Filename Sanitizer turns any string into a filename that every common filesystem will accept. Paste a single name on its own, or a batch of names one per line, and the tool runs a deterministic pipeline that mirrors the real-world rules used by Windows NTFS, macOS APFS through the Finder, Linux ext4 and btrfs, Samba and SMB shares, zip archives, and the strict cloud-sync paths used by SharePoint, OneDrive, and iCloud Drive. The pipeline strips the ASCII control characters 0x00 through 0x1F and 0x7F (which break every filesystem), removes the invisible characters that rich-text editors often paste (zero-width space U+200B, zero-width joiner U+200D, zero-width non-joiner U+200C, word joiner U+2060, byte order mark U+FEFF), and replaces every reserved character with a configurable separator. Target platform changes which characters are reserved: Cross-platform takes the strictest union (< > : " / \ | ? *), Windows takes the same set plus trailing-dot and trailing-space trims plus the legacy device names CON, PRN, AUX, NUL, COM1 through COM9, and LPT1 through LPT9, macOS takes only colon and slash, Linux takes only slash, and SharePoint adds the extra block list (~ # % & * { }). Unicode handling is a separate choice: keep accents and emoji untouched, transliterate to ASCII (so Münchner becomes Munchner and Łódź becomes Lodz via NFKD plus a small extended-Latin table for German sharp s, Polish stroked l, Norwegian slashed o, Icelandic thorn, and a few others), or strip everything outside printable ASCII. Letter case can be kept, lowercased (which is safer on case-insensitive filesystems), or uppercased, and the extension can be force-lowercased on its own (the convention that turns Report.PDF into report.PDF stays out of, while only the .pdf extension drops to lowercase). The file extension is split off the last segment before any of these steps and re-attached at the end, so a transformation never accidentally destroys .pdf, .csv, .docx, .tar.gz, or any other suffix you care about. A length cap (default 255 bytes, the standard single-segment limit on every major filesystem) measures the UTF-8 byte count and truncates the stem from the right when needed, keeping the extension intact. Quick presets cover the most common jobs in one click: Cross-platform safe (the default), Web-safe lowercase ASCII (hyphen separator plus transliteration plus lowercase for URLs and CDN keys), SharePoint and OneDrive (extra-strict for corporate cloud sync), Windows-only, and snake_case ASCII for code repositories. Batch mode reads one name per line and automatically renumbers colliding outputs with a -2, -3 suffix the same way Windows Explorer and macOS Finder add (2) and (3) when copying duplicates. Each result row shows the original name, the cleaned name with its byte length, and a row of color-coded chips describing what changed: stripped control characters, stripped invisible characters, replaced reserved characters, renamed reserved Windows device name, trimmed trailing dot or space, transliterated non-ASCII characters, changed letter case, truncated to fit the byte limit, or renamed to avoid a collision. Copy buttons let you copy a single cleaned name, the entire cleaned list as one block (for paste-into-spreadsheet workflows), or a full plain-text report with the platform, original, cleaned, byte count, and notes. Useful for batch-renaming downloads, fixing exported attachment names before zipping them up, turning article headlines into deck file names, prepping data exports for an S3 bucket or an FTP drop, building safe upload paths in a CMS, normalizing legacy archives migrated from one filesystem to another, and any other moment a name needs to survive the trip from one place to a different one. Everything runs locally in your browser. The names you paste are never uploaded.

Free to use. Works in your browser. No signup, no login.

Related tools

You may also like

All tools
All toolsDeveloper Tools