Use comparepdfcmd to compare two PDF files using the command line. In a console (i.e., in a Command Prompt window opened by running cmd.exe) enter, e.g., comparepdfcmd.exe -r report.pdf old.pdf new.pdf. If there are any differences report.pdf will be output with each pair of pages from old.pdf and new.pdf shown side-by-side with differences color highlighted (as with a highlighter pen).
This commercial console (command line) program for Windows is ideal for testing, quality assurance, scripted comparisons, and regression testing. It is fast and cloud-free: comparepdfcmd runs on your own computer without the size or page limits of online tools—some customers compare PDFs with thousands of pages. Customers include publishers, banks, insurers, and Governments. (See also Why Compare PDFs?)
comparepdfcmd can say whether two PDFs—or two folders of PDFs—are the same or different, and it can optionally output one or more reports that show any differences. The reports can be in CSV format suitable for spreadsheets or regression testing, or visual in PDF or PNG formats.
Comparisons can be made based purely on the text regardless of margins and word-wrap, or based on appearance (which accounts for fonts, colors, layout, diagrams, images, etc.)
If you require an easy-to-use graphical user interface (GUI) tool, use our DiffPDF application instead.
"Your software is the best I've ever used for comparing PDFs.", —customer feedback.
You can try comparepdfcmd free for up to 20 days using a trial license key. And you can buy a full license key for comparepdfcmd that has no time limit for $190 USD plus local sales tax (or local equivalent for many major currencies) using the secure MyCommerce platform. Tiered price discounts are applied if you buy at least 10 license keys—these are shown when you click Buy Now. (Purchasing departments: comparepdfcmd's Product ID is 300913524.)
comparepdfcmd is a 64-bit application that will work on 64-bit Windows 7, Windows 8, and Windows 10, on computers that have x86-compatible processors, i.e., almost all desktop and laptop computers.
To get a free trial:
comparepdfcmd.exe tryThis will acquire a free trial license key over the internet and then register it. The program will then be ready to use.
You will probably find it convenient to add comparepdfcmd to your PATH. How to do this is explained in the manual, along with full details of all comparepdfcmd's features. The manual is included in the package and can also be viewed online: comparepdfcmd2.pdf (~218 KB).
If you want to buy one or more licenses, visit Buy Now. Once you've completed your purchase the confirmation page will show a “get key” link and an Order ID (which will also be emailed to you). You can then use this to acquire as many license keys as you purchased on each computer you want to use. Run comparepdfcmd.exe buy to make a purchase. Once you have bought a key, run comparepdfcmd.exe getkey order-id to acquire the key, and then comparepdfcmd.exe register key to register it.
We recommend trying before buying, since license key purchases can't be refunded.
Note that each free trial and full license key are tied to the particular computer it is acquired on. Each such license key is valid for all minor and patch versions (e.g., if acquired for version 1, it is valid for all 1.x.y versions). There is no time limit for full license keys—providing the hardware (and how Windows reports it)—don't change.
Free trials and full licenses are governed by the comparepdfcmd-license.pdf (24 KB).
If you want to automate lots of PDF comparisons you might find it helpful to output reports in .pdf, .csv, or .json format and to use our free retest console (command line) program for Windows and Unix. Retest makes it simple to automate black box regression testing.
Here is one example use of the program:
C:\Users\mark>comparepdfcmd -v -s -r report.pdf oldfile.pdf newfile.pdf Wrote "report.pdf"
Here the two PDFs have some different text (compared word-by-word which is the default), and because of the -r or --report option, the differences are shown highlighted in the file report.pdf. In addition, due to the -s or --show option, the report.pdf differences report will be shown in your PDF reader. The message was output because the -v or --verbose option was used. If they had the same texts the output on the console would have been Same, no report would have been produced, and no report would be shown in your PDF reader.
Here is another example use of the program:
C:\Users\mark>comparepdfcmd -f pdf -R reportdir -S summary.csv oldpdfdir newpdfdir
This run compares each PDF file in the oldpdfdir directory with a PDF file in the newpdfdir directory that has the same name (if there is one). For each pair of PDFs that differ, it produces the requested report in the reportdir with the same name as the original files, and with the differences highlighted. In addition it produces a summary of the differences in the file summary.csv.
Here is an extract of a screenshot of a PDF report:
Red change bars in the left margin indicate where changes are, and changes are highlighted by coloring them as if with a highlighter pen.
Here is comparepdfcmd's help output (edited). Note that some options can also—or only—be set in configuration files. (Top)
C:\Users\mark>comparepdfcmd -h comparepdfcmd 2.0.0 Copyright © Qtrac Ltd. 2018-19. All Rights Reserved. Compares two PDF files (or two folders of PDF files) and reports any differences. USAGE: comparepdfcmd.exe [FLAGS] [OPTIONS] <pdf1> <pdf2> FLAGS: -a, --appearance Compares pages by their appearance -c, --chars Compares pages character by character -w, --words Compares pages word by word [default] -v, --verbose Show actions taken -s, --show When comparing two PDFs, if they are different and -r or --report is used to get a PDF report, this option will show the report in your PDF reader --no-normalize-hyphens Don't treat all kinds of hyphens as the same, e.g., treat n-dash, hyphen, etc., as different --ignore-hyphens Ignore hyphens, e.g., treat play-off as playoff --normalize-ligatures Treat ligatures the same as if spelled out, e.g., ﬁ = fi, ﬂ = fl, etc. -h, --help Prints help information -V, --version Prints version information OPTIONS: -C, --config <config> A .ini configuration file whose values override any found in any comparepdfcmd.ini files -r, --report <report>... Report filename to use if there are any differences Supported formats: .csv .jsn .json .pdf .png -R, --reportpath <reportpath> Report folder to use for report files that don't have paths, and for when comparing two folders of PDFs --pages1 <pages1> Pages to compare from pdf1, e.g., 1-5,7,9,11-14 (page numbers start from 1) [default: all] --pages2 <pages2> Pages to compare from pdf2 (page numbers start from 1) [default: same as pages1] --password1 <password1> Password for <pdf1> --password2 <password2> Password for <pdf2> --margin-bottom <bottom> Bottom margin in whole points (e.g., 72) If specified any differences below this margin will be ignored [0, 300] [default: 0] --margin-left <left> Left margin in whole points (e.g., 72) --margin-right <right> Right margin in whole points (e.g., 72) --margin-top <top> Top margin in whole points (e.g., 72) -A, --accuracy <accuracy> How accurate (as a percentage) appearance mode comparisons should be [80, 100] [default: 100] -f, --format <format> Format for reports when comparing two folders of PDFs Supported formats: .csv .jsn .json .pdf .png -S, --summary <summary> Summary filename when comparing two folders of PDFs [default: stdout] ARGS: <pdf1> First PDF file or folder of PDF files to compare <pdf2> Second PDF file or folder of PDF files to compare ALTERNATIVE USAGE: comparepdfcmd.exe try Acquire a free trial license key comparepdfcmd.exe buy Buy a full license comparepdfcmd.exe getkey <order-id> Acquire a full license key (once you have bought and have an Order ID) comparepdfcmd.exe register <key> Register a free trial or full license key comparepdfcmd.exe cid Prints the Computer ID (not normally needed) comparepdfcmd.exe license Shows the license comparepdfcmd.exe manual Shows the manual in your PDF reader (or -m or --manual)
We always recommend using the most recent release. These are kept available for those who want to use specific previous versions. (For details of the changes between versions, see the Changes page.)
Your Privacy • Copyright © 2006 Qtrac Ltd. All Rights Reserved.