To find duplicate files with different names on Windows, ignore the names completely and compare what is inside the files. The reliable way is a hash: a short fingerprint calculated from a file's bytes. Two files with the same hash have the same content, whatever they are called and wherever they are stored. You can calculate hashes with PowerShell's Get-FileHash command, or let a duplicate finder that compares content do it across whole drives for you.
This guide explains why name-based searches miss so many copies, how to check two files or a whole folder by hash, and how to avoid the false matches that catch people out.
Why copies end up with different names
Most duplicates are not called "file - Copy". They are created by tools and habits that rename things along the way:
- Phone and camera imports. One import tool names a photo IMG_4512.jpg, another names it by date, such as 2025-08-03 14.22.10.jpg.
- Browser downloads. Downloading the same file twice gives you report.pdf and report (1).pdf.
- Email attachments. Saving an attachment from several messages creates copies with whatever names the senders used.
- Manual renaming. You rename a file in one folder to make it clearer, while the original stays elsewhere under the old name.
- Music rippers and media apps. Different programs build file names from tags in different ways.
Searching for "copy" or "(1)" finds a few of these. Comparing content finds all of them.
Names, sizes and hashes: what each one proves
| Check | Finds renamed copies? | False matches? | Verdict |
|---|---|---|---|
| Same name | No | Yes, often (IMG_0001.jpg from two cameras) | Not reliable |
| Same size | Yes | Yes, many unrelated files share a size | Good first filter only |
| Same size and date | Sometimes | Fewer, but copying can change dates | Not reliable |
| Same hash | Yes | Practically never with SHA256 | Reliable |
| Byte-by-byte comparison | Yes | None | Definitive but slow for many files |
The practical method combines the two best rows: group files by size first, because files of different sizes cannot be identical, then hash only the files that share a size. That is how good duplicate finders work, and it is much faster than hashing every file.
Check whether two files are identical
If you have two files and want to know whether they are the same, hash both and compare the results.
- Right-click Start and choose Terminal (or Windows PowerShell on Windows 10).
- Type the command below, with your own paths:
Get-FileHash "C:\Users\you\Downloads\report (1).pdf", "D:\Work\Q3 report final.pdf"
PowerShell prints a long SHA256 hash for each file. If the two hashes are identical, the files are identical. Renaming a file does not change its hash, because the name is not part of the content.
If you prefer Command Prompt, certutil -hashfile "path\to\file" SHA256 gives the same result one file at a time, and fc /b "file1" "file2" compares two files byte by byte and reports "no differences encountered" when they match.
Find every renamed duplicate in a folder
To check a whole folder and its subfolders, this PowerShell command groups files by size, hashes the candidates and lists each set of identical files:
Get-ChildItem "D:\Photos" -File -Recurse -ErrorAction SilentlyContinue | Group-Object Length | Where-Object Count -gt 1 | ForEach-Object { $_.Group } | Get-FileHash | Group-Object Hash | Where-Object Count -gt 1 | ForEach-Object { $_.Group.Path; "" }
Each block of paths separated by a blank line is one set of duplicates. Because the comparison is by content, a set can contain completely different names, such as IMG_4512.jpg, 2025-08-03 14.22.10.jpg and beach.jpg.
A few tips for using it:
- Start small. Point it at one folder, such as Pictures or Downloads, before trying a whole drive.
- Skip system areas. Do not run it on C:\Windows, Program Files or AppData. Those folders contain intentional duplicates that programs need.
- Expect it to take a while. Hashing reads every candidate file in full, so large video folders can take many minutes.
- It only reports. The command does not delete anything. You decide what to remove afterwards.
For more ways to do this, including a version that exports the results to a spreadsheet, see our guide on how to find duplicate files on Windows 11.
Avoiding false matches
Comparing content solves the two classic mistakes of name-based searches:
- Different files with the same name have different hashes, so they are never grouped together. This matters with cameras, which reuse names like DSC_0001.jpg, and with files such as "invoice.pdf" or "notes.txt" that appear in many folders.
- Different files with the same size are only candidates. The hash step separates them.
There is also the opposite problem: files you think of as duplicates that are not identical. A content comparison will not group these, and that is correct behavior:
- A photo and a resized or re-saved version of it.
- A document and the same document with one word changed.
- The same song as an MP3 and a FLAC, or with different tags.
For photos, a visual comparison finds these near-duplicates. Our guide to finding similar photos on Windows covers that. For music, see removing duplicate songs from a music library.
Doing it across whole drives
PowerShell is accurate, but on a large drive you end up with hundreds of groups and the job of deciding, for each one, which copy to keep. Drive Sweeper is built for that part. It compares files by content, not by name, so it finds renamed copies and never mistakes two different files with the same name for duplicates. Each group shows the total space you would recover, and it keeps the best copy and picks the rest for removal, with options to keep the newest or oldest.
It can also scan several drives at once, including external drives, USB sticks and network folders, which is often where renamed copies hide: the same folder copied to a backup drive years ago under a different name. If a file genuinely needs to exist in two places, Drive Sweeper can replace the extra copies with links instead of removing them.
Deciding which copy to keep
Once you have a set of identical files with different names, the content is the same, so the choice is about location and name:
- Keep the copy in your organized folder, not the one in Downloads, on the desktop or in a "temp" folder.
- Keep the clearer name. "2025 tax return.pdf" is more useful than "scan0042.pdf". If the better name is on the copy you are removing, rename the keeper first.
- Keep copies that are deliberate backups on a separate drive. A backup is not clutter.
- Check links and shortcuts. If a program or document refers to a file by its path, keep that copy, or replace the others with links.
Work through one folder at a time and remove copies to the Recycle Bin or a restore area rather than deleting them permanently. If something stops working, you can put it back. Our guide on whether it is safe to delete duplicate files lists the cases where you should leave copies alone.
Summary
File names tell you very little about whether two files are the same. Group by size, compare by hash, and you will find every true copy regardless of what it is called, without ever confusing two different files that happen to share a name. For a folder or two, PowerShell does the job; for whole drives, a content-based duplicate finder saves hours of reading lists.
Frequently asked questions
What is a file hash?
A hash is a short fingerprint calculated from a file's content. Identical files always produce the same hash, so matching hashes are a reliable sign of duplicates.
Can two different files have the same size?
Yes, often. Many photos, documents and audio files happen to share a size, so size alone is not proof of a duplicate.
Does renaming a file change its hash?
No. The hash is calculated from the content, so a renamed copy still has the same hash as the original.
