File Synchronization · 5 MIN READ

How to Compare Two Folders and Copy Only Changed Files

Build a difference first workflow that identifies missing or changed files before copying, instead of transferring an entire folder again.

You do not need to recopy an entire folder every time a few files change. A better workflow is to compare Folder A and Folder B, classify what differs, then copy only missing or changed files.

This is useful for backups, project replicas, external drives, document archives, and photo collections.

Why Blind Copying Is Inefficient

Imagine Website Project/ contains 18,000 files, but your last editing session changed only 12. Copying the whole folder again creates unnecessary reads and writes and makes it harder to see what actually changed.

A folder comparison provides a plan before copying.

The important word is plan. The comparison itself should not modify the destination.

Match Files by Relative Path

Synchronization tools commonly start by matching entries at the same relative path.

For example:

Folder A:

ClientSite/assets/logo.svg

Folder B:

Backup/assets/logo.svg

If assets/logo.svg exists on both sides, the comparison can decide whether the two files appear equal or different.

If an item exists only on one side, it falls into a one sided category.

The official FreeFileSync desktop documentation describes this same relative path based matching model for its comparison engine.

Use Metadata for a Fast First Pass

A fast compare can use:

  1. Relative path
  2. Filename
  3. File size
  4. Modification information

If both copies have matching expected metadata, you may choose to treat them as unchanged for a routine backup.

If the size differs, they are clearly not identical.

If the modification information differs, one copy may be newer, but timestamps should be interpreted carefully. Some copy tools, storage devices, exports, or conversions can alter modification metadata.

Use Content Comparison When Metadata Is Not Enough

Two files can have the same size and still contain different bytes.

Exact content comparison reads the actual files to determine whether they match. This is more reliable for content equality but takes more time because data must be read.

A practical strategy is to use metadata for the broad scan and deeper content checks for ambiguous or high value files.

Build a “Changed Files Only” Plan

After comparison, the plan can contain these categories.

Only in Folder A

Copy these to Folder B if A is the source.

Only in Folder B

If you are using an update workflow, leave them alone unless you have a separate reason to remove them.

Folder A newer

Copy A to B when the timestamp and workflow indicate A is the intended version.

Folder B newer

Do not automatically overwrite a newer destination unless the synchronization policy explicitly says A is authoritative.

Different content

Review the file direction. Content difference proves the files are not identical, but it does not decide which version is correct.

Identical

Skip the copy.

Example: Update a Project Backup

Source:

Projects/Storefront/

Destination:

Backup/Storefront/

Comparison result:

README.md identical
app/page.tsx A newer
public/logo.svg only in A
notes/old.txt only in B

An Update Destination plan would normally:

  1. Skip README.md
  2. Copy app/page.tsx from A to B
  3. Copy public/logo.svg from A to B
  4. Leave notes/old.txt in B

Only two files need to be copied.

A Mirror plan could behave differently because the B only file may be scheduled for removal. Read how to mirror one folder to another safely before treating destination only files as deletions.

Filters Can Reduce the Scope Further

Sometimes a changed file is still not something you want in the backup.

A development folder may contain cache files, generated output, or temporary logs. Include and exclude filters let you limit the working set.

The official FreeFileSync documentation describes include and exclude rules for its desktop application. FreeFileSync.online can use a simpler browser appropriate filtering model while keeping the same user benefit: only process files that belong in the job.

Preview Before Writing

A good preview answers these questions:

  1. What is the source path?
  2. What is the destination path?
  3. Why is the file considered changed?
  4. What action will occur?
  5. Is anything going to be removed?
  6. Can the item be deselected?

That lets you catch a reversed source and destination before it becomes a filesystem mistake.

What “Copy Only Changed Files” Does Not Prove

It does not automatically prove that:

  1. The source copy is the correct version.
  2. The source was not already corrupted.
  3. Every timestamp is meaningful.
  4. A successful browser write guarantees hardware level durability.
  5. Skipped files are content identical unless exact comparison established that fact.

For valuable data, keep a separate backup and learn how to verify copied files after folder synchronization when the extra content check is appropriate.

Conclusion

To compare two folders and copy only changed files, separate discovery from action. Compare first, classify the differences, skip identical entries, review ambiguous versions, then copy only the files your chosen update rule requires.

Use Free Online File Sync for this workflow. For a related explanation of conservative updates, read How to Sync Two Folders Without Deleting Extra Files in the Destination.

A LITTLE CLARITY

Good questions. Straight answers.

What is the fastest way to compare two folders?

A metadata based comparison using paths, sizes, and modification information is usually lighter than reading the full contents of every file.

Can two files have the same size but different content?

Yes. Equal size alone does not prove equal content.

Should I delete files that exist only in the backup?

Not automatically. If the backup is an archive, destination only files may be intentional. Use Update Destination rather than Mirror when those extra files should remain.

Can I copy only selected changed files?

The planned FreeFileSync.online tool supports selective synchronization so individual comparison results can be included or excluded before approval.