Compare Files in Different Folders

← All AI-created software

This is AI-generated (aka vibe-coded) software. It is specific to my needs and my system and may not work for you or yours. Support is limited, but if you report a bug I'll certainly look into it. The code is provided in the zip file for you to review should you choose.
⬇️ Download Compare Files in Different Folders.zip296.9 KBLast Updated: November 27, 2026Python

Pick two folders, and the app lists every file in both, with their subfolders, in one table: which files are the same, which differ, which copy is newer, and which are in one folder only. Use it to check a backup or a copy, to find what changed between two versions of a folder, and to copy or delete files from either side to bring them in line.

Main window of Compare Files in Different Folders, comparing a Documents folder with its backup
On this page

Features

  • Every file in both folders, with or without their subfolders, in one table, each marked Identical, Different, Newer in A or B, or Only in A or B
  • Compare one folder with up to 10 target folders at once
  • Copy or delete the selected files on either side from a right-click menu, with deletes going to the Recycle Bin
  • Optional content check of same-size files, to catch changed files and recognize copies whose dates were reset
  • Match files by name wherever they are, or only at the same path
  • Date tolerance and daylight saving offsets, for copies on FAT and exFAT drives
  • Exclude patterns with wildcards, such as Thumbs.db; *.tmp; build\*
  • Sort, filter, search and export tens of thousands of rows, to a TSV file that opens in Excel

Usage

The app is a single Python script with a window. It needs Python 3.8 or later with Tkinter (python.org installers include it; on Debian and Ubuntu: sudo apt install python3-tk), and nothing else.

python compare-files-in-different-folders.py

On Windows, pythonw.exe runs it without a console window. Pillow (pip install pillow) is optional: it only shows the window icon outside Windows. The window opens where it was last closed, at the same size, and maximized if it was.

Comparing two folders

Type or paste a folder in Folder A and Folder B (or use Browse…), then click Compare folders (or press F5, or Enter in a field). The status bar shows the progress, and then the result: green when every file could be read, red, starting with ⚠, when some couldn’t.

To compare Folder A with more than one folder, click Add folder beside Folder B: each click adds a target folder (Folder B2, B3 and so on, up to 10), and Remove takes one away.
Folder A is compared with each of them, and the table has rows for each: the Folder B path starts with the target’s name (B2: Notes\todo.txt), so sorting by that column groups the rows by target. Statuses such as Newer in B and Only in B refer to the row’s own target.

Status Meaning Shown in
Identical In both folders, with the same size and modified date (within the date tolerance). With Verify contents on: the same contents, whatever the dates. Green
Different The same modified date, but a different size or different contents. Red
Newer in A, Newer in B The modified dates differ, and that folder’s copy is newer. Bold black
Only in A, Only in B The file is in one folder only. Gray

Files are matched by name, wherever they are in the subfolders. A name found more than once in a folder is paired with every copy in the other folder.

The Content column says whether the contents are the same (Same), differ (Differs, always known when the sizes differ), weren’t checked (Not checked), or couldn’t be read (Read error).
The date and size columns are green when the two copies match and red when they don’t.

Files and folders that can’t be read (permission denied, for example) aren’t left out silently: View errors lists them, with the reason.

Options

All of them are remembered between sessions.

  • Case-insensitive file names: Report.PDF and report.pdf are the same file, as Windows treats them. The row shows both names (Report.PDF ↔︎ report.pdf). With Match paths too, it covers the folder names as well.
  • Include subfolders: on (the default), the folders are compared with all their subfolders; off, only the files directly in the chosen folders are.
  • Match paths too: off (the default), files are paired by name wherever they are; on, a file is paired only with the file at the same path in the other folder (docs\notes.txt with docs\notes.txt, not with old\notes.txt), and a file moved to another subfolder shows as Only in A and Only in B.
  • Verify contents of same-size files: reads and compares the contents of paired files whose sizes match. Slower on large folders; the status bar shows how far it has got.
  • Date tolerance: how many seconds apart two modified dates can be and still match, from 0 to 86,400 (a day). FAT32 and exFAT drives keep times to 2 seconds, so 2 is the default.
  • Also match dates exactly 1 hour apart: for files copied across a daylight saving change, or to and from FAT drives.
  • Exclude: patterns separated by ;, with the wildcards * and ?. A pattern without a backslash is matched against file and folder names at any depth (Thumbs.db; *.tmp; .git); one with a backslash (or a forward slash) is matched against the path from the chosen folder (build\*). Excluded folders aren’t scanned at all. The status bar says how many files and folders were excluded.

The table

  • Click a heading to sort by it; click again to reverse. A triangle marks the sorted column. The sort holds when you compare again, and is remembered.
  • Drag a heading’s right edge to resize the column, or double-click the edge to fit the column to its contents. Columns fit their contents until you resize one; from then on your widths are kept, and remembered.
  • Show hides or shows each status; each check box shows how many files have it. Search keeps the rows whose name or paths contain the text. The status bar says how many rows are shown.
  • Click a row to select it, Ctrl+click to add or remove one, Shift+click to select a run of rows, and Ctrl+A to select every row shown. Esc selects none.
  • Right-click a text field for Cut, Copy, Paste and Select all, and the status bar’s message or count of rows for Copy.

Copying and deleting files

Right-click the selected rows (a row not selected is selected on its own first) for:

  • Copy A to B and Copy B to A: copy the files from one side to the other, replacing the other side’s file where the row has one, otherwise to the same path in the other folder (making the subfolders it needs). Copies keep the modified date, so the rows turn Identical. A file a copy replaces goes to the Recycle Bin (the trash on Linux and macOS) first, so a copy can be undone by putting it back from there; one that can’t go there isn’t replaced.
  • Delete A and Delete B: move the files on that side to the Recycle Bin (the trash on Linux and macOS), so they can be put back.

Each action shows how many files it takes, and is grayed out when none of the selected rows has a file on its side (Copy B to A for an Only in A row, for example). Each asks first, listing the files and the folders, and how many copies will replace a file. A file is copied or deleted once however many rows show it. Afterwards the rows of the files touched are brought up to date, keeping the table’s sort, filter and place; a file that couldn’t be copied or deleted is listed in a message and the status bar. The actions use the folders and options of the last comparison, even if the fields have changed since.

Exporting

Export to TSV… writes the rows shown, in the table’s order, to a tab-separated file that opens in Excel: UTF-8 with a byte-order mark (so accented names read correctly), Windows line ends, a heading line, and the texts as shown. A tab or line break inside a name becomes a space, and a name starting with =, +, - or @ gets a leading ', so Excel shows it as text instead of running it as a formula.

About and running as administrator

About (or F1) shows the app’s version and links to its page on infolific.com. When the app runs as administrator on Windows, the title starts with “Administrator:” and the status bar shows ⛨ Administrator in red.

Settings

Settings are kept in compare-files-in-different-folders.ini in the working folder: the folder holding the script (or the executable), or the folder given with --working-folder-path. They are saved when you compare and when you close the window. Settings from earlier versions (in %APPDATA%\compare-files-in-different-folders on Windows, ~/.config/compare-files-in-different-folders elsewhere, or beside the script) are read the first time this version starts without its own, and the old file is left as it is.

Command line

python compare-files-in-different-folders.py [--working-folder-path FOLDER] [--a-folder-path FOLDER]
    [--b-folder-path FOLDER] [options]

The folders and options fill in the window, which opens as usual; one left out (blank) stays as it was last time. They are remembered when the window closes, as if typed in.

  • --working-folder-path FOLDER: the folder for the settings file and temporary files, created if needed. Blank: the script’s folder.
  • --a-folder-path FOLDER: Folder A.
  • --b-folder-path FOLDER: Folder B, or several target folders separated by | (--b-folder-path "D:\Backup|E:\Backup"), which replace those in the window.
  • --b2-folder-path FOLDER, --b3-folder-path FOLDER, --b4-folder-path FOLDER: target folders B2, B3 and B4, one each, set over those in the window and in --b-folder-path (--b-folder-path D:\Backup --b2-folder-path E:\Backup). B5 and on can be given in --b-folder-path.
  • --include-subfolders TRUE or FALSE: compare the folders’ subfolders too, or only the files directly in them.
  • --case-insensitive-names TRUE or FALSE: Case-insensitive file names.
  • --match-paths TRUE or FALSE: Match paths too.
  • --verify-contents TRUE or FALSE: Verify contents of same-size files.
  • --date-tolerance-seconds SECONDS: the date tolerance, from 0 to 86400.
  • --match-dates-hour-apart TRUE or FALSE: Also match dates exactly 1 hour apart.
  • --exclude-patterns PATTERNS: the Exclude field, such as --exclude-patterns "Thumbs.db; *.tmp".
  • --help: lists the options, with their defaults, and exits.

Options can come in any order, as --name VALUE or --name=VALUE; TRUE and FALSE can also be written 1 and 0, YES and NO, or ON and OFF, in any case. A mistake on the command line (an unknown option, an option without its value, a value out of range, a bare file name) prints an error and exits with status 2; without a console it is shown in a message box.

Keyboard shortcuts

Keys What they do
F1 Open About.
F5 Compare the folders.
Enter In a folder field, the date tolerance or the exclude field: compare the folders.
Ctrl+A In a text field: select all. In the table: select every row shown.
Ctrl+click, Shift+click In the table: add or remove a row, or select a run of rows.
Esc In the table: select no rows. In the errors window or About: close it.

Troubleshooting

  • “Tkinter is not available”: install Tkinter for your Python (sudo apt install python3-tk on Debian and Ubuntu; python.org installers include it).
  • The window opens at the default place: the place it was closed at is off every monitor now (a monitor was unplugged), so it opens where it can be seen.
  • Files are missing from the results: check View errors, and the Exclude field.
  • Files show as Newer although they are the same: their dates differ by more than the date tolerance. Raise the tolerance, tick “Also match dates exactly 1 hour apart”, or turn on Verify contents.
  • A delete or copy fails with “Not moved to the Recycle Bin”: the file is on a drive without a Recycle Bin (a network share), and Windows asked whether to delete it for good: the answer was No, so the file is still there (and a copy didn’t replace it).
  • “Settings not saved”: the working folder can’t be written (the script is in a folder you can’t write to). Choose another with --working-folder-path.

Limitations

  • Files are matched by name (or, with Match paths too, by path): a file that was renamed shows as Only in A and Only in B.
  • Without Verify contents, two files with the same size and date count as identical even if their contents differ.
  • Comparing, copying and deleting run in the window’s own thread: the window stays responsive through progress updates, but a single very slow file (a network drive) can pause it.

Version 1.4.0, updated 2026-11-26. infolific.com: https://infolific.com/technology/software-worth-using/ai-created/system-utilities/compare-files-in-different-folders/

⬇️ Download Compare Files in Different Folders.zip296.9 KBLast Updated: November 27, 2026Python

← All AI-created software