Files Magic AI · How-To

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

8-step guide·Native + AI methods·8 min read
Quick answer: macOS has no built-in way to rename a PDF from its contents, but Shortcuts can approximate it by chaining "Extract Text from Image" (OCR) into "Rename File," which works on documents with a consistent layout and breaks on anything less uniform. For PDFs that vary in format, drop them into Files Magic AI's Magic Rename instead: it reads the title, date, and parties named inside each PDF, on-device, and proposes a filename like 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.

Where Shortcuts is genuinely the right tool
If every PDF you're renaming comes from the exact same source, the same monthly statement, the same recurring form, a Shortcuts pipeline is simple, free, and doesn't require installing anything. It's a mismatched-format folder, not a single-source one, where it stops being enough.

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.

1

Collect the PDFs in one folder

Setup

Pull 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.

2

Drop them into Magic Rename

Files Magic AI

Drag individual PDFs or the whole folder onto the Magic Rename page. A single contract or a few hundred mixed documents work the same way.

3

Pick a template, or write a custom prompt

Files Magic AI

Use 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.

4

Let it read the PDF

On-device

A 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.

5

Review the proposed names

Check before applying

A 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.

6

Fix or skip anything that looks off

Optional

Correct a misread field on a smudged scan, or exclude that one file from the batch. Everything else still applies normally.

7

Apply the batch

Done

Approve the batch and every file is renamed at once.

8

Undo if something needs fixing later

Safety net

Rename 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

BadWhy it failsGood
Scan_0043.pdfScanner default. No indication of what was scanned.2026-04-02_Acme-Corp_Service-Agreement.pdf
document(2).pdfBrowser default for a duplicate download name. Tells you nothing.2026-02-18_Chen-et-al_Attention-Is-All-You-Need.pdf
Untitled.pdfExport default from a document tool. Duplicates across dozens of files.2026-01-30_Q4-Board-Report.pdf
eSign_final_v3.pdfVersion-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.
A realistic expectation
Clean digital PDFs get named correctly nearly every time. A crooked scan of a faded receipt or a handwritten form is where you'll actually lean on the preview-and-undo step this guide keeps mentioning, treat those first suggestions as a strong draft, not a guarantee.

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 typeUseful fieldsExample
Contracts & agreementsDate, both parties, document type2026-03-11_Smith-Jones_Lease-Agreement.pdf
Research papersLead author, year, short title2026-02-18_Chen-et-al_Attention-Is-All-You-Need.pdf
Bank & financial statementsAccount or institution, statement period2026-Q1_Chase-Checking-Statement.pdf
Forms & applicationsForm name, applicant or submitter, date2026-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 AI

Sources & 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

What does "rename a PDF by content" actually mean?
It means the new filename comes from what is written inside the document, not from what your scanner, browser, or camera called it automatically. Instead of Scan_0043.pdf, you get something like 2026-04-02_Acme-Corp_Service-Agreement.pdf, pulled from the title, date, and parties named in the document itself.
Can Mac do this without any third-party app?
Partially. Shortcuts has an "Extract Text from Image" action that runs OCR on a scanned PDF, and a separate "Rename File" action, so you can chain the two into a basic content-based renamer. It works, but every field it extracts is whatever raw text sits in a fixed position, there is no understanding of "this is the vendor name" versus "this is a date," so it holds up best on documents with an identical layout every time and breaks on anything less uniform. An AI-based renamer reads the document more the way a person would, and generalizes across mixed layouts.
Does this work on scanned PDFs, or only ones with real text?
Both, though the reliability differs. A text-layer PDF, one exported from Word, a browser, or an e-signature tool, already has selectable text, so reading it is close to a solved problem. A scanned PDF is really just an image saved as a PDF, so it goes through OCR first; results are strong on a clean, flat scan and weaker on a crooked page, faint print, or heavy handwriting.
Will this rename a PDF full of scanned handwriting?
Printed text OCRs reliably. Handwriting is a different, much harder problem, and most OCR engines, including the ones behind Magic Rename, read cursive or messy handwriting inconsistently at best. Treat a handwritten form as the one case where you should expect to type the filename yourself, or at least double-check the suggestion closely before approving it.
Do my PDFs get uploaded anywhere to be renamed?
Not with Magic Rename. Reading and naming both happen on your Mac using Apple Intelligence, a built-in local model, or an optional Rename LLM, and nothing is sent to a server as part of the rename pipeline. That matters more for PDFs than most file types, since PDFs are disproportionately the format people use for contracts, medical records, and financial statements.
What happens if it reads the wrong title or date off a PDF?
Nothing changes on disk until you approve it. Every proposed name sits in a preview next to the original filename, so a bad read is something you catch and correct, or skip entirely, before it applies. Rename history holds up to 2,000 past renames if you need to revert one afterward.
Can I rename hundreds of PDFs from a single research or legal folder at once?
Yes. Drop the whole folder onto Magic Rename, pick a template or Auto mode, and it processes every PDF in one batch preview. Filename collisions, like two contracts signed by the same client on different dates, get flagged there instead of silently overwriting one file with another.

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