PDFs → named by what is inside

Rename PDFs by Content

Drop a pile of scanned or exported PDFs named scan0001.pdf, pick the invoice number, date or customer from the text on the first page, and get them back named by it. Every new name is previewed, clashes are flagged, and the PDF bytes are never altered.

PDF files

Up to 300 files, 50 MB each, 300 MB together.

Drop your PDFs here or click to choose

.pdf files, one or many

Field 1

Use {invoice} in the template.

Field 2

Off

Field 3

Off

New name

Tags: your field names, {original} (old name without .pdf) and {n} (position in the list).

Preview

Choose PDFs to see the new names.

Rename PDFs by Content

Operator: Abdulla Al Fahad. How tools are built and checked

A folder of scanner output is named scan0001.pdf, scan0002.pdf, and the only useful name for each file is printed inside it: the invoice number, the date, the customer. Opening 120 files to read three values and type them back is the job this tool replaces.

You give it up to three rules for pulling values out of the first pages: the text after a label such as "Invoice No", or a regular expression with a capture group. A template such as {date}_{invoice}_{customer} puts the values together, and a table shows every old name beside its new one before anything is saved.

Unlike Bulk File Renamer here, which edits names with find and replace, numbering and file dates, this tool takes the new name from what the page says and uses the old name only as a fallback.

Key features

  • Label rules and regular-expression rules, up to three fields at once
  • Take the next word, the rest of the line, or the line below a label
  • Date fields written in five formats, with day-first or month-first for ambiguous dates
  • Search the first 1, 2, 3, 5 or 10 pages of each file
  • A status per row: renamed, same name, not found, number added, left out or unreadable
  • A ZIP of untouched PDFs plus a CSV name map, and a viewer for the text the rules see

How a name is built from page text

A label rule finds the label as plain text, ignoring case, and takes what follows on the same line after dropping any leading colon, number sign, full stop, dash or equals sign. "Take" chooses the next word (a run without spaces, minus a trailing comma, semicolon or colon), the rest of the line, or the first non-empty line below the label. A regular-expression rule runs with the case-insensitive and multiline flags and uses the capture group you choose, 0 being the whole match.

Each value has a type. Text loses the characters that cannot appear in file names (< > : " / \ | ? * and control characters), has repeated spaces collapsed and is cut to 100 characters. Digits keeps only 0 to 9. A date is searched for inside the captured text, as an ISO date, a slash, dot or dash date, 9 March 2025 or March 9, 2025, and written as YYYY-MM-DD, YYYYMMDD, DD-MM-YYYY, MM-DD-YYYY or YYYY-MM; for 03/04/2025 you choose day first or month first, and a day above 12 settles it by itself. Text that holds no date counts as not found.

The template takes your field names, {original} for the old name without .pdf, and {n} for the position in the list. A file with a missing value keeps its old name, gets a placeholder of your choice (default "unknown"), or is left out of the ZIP. A file that cannot be opened because of a password, a size over 50 MB or a damaged structure is listed as unreadable and left out. Two files that end up with the same name, compared without case, are numbered " (2)", " (3)" in list order, including a file that kept its old name. The ZIP holds the original bytes under the new names, and a CSV map lists old name, new name, result, note and every field's value.

How it works

Each file is opened in turn with pdf.js and only the pages you asked for are read; the text stays in memory, so editing a rule, the template or the missing-value choice recomputes the table at once, while changing the page count reads the files again. When you save, the files are read a second time, one at a time, and added to the ZIP byte for byte rather than re-saved, so signatures, forms and bookmarks in the PDFs survive. The limits are 300 files, 50 MB each and 300 MB together.

Common use cases

  • Three suppliers print "Invoice No", "Inv #" and "Invoice Number": one regular expression, (?:Invoice No|Inv #|Invoice Number)\s*:?\s*(\S+), covers a 120-file batch in a single pass.
  • A law firm's scans of court notices each carry "Case No. 24-CV-0817" on page 1: the regex Case No\.\s*(\S+) with the template {case}_{original} files them by case and keeps the scan number.

How to use this tool

  1. Drop the PDFs and choose how many pages to search.
  2. Set field 1: the label exactly as printed, and whether to take the next word, the line or the line below.
  3. Switch on more fields for the date or the customer, choosing a date format.
  4. Write the template and decide what happens when a value is missing.
  5. Read the preview and the text pane, then save the ZIP and the name map.

Example

Text found on page 1 of three scans

scan0001.pdf: Invoice No: INV-2041, / Invoice Date: March 9, 2025 / Bill To / Globex Ltd
scan0002.pdf: Invoice No INV-2041 / Invoice Date: 09/03/2025 / Bill To / Initech
scan0003.pdf: no matching text
Fields: invoice (label Invoice No, next word), date (label Invoice Date, rest of line, YYYY-MM-DD, day first), customer (label Bill To, line below). Template {date}_{invoice}_{customer}

New names

scan0001.pdf -> 2025-03-09_INV-2041_Globex Ltd.pdf
scan0002.pdf -> 2025-03-09_INV-2041_Initech.pdf
scan0003.pdf -> scan0003.pdf (No invoice, date, customer found; original name kept)

Tips for best results

  • Open the box showing the text the rules see before writing a label. Labels are often printed in capitals, split across two lines or followed by a wide gap, and the box shows the characters a rule will really meet.
  • End a template with {original}, for example {date}_{invoice}_{original}, and two invoices with the same number no longer collide into numbered duplicates.
  • Pick "use a placeholder" while testing: a file with a missing value shows "unknown" in its new name, which stands out more than one quietly keeping scan0047.pdf.

Common pitfalls

The tool reads only the text layer, so a file made of page images yields nothing. A notice appears when no file in the batch has any text.

Extract the ZIP into a new folder rather than over the originals: a file whose new name equals another file's old name would be overwritten.

Common errors and how to fix them

A date field shows "Not found" for every file
The text after the label is not a date this tool reads. A month name needs a four-digit year, so "9 Mar 25" fails where "9 Mar 2025" works. Check the text pane, and try "rest of the line" or "the line below" if the date sits elsewhere.
A file shows Unreadable with "Password-protected"
The PDF asks for a password before it can be opened, so no text can be read. Run it through Unlock PDF here with the password, then put the unlocked file in this batch in its place.
The template uses {customer}, which is not an enabled field
Switch the field on or remove the tag. The tags are {original}, {n} and the names of enabled fields.

Best practices

  • Run ten files first and read every row of the preview, since wording often differs between a supplier's older and newer invoices.
  • Name fields after what they hold, such as invoice and date, so the CSV map's column headings read well when it is filed with the batch.