How to rename invoice PDFs automatically by date, supplier and invoice number
30 November 2026
To rename invoice PDFs automatically, something has to read each invoice, find its date, supplier and invoice number, and build a new name from them, such as "2026-11-30 Kestrel IT Ltd - KIT-7781.pdf". On Windows you can build that for free in Power Automate for desktop, and programmers can script it, but both need a rule for each supplier's layout, so for a few invoices a month, renaming by hand is quicker.
Decide on the name first
Pick one pattern and keep to it. The date written year first, then the supplier, then the invoice number keeps a folder in date order and makes each file easy to match to your books. Our file naming convention for invoices and receipts explains why, and which characters to leave out.
Why invoices are harder than other PDFs
- Every supplier lays them out differently. One writes "Invoice no", another "Inv #", and another puts the number in a box with no label.
- Dates come in many forms. 30/11/2026, 30 Nov 2026 and an American supplier's 11/30/2026 all need writing one way, and one invoice can show an invoice date, a tax point and a due date.
- Scanned invoices have no text. A scan or photo is a picture of the page until OCR (text recognition) has been run on it.
- Invoice numbers can hold characters file names can't. KIT/7781 has a slash, which Windows doesn't allow in a file name.
- Numbers repeat across suppliers. Two suppliers can both send invoice 1001, which is why the supplier belongs in the name.
1. Rename by hand
Good for: a few invoices a month.
Open each invoice, note the date, supplier and number, then close it and rename the file: select it and press F2 in File Explorer, or Return in Finder on a Mac, where the Space bar previews it with Quick Look. Copy the invoice number from the PDF rather than retyping it, and check each name.
2. Build a flow in Power Automate for desktop
Good for: Windows users with a handful of regular suppliers, happy to write text patterns.
Microsoft's automation app is free on Windows 10 and 11. A flow for invoices uses these actions, and Microsoft's reference pages cover the PDF, text and file ones:
- Get files in folder, with the file filter
*.pdf, then a For each loop over the files. - Extract text from PDF, with Page(s) to extract set to Single and page 1.
- Parse text with Is regular expression and Ignore case switched on, once for each value. For example,
(?<=Invoice (no|number)\W+)[A-Z0-9/-]+finds the number after "Invoice no" or "Invoice number". - Convert text to datetime, with a custom format such as
dd/MM/yyyyif needed, then Convert datetime to text with the custom formatyyyy-MM-dd, so every date is written the same way. - Replace text to swap any
/in the invoice number for-. - Rename file(s) with Set new name, such as
%DateText% %Supplier% - %InvoiceNo%with your own variable names. Leave If file exists on Do nothing, the default, so a repeated name can't replace another invoice.
The supplier is the hardest value, as it rarely has a label: the simplest answer is a folder per supplier, with the supplier's name typed into the flow. Expect to adjust the patterns whenever a supplier changes its layout, and check the results, as a pattern can pick up the wrong text. Scanned invoices need its separate OCR actions too.
On a Mac, the Shortcuts app has Get Text from PDF, Match Text and Rename File actions, so the same approach works there.
3. Write a script
Good for: people who write code.
A script does the same job: read the first page's text with a PDF library such as pypdf, find each value with a pattern, write the date as 2026-11-30, check the new name isn't taken, then rename. Our guide to renaming PDFs from their content has a short Python example. For invoices you'll need a pattern for each supplier's labels and a way to read each supplier's date style. pypdf doesn't do OCR, so scans need it first.
4. Use a document manager or bookkeeping service
Good for: filing every document, if you'll set up or pay for a system.
- Paperless-ngx is a free, open-source document manager you run on your own computer or server. It runs OCR on scans, can assign a correspondent, such as the supplier, with matching rules, takes the document's date from the first date it finds, and can name the files it stores from a template such as
{{ created }} {{ correspondent }} {{ title }}. It names its own stored copies, not the files in your folder, and invoice numbers would need a custom field. Setting it up is a project in itself. - Invoice-capture services that feed accounting software read the date, supplier and amount from each invoice, scans included. They work by uploading your documents and usually charge monthly. How they name the files they export varies, so check before relying on one for this.
- Cloud storage rules don't read invoices. Dropbox's naming conventions, for example, rename files from the upload date, a keyword or the folder, not from what's written inside.
When a tool is quicker
Flows and scripts need a rule for every supplier, and services need your invoices uploaded. Name Documents does it on your own computer. Drop in the PDFs, a folder or a .zip, and click the date, the supplier and the invoice number on one of them. It finds the same values in every other PDF by their label, however it's written ("Invoice no", "Invoice number", "Inv #"), by their place on the page or by what they look like, and writes every date the same way, such as 2026-11-30. Every new name is listed before anything is saved, with anything not found marked, and you can change any name by typing. Characters file names can't contain are replaced, and a repeated name gets a number, so nothing is overwritten. Download renamed copies in a .zip with an index of old and new names, or, in Chrome and Edge, rename the PDFs in their folder, with undo.
It needs PDFs with text it can read, such as invoices from accounts software or online shops. Scanned invoices are marked so you can type their names, and PDFs that need a password to open are left out.
It runs in your browser and your files never leave your computer. The free version renames up to 10 PDFs at a time; Pro is £19 once and renames any number. You can try it with sample invoices first.
Quick answers
Can Windows rename PDFs from the invoice number by itself? Not from File Explorer. Power Automate for desktop, free on Windows 10 and 11, can do it with a flow that reads each PDF's text and renames the file.
What order should the parts of an invoice file name go in? Date first, written year first (2026-11-30), then the supplier, then the invoice number. They then sort into date order.
Why does my flow find no text in some invoices? They're probably scans or photos, which are pictures of text. Run OCR on them first, then try again.