How to Rename PDFs by Content on Mac
Scan_0043.pdf and document(2).pdf turned into filenames that tell you what's actually inside them, without opening a single one.
By Ram Velmurugan · Founder & Lead Developer, 1dot.ai
2026-04-02_Acme-Corp_Service-Agreement.pdf that you review before it applies.Open almost any Downloads folder and the PDFs are the worst offenders. Photos at least get a date from the camera. Invoices at least carry a vendor name if you dig. PDFs, though, tend to arrive as Scan_0043.pdf from a scanner, document.pdf from a browser download, Untitled.pdf from an export, or document(2).pdf because you saved the same generic name twice. None of it tells you whether the file is a lease, a research paper, a signed contract, or last quarter's bank statement.
This guide covers the actual options for renaming a PDF based on what's written inside it: what macOS can do natively with Shortcuts, where that approach falls apart, and the workflow in Magic Rename for PDFs that don't share a single predictable layout: contracts, reports, research papers, statements, and forms.
What macOS Can Do Natively (and Where It Stops)
Before reaching for a third-party app, it's worth knowing what Shortcuts can already do, because for a narrow set of PDFs it's genuinely enough. Since macOS Monterey, Shortcuts has included an Extract Text from Image action that runs OCR on a scanned PDF, and a separate Rename File action that applies a new name and keeps the file in place. Chain the two together with an If step to skip files where OCR found nothing, and you have a basic content-based renamer built entirely from stock macOS.
Where this breaks down is layout variation. A Shortcuts pipeline has no concept of "this text is the vendor" versus "this text is the date," it just extracts raw text in whatever order it appears on the page. That works fine if every PDF in the folder comes from the same source with an identical template, like monthly statements from one bank. It falls apart the moment you mix a scanned lease, a research paper PDF, and an e-signed contract in the same batch, since each one puts its useful information in a completely different place on the page.
For that mismatched case, an AI-based reader helps because it understands the text semantically rather than positionally, it can tell a signing date from a document title even when they appear in different spots on different PDFs. That's the gap Magic Rename is built to cover.
Renaming PDFs by Content, Step by Step
Here's the workflow in Files Magic AI, from a folder of generic PDF names to one that's searchable at a glance.
Collect the PDFs in one folder
SetupPull PDFs out of Downloads, email attachments, and your scanner's output into a single working folder. Mixed layouts are fine, unlike a Shortcuts pipeline, Magic Rename doesn't need every file to share a template.
Drop them into Magic Rename
Files Magic AIDrag individual PDFs or the whole folder onto the Magic Rename page. A single contract or a few hundred mixed documents work the same way.
Pick a template, or write a custom prompt
Files Magic AIUse the built-in Documents template for a general {date}_{title}_{sender} shape, or describe what you want in plain language, for example "name it by the two parties and the contract type" for a folder of signed agreements. Auto mode picks a reasonable name per file if you'd rather not choose.
Let it read the PDF
On-deviceA text-layer PDF is read directly. A scanned PDF goes through on-device OCR first, since it's really just an image saved as a PDF. Either way, nothing leaves your Mac.
Review the proposed names
Check before applyingA batch preview shows every original filename next to its proposed replacement. This matters more for PDFs than most file types, since contracts, medical records, and financial statements are exactly the documents where a wrong rename is expensive to sort out later. Conflicts, like two contracts from the same client, are flagged here.
Fix or skip anything that looks off
OptionalCorrect a misread field on a smudged scan, or exclude that one file from the batch. Everything else still applies normally.
Apply the batch
DoneApprove the batch and every file is renamed at once.
Undo if something needs fixing later
Safety netRename history holds up to 2,000 past renames. Revert a single file, or the whole batch, from history rather than typing names back by hand.
Good vs. Bad PDF Filenames
| Bad | Why it fails | Good |
|---|---|---|
Scan_0043.pdf | Scanner default. No indication of what was scanned. | 2026-04-02_Acme-Corp_Service-Agreement.pdf |
document(2).pdf | Browser default for a duplicate download name. Tells you nothing. | 2026-02-18_Chen-et-al_Attention-Is-All-You-Need.pdf |
Untitled.pdf | Export default from a document tool. Duplicates across dozens of files. | 2026-01-30_Q4-Board-Report.pdf |
eSign_final_v3.pdf | Version-numbering chaos with no data about the actual agreement. | 2026-03-11_Smith-Jones_Lease-Agreement.pdf |
Text-Layer, Scanned, and Mixed PDFs: What Changes
- Text-layer PDFs (exported from Word, Pages, a browser, or an e-signature tool) already contain selectable text, so reading the title, date, and named parties is close to a solved problem.
- Scanned PDFs (run through a flatbed scanner or a scanning app) need on-device OCR first. A clean, flat scan reads nearly as well as native text; a crooked page or faint print reads worse.
- Mixed-format PDFs (a scanned cover page stapled to a digital document, common with signed contracts) get handled page by page, with OCR applied only where there's no text layer to read directly.
Renaming a Whole Folder of PDFs at Once
The step-by-step above works the same whether you're renaming one lease or clearing out a year of mixed contracts, statements, and research papers. Drop the whole folder in, choose a template or write one prompt, and the same logic applies to every file, each one still read individually rather than forced into a shared layout. At scale, the review step is where the time actually goes: scanning a batch preview of eighty PDFs for one bad OCR read takes a few seconds, and catching it there beats noticing a misnamed contract months later.
If a folder is already reasonably named and just needs a prefix stripped or sequential numbers reset, Magic Rename's classic batch rules (find and replace, sequential numbering, case changes) skip the AI step entirely and run instantly.
Picking the Right Fields for Different PDF Types
Not every PDF wants the same fields in its filename. A few starting points, all doable with a custom prompt in Magic Rename:
| PDF type | Useful fields | Example |
|---|---|---|
| Contracts & agreements | Date, both parties, document type | 2026-03-11_Smith-Jones_Lease-Agreement.pdf |
| Research papers | Lead author, year, short title | 2026-02-18_Chen-et-al_Attention-Is-All-You-Need.pdf |
| Bank & financial statements | Account or institution, statement period | 2026-Q1_Chase-Checking-Statement.pdf |
| Forms & applications | Form name, applicant or submitter, date | 2026-05-09_W9_Contractor-Name.pdf |
Invoices and receipts follow their own convention built around vendor, invoice number, and amount, covered in more depth in the dedicated invoice renaming guide and the receipt renaming guide, since those documents have their own bookkeeping-specific fields (amount, invoice number) that most other PDFs don't need.
Stop opening PDFs just to find out what they are
Magic Rename reads the title, date, and named parties straight off your PDFs, on your Mac, and proposes a name you can search for. 7-day free trial, no credit card required.
Try Magic RenameExplore Files Magic AISources & Further Reading
Shortcuts OCR and rename actions: Apple Support Communities, on converting PDFs to text with Shortcuts.
Apple Intelligence hardware and OS requirements: Apple Support, "How to get Apple Intelligence".
Magic Rename's own engines, templates, and positioning: Files Magic AI's Magic Rename product page. The same content-aware approach applied to screenshots: renaming screenshots automatically on Mac. For scanned documents that go beyond PDFs, including images off a flatbed scanner or a phone, see batch renaming scanned documents with OCR. How AI file renaming works more broadly, including the cloud/local/hybrid engine breakdown: our AI file renaming guide.
Frequently Asked Questions
PDFs are the format that hides the most information behind the least useful default filename, a scanner or export tool has no idea whether it just produced a lease or a lab report, so it doesn't try. Reading what's actually inside the document, and reviewing the result before it applies, is what turns a folder of Scan_0043.pdf files into one you can search. For the fields specific to money-related PDFs, see the invoice and receipt renaming guides. Camera roll photos have a related but distinct problem, solved by date rather than content; see how to rename photos by date on Mac. For the bigger picture of how AI renaming tools work, including how Files Magic AI compares to NameQuick and the rest of the field, read How AI File Renaming Works on Mac. If PDFs are just one part of a bigger folder cleanup, our bulk renaming guide covers the non-AI batch tools built into macOS too.
Published August 18, 2026 · More guides · Files Magic AI