QiLing Tools

📤Rename PDFs by Content - Name Files from Dates & Numbers

PDFs from scanners, banks and online shops tend to arrive as scan0001.pdf or download (3).pdf, and opening each one to rename it is tedious. This tool reads the text of the first pages of every PDF (optionally running OCR on scans without a text layer) plus its document properties, extracts the fields you define and renames the files with a pattern. Fields come from four sources: presets (the first date in formats such as 2024-03-05, 03/05/2024, 5 Mar 2024, March 5, 2024 or 2024年3月5日; invoice number; order number; email; total amount; the largest line as the title; the first line), a custom regular expression (group 1 if there is a capture group, first or last match), text next to a label (enter a label such as “Contract No.” or “Customer” and it takes the value to the right or just below, optionally matching a format), and document properties (title, author, subject, keywords, creation date). Combine them in a pattern with {field}, add {n} or {n:3} for a counter, {name} for the original name and {pages} for the page count; empty fields are dropped together with the separator after them, or replaced with text you choose. The preview lists every extracted value and the new name, which you can edit; duplicates, invalid characters, reserved names and over-long names are flagged, and duplicates can get (2), (3) automatically. Then download the renamed PDFs as a ZIP — or, for many large files, just a bash or PowerShell script that renames them in place (swaps go through temporary names so nothing is overwritten) plus a mapping CSV. Everything runs locally; files are never uploaded.

Free · No sign-up · Runs in your browserLast updated:

Loading tool...

How to use Rename PDFs by Content

  1. 1Select or drop several PDFs, choose how many pages to read and tick OCR for scans
  2. 2Add fields — presets, regex, text next to a label or document properties — and write a file name pattern
  3. 3Check the new names and any clashes in the preview, then download the ZIP or a rename script

FAQ

How does “text next to a label” work?
Enter a label that always appears in your documents, such as “Contract No.”, “Customer” or “Invoice No.”. The tool finds it and takes the text after a colon in the same piece of text, otherwise the nearest text to the right on the same line, and — if you allow it — the line just below. You can also give a value format (a regex such as [A-Z]{2}-\d+) so only matching values are accepted.
Which part of a regex match is used?
If the pattern has capture groups, the first non-empty group is used; otherwise the whole match. For example Order\s*#?(\d+) keeps just the digits. You can pick the first or last match, matching ignores case by default, and an invalid pattern is flagged next to the field.
Does it work with scanned PDFs?
Yes — tick “OCR pages that have no text layer” and the page text is recognised locally with a Chinese/English OCR model before fields are extracted. The first run downloads a ~15 MB model and each page takes a few seconds. OCR can misread characters, so check the preview before renaming.
Is the rename script safe?
It only contains mv (bash) or Rename-Item (PowerShell) commands with every name properly quoted. The bash version uses mv -n so it never overwrites an existing file, and when new and old names collide it renames through temporary names first. Run it inside the folder that holds the PDFs; files with problem names are left out.