Rename commands will appear here...

Batch File Renamer: Generate Rename Commands for Dozens of Files at Once

Renaming files one at a time in Windows Explorer or Finder is tedious for three files and impossible for three hundred. Browsers cannot rename files on your disk directly — no web page is allowed to reach into your filesystem and change names without your explicit, per-file confirmation. This tool takes a different, more practical approach: you paste in a list of filenames, choose a renaming rule, and it instantly generates the exact shell commands you would otherwise have to type by hand — ready to copy or download and run yourself.

This is a command generator, not a file manager. It does not open a file picker, does not read your files, and does not touch your disk. It only ever sees the filenames you type or paste into the text box.

How It Works

Paste or type your filenames into the File Names box, one per line — for example by copying the output of dir /b (Windows) or ls (macOS/Linux) from a terminal. Then choose a rename mode:

Find & Replace replaces a literal substring in every filename, with an optional case-sensitive toggle. Use it to strip a prefix like IMG_ from camera photos or fix a recurring typo across a batch of files.

Add Prefix and Add Suffix insert text at the start of every filename, or just before the file extension. Useful for tagging a folder's worth of deliverables with a project code or a version marker.

Sequential Numbering renames every file to a common base name followed by a zero-padded incrementing number, keeping each file's original extension — turn a folder of inconsistently named screenshots into report-001.png, report-002.png, and so on.

Click Generate Rename Commands and the tool prints one command per file — ren "old-name" new-name on Windows or mv "old-name" new-name on macOS/Linux, auto-detected from your browser. Click Download Commands to save them as a ready-to-run .bat (Windows) or .sh (macOS/Linux, with a shebang line included) script, or copy them straight from the output box.

The actual renaming happens when you run the downloaded script or paste the commands into your own terminal, in the folder that contains the files. Nothing is renamed inside your browser — this tool's job ends at generating correct commands.

Real-World Scenarios

Photo organization. A photographer has a folder of RAW files named DSC_0001.NEF through DSC_0500.NEF. Running dir /b in that folder, pasting the list in, and choosing Sequential Numbering with base name wedding produces 500 ready-to-run ren commands that turn the whole folder into wedding-001.NEF, wedding-002.NEF, and so on — no manual renaming, no third-party desktop app.

Log file cleanup. A DevOps engineer has log filenames using inconsistent date separators, like app-server-2026-06-01.log. Find & Replace on the filename list turns every hyphenated date into an underscore-separated one, and the generated mv commands can be pasted directly into the server's shell.

Deliverable tagging. A design team wants every file in a deliverables list prefixed with a client code before zipping and sending it. Add Prefix generates the full set of rename commands in seconds instead of renaming each file by hand.

Limits

This tool works on filenames only — it never reads file contents, cannot see or rename files in subfolders, and does not verify that the files you listed actually exist on disk (that check happens when you run the generated commands). It also does not detect if two input filenames would generate the same output name; review the generated commands before running them, especially with Sequential Numbering on a list that already contains numbered files.

Privacy

Everything happens in your browser using plain JavaScript string processing on the text you typed. No file is uploaded, read, or accessed — the tool never requests filesystem or folder access from your browser at any point.

Related Tools