Batch Rename — Rename Files Locally in Bulk, with Regex, Numbering and Extensions
This tool renames your files locally in the browser — nothing is uploaded and your originals are never touched. Pick a whole folder (read-only) or a batch of files, then preview the result through a fixed pipeline: normalization and zero-width cleanup, then build the new name from tokens ([name] [n] [YYYY][MM][DD] [HH][mm][ss] and more, with the extension kept automatically), case conversion and length checks; numbering follows the current order or drag position. When it looks right, pack the renamed files into a ZIP copy or export a rename manifest (CSV). Because the browser cannot rewrite filenames on your disk, renaming happens only on a copy — you must download the result and then replace the originals yourself, or run the manifest with a script. Preview before you rename; it is far more predictable than the one-shot rename in a file manager.
Folders are enumerated read-only, only to build renamed copies; mobile usually can only pick files.
Rename pipeline (fixed order)
Rules run in the fixed order below; changing the order changes the result.
- 01 Split: separate name and extension at the last dot (.gitignore is treated as extension-less).
- 02 Normalize: trim, collapse repeated whitespace, strip zero-width and control characters.
- 03 New filename rule: compose the name from tokens like [name] [n] [YYYY][MM][DD] [HH][mm][ss]; the extension is kept automatically.
- 04 Filter characters: remove a blacklist or keep a whitelist only.
- 05 Case: applies to the name body only.
- 06 Prefix/suffix: prefix + body + suffix.
- 07 Numbering: inserted by current position; sortable by time, size or manual drag.
- 08 Extension and length: unify extension case, trim by bytes while keeping the extension.
Illegal characters (by target system)
Windows: < > : “ / \ | ? * and 0x00–0x1F control chars; trailing space or dot not allowed.
macOS: only / (HFS+ also bans :); trailing dot or space is legal but best removed for cross-platform delivery.
Linux: only / and NUL.
Windows reserved device names: CON, PRN, AUX, NUL, COM1–COM9, LPT1–LPT9 (with extension, case-insensitive).
Length limit: name ≤ 255 UTF-16 code units and ≤ 255 UTF-8 bytes (1 Chinese char = 3 bytes, about 85 chars).
Batch rename script example (CSV manifest)
Import-Csv aidotool_批量重命名.csv | Where-Object status -eq 'ready' | ForEach-Object { Rename-Item -LiteralPath (Join-Path $_.dir $_.old) -NewName $_.new }How to use
- Pick files: drag a folder or a batch of files onto the page, or click “Choose folder” / “Choose files”. The folder is enumerated read-only and your originals are never touched. You can keep adding more, or remove a single item.
- Set rules: in the “New filename rule” box on the left, compose the new name from tokens such as [name]_[n] or [YYYY][MM][DD]; the extension is kept automatically. Edit the box and the preview table on the right updates live.
- Preview: the right table shows the old and new name per row with a character-level diff highlight. Conflicts, illegal characters, reserved names and over-long names are flagged in red immediately, and numbering recomputes live as you change the sort or drag rows.
- Export: click “Export rename copy (ZIP)” or “Export rename manifest (CSV)” and the browser downloads it. Your originals are still unchanged — the renamed result lives only in the copy, so download it and replace the originals yourself.
Frequently asked questions
Will my files be uploaded?
No. The page has no upload path; file bytes are copied into a ZIP only in memory when you click “Export ZIP”, and nothing is sent to any server. If you close the page without downloading, the result is gone — so download first.
Why did the filenames on my disk not change?
This tool works in copy mode: it does not rewrite the filenames on your disk, it produces renamed copies. You must download the ZIP or manifest and replace the originals yourself, or run the CSV manifest with a script.
Why is the numbering not what I expected?
Numbering is based on the current sort order, so changing the sort renumbers everything; the “#” column is the actual number. You can also drag a row to a new position in the preview table and it instantly gets the number for that position — that is exactly what “numbering follows drag position” means.
What if I made a mistake?
In copy mode your originals never change, so just adjust the rules and export a fresh copy. There is no “undo” concept and no risk of corrupting your originals. Refreshing the page clears the current file list (filenames are not saved).
How long can a Chinese filename be?
Windows caps a single name at 255 characters, macOS and Linux at 255 bytes; one Chinese character is 3 bytes, so a Chinese name is effectively about 85 characters. When exceeded, the tool truncates automatically, keeps the extension, and shows an inline note.
What is it
Batch renaming is not just stamping on a template; it is a repeatable, previewable pipeline that turns an old name into a new one. Each step runs in a fixed order: normalize first (trim, collapse spaces, strip zero-width characters), then compose the new name from tokens like [name] [n] [YYYY][MM][DD] (the extension is kept automatically), then case and numbering, and finally length checks. Numbering is based on the current sort order, so dragging a row to a new position instantly recomputes its number and name. The key fact: a pure front-end page has no permission to rewrite filenames on your disk. What we call “rename” actually generates a copy under the new name and downloads it. Your originals never change; if it is wrong, just recompute — there is no “undo” needed.
Origin & history
Long before graphical interfaces, batch renaming was already a command-line habit: Unix rename, DOS batch scripts, wildcards doing a whole folder at once. Windows Explorer long supported only the weak “select then F2 then Tab” prefix-plus-number batch; real visual renamers (Total Commander, Bulk Rename Utility) turned regex, case, prefix/suffix and numbering into a previewable pipeline and became must-haves. The web could not do it for years because early browsers could not reach local files without uploading them first. The turn came with the File API and Blob: a page could finally read the user’s chosen files, process them in memory and hand them back as a download — all without a server. Today the File System Access API can even enumerate a whole folder read-only, making a web “pick folder and rename” possible — except it grants only read access, never write-back to disk. Built on these capabilities, this tool turns renaming into a pure front-end, zero-upload, previewable, download-required copy pipeline: preview the result, then decide to download.
Related keywords
Feedback
Found a problem with a tool or have a suggestion? Email us — we read every message.
