File Name Sanitizer and Bulk Rename Planner

Paste names or pick files, apply web, Windows or Linux rules, preview old and new names side by side, edit any row and download a Bash, PowerShell or batch script.

Runs in your browser. Your files never leave your device. See how to check

…

How to do it

  1. 1
    Add names

    Pick files, pick a folder or paste names one per line.

  2. 2
    Choose rules

    Pick a preset or set target system, spaces, case and length.

  3. 3
    Add a pattern

    Use tokens such as {n:3} and {date} to number or date files.

  4. 4
    Review

    Check the preview, duplicate notes and edit any new name.

  5. 5
    Export the plan

    Download a Bash, PowerShell or batch script, or the CSV plan.

  6. 6
    Rename

    Run the script inside the folder, or download renamed copies as a ZIP.

About this tool

File names travel further than their owners expect. A scan called Meeting notes: Q3/Q4?.docx cannot be saved on Windows at all, because the colon, slash and question mark are reserved there. A photo named Résumé Final (1).PDF uploads fine but turns into a percent-encoded mess in a URL, and the same name with different accents or letter case collides when a folder moves from a Mac to a Linux server. Windows also refuses device names such as CON, PRN, AUX, NUL, COM1 and LPT1, even with an extension, and trailing dots and spaces vanish silently. Content management systems, static sites and cloud storage add their own preferences for lowercase hyphenated names. This tool cleans a whole list at once. It replaces reserved characters, transliterates accents and symbols such as ß to ss and & to and, normalises spaces to hyphens or underscores, changes letter case, collapses repeated separators, protects reserved device names, trims names to a maximum length while keeping the extension, and adds -2, -3 to names that would collide.

Target systems

Web and URLs is the strictest choice: only letters, digits, dots, hyphens and underscores survive, which keeps links readable. Windows removes the nine reserved characters and control characters and protects device names. Linux and macOS only forbid the slash, so names keep more of their original form. Four presets combine these with spacing and case: web safe, Windows safe, Linux and macOS, and snake case.

Patterns, numbers and dates

The pattern field builds new names from tokens: the cleaned name, the original name, a counter with a chosen number of digits, the file date in ISO form or any layout such as YYYYMMDD, and the parent folder. Start, step and digits control the counter. With files picked from disk the date is each file's last-modified date; with pasted names it is today. A find and replace step, with plain text or a regular expression, runs before the cleaning rules.

Preview and manual edits

Every row shows the old name and the new name. Changed names are highlighted, duplicate fixes are explained, and you can type over any new name; a manual edit that creates a duplicate is flagged. Only changed names can hide the rest. Undo covers rule changes and edits.

Applying the plan

A web page cannot rename files on your disk, which is a browser security rule. The tool therefore writes a script: a POSIX shell script with mv -n so nothing is overwritten, a PowerShell script with Rename-Item -LiteralPath, or a Windows batch file with ren. If a new name equals another file's current name, the script renames in two passes through temporary names. You can also download a CSV of the plan or, for picked files, a ZIP of renamed copies.

Limits

Scripts must be run inside the folder that holds the files and do not walk subfolders. Network shares, cloud sync folders and old FAT drives can have extra rules not checked here, and the tool does not test whether a target name already exists on disk outside the list.

Worked example

A photographer picks 240 holiday photos named like IMG_2024 07 09 #holiday.JPG and DSC 0001.JPG. With the Web safe preset and the pattern photo-{date:YYYY-MM-DD}-{n:3}, the preview shows photo-2024-07-09-001.jpg to photo-2024-07-21-240.jpg using each file's date. Two pasted documents, Résumé Final (1).PDF and résumé final 1.pdf, become resume-final-1.pdf and resume-final-1-2.pdf. The downloaded rename.sh contains 240 mv -n lines and is run once in the photo folder; the CSV plan is kept as a record.

Quick facts

Frequently asked questions

Why can the browser not rename my files directly?

Web pages have no write access to your folders, which protects you from malicious sites. The script runs on your own computer, where you can read it first.

Which characters are illegal on Windows?

The less-than and greater-than signs, colon, double quote, slash, backslash, vertical bar, question mark and asterisk, plus control characters. Names must not end in a dot or space, and device names such as CON or LPT1 are reserved.

What does Add -2, -3 to duplicates do?

When two names become identical after cleaning, which often happens after removing accents or changing case, the later one gets -2, the next -3, so no file overwrites another.

How do I number files?

Put {n} or {n:4} in the pattern, for example {n:3}-{name}, and set Start at, Step and Digits. The order is the order of the list.

Is the PowerShell script safe to run?

It uses Rename-Item with -LiteralPath, so brackets and wildcards in names are not interpreted, and it stops at the first error. Read it before running, as with any script from the web.

Are my files uploaded?

No. Only names and dates are read until you ask for renamed copies, and even then the ZIP is built in this tab. Pasted names and settings stay in local storage on this device.

Guides for this tool

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages