I'm looking for a program for Microsoft Windows 7 or 10 that can take a folder containing PDF files as input, and output for each PDF how many pages it contains.

Any license or price is fine.

2 Answers 2


Using exiftool you could use this command:

exiftool -PageCount -ext pdf /path/to/pdfs/files/

If you need to recurse into subdirectories, add -r. You can list multiple directories for the command and it will process them all.


You can use cpdf (Microsoft Windows/Linux/Mac OS X) and Iterate over all files in a directory using a 'for' loop.

To print the number of pages in one PDF:

cpdf.exe -pages "my file.pdf"

In Microsoft Windows, to print the number of pages in all the PDF files the current folder contains in cmd.exe:

for /r %i in (*.pdf) do cpdf.exe -pages "%i"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.