How to Find Duplicate Files on a PC (4 Methods)
Duplicate files are the most common form of hidden waste on a PC: the same installer downloaded three times, photos copied from a phone and a camera, a folder backed up into another folder, "Copy of" documents that were never edited. Finding them by name does not work — the copies are usually renamed — so the reliable approach is to compare content.
How duplicate detection actually works
A serious duplicate finder runs in two stages. First it groups files by exact byte length, which is cheap and eliminates almost everything. Then it hashes the remaining files — reading their content and producing a fingerprint such as SHA-256 or, for speed, xxhash3 — and groups the ones whose fingerprints match. Two files are duplicates only if the content is identical, regardless of name, date or location.
Two corner cases are worth knowing. Hard links are multiple names for the same data on disk: they look like duplicates but deleting one frees nothing. Sparse and compressed files can have the same logical content with different physical footprints — the analyzer's "size on disk" is the number that matters.
Method 1 — A duplicate finder (fastest)
DiskRaptor includes a duplicate scan that uses content hashing (xxhash3) and groups results by wasted space. Open the tool, choose the duplicate finder, select the drive or folder, and run it. You get groups of identical files, the space each group wastes, and the full path of every copy.
Advantages: it is fast, it shows the total recoverable space before you delete anything, and the same scan can be limited to a folder (for example, only your Photos directory). It also handles large drives without loading every file into memory.
Method 2 — PowerShell (scriptable, no installation)
Windows can do this natively. Grouping by length first keeps it from hashing the entire disk, which is what makes the naive version unusably slow:
$root = 'D:\'
Get-ChildItem $root -Recurse -File -Force -ErrorAction SilentlyContinue |
Group-Object Length |
Where-Object Count -gt 1 |
ForEach-Object {
$_.Group | Get-FileHash -Algorithm SHA256 |
Group-Object Hash |
Where-Object Count -gt 1 |
ForEach-Object {
$_.Group | Select-Object Path,
@{n='MB';e={[math]::Round((Get-Item $_.Path).Length/1MB,1)}}
}
}
It is correct but slow: PowerShell still reads the content of every candidate file, and the pipeline overhead is significant. On a drive with millions of files this can run for a long time. It is a good fit for one specific folder, not for a whole disk.
Method 3 — Command-line tools
If you are comfortable in a terminal, dedicated tools are much faster than a scripted loop:
- fdupes (Linux, macOS, and Windows via WSL):
fdupes -r -S /pathlists duplicates with sizes;-dlets you delete interactively. - rmlint (Linux, macOS, WSL): faster and more configurable, with a JSON report for scripting.
- dupeGuru (cross-platform GUI): good for photos and music, with similarity matching for near-duplicates.
Near-duplicates — the same photo at different resolutions, or a re-encoded video — are not byte-identical. Content hashing will not catch them; you need a perceptual tool. Decide which problem you have before choosing.
Method 4 — The manual approach (and why it fails)
Sorting by name or date and eyeballing the list is how most people start, and it is the reason most people give up. Renamed copies, files copied between drives with different timestamps, and folders that were backed up twice all defeat it. Use the built-in tools only for narrow cases: the Photos app can find similar images, and cloud clients tell you when a file already exists — but neither gives you a recoverable-space number.
Comparing the methods
| Method | Accuracy | Speed | Best for |
|---|---|---|---|
| Duplicate finder (DiskRaptor) | Content hash — exact | Fast | Whole drives, large libraries |
| PowerShell script | SHA-256 — exact | Slow | A single folder, automation |
| fdupes / rmlint | Content hash — exact | Fast | Servers, WSL, scripting |
| dupeGuru | Hash + similarity | Medium | Photos and music libraries |
| Manual sorting | Unreliable | Very slow | Nothing important |
Deleting safely
- Keep the copy in the location that matches your backup and sync setup — usually the one inside the folder that is actually backed up.
- Move to the recycle bin rather than deleting permanently, at least the first time.
- Never delete both copies of something you cannot re-download.
- Check that a duplicate is not a hard link or a cloud placeholder before removing it.
- Re-scan afterwards to confirm the space was actually reclaimed.
A typical PC hides 5–30 GB of duplicates. On a photo library or a downloads folder, the number is often higher. It is one of the few cleanups where you can see the exact result before you commit.
Frequently asked questions
Can I find duplicates by file name?
You can, but it is unreliable in both directions: two files with the same name may have different content, and true duplicates are often renamed ("photo (1).jpg"). Content hashing is the only dependable test.
Are hard links duplicates?
No. A hard link is another name for the same data, so deleting one link frees no space. A good duplicate finder excludes them, or flags them separately.
Will duplicate detection delete files on its own?
Not in DiskRaptor — you review the groups and choose. Be sceptical of any tool that deletes automatically; a false positive costs more than the space it saves.
How much space can I usually recover?
On a typical home PC, 5–30 GB. On machines with large photo libraries or repeated backups, it is often more. The scan reports the total before you delete anything.
While the scan runs
Duplicates are one kind of clutter; trackers and open Wi-Fi are another. A VPN for the networks you join, antivirus for the files you kept, and an ad blocker for the pages you browse.
Affiliate disclosure: the links below are affiliate links. If you buy through them, we may earn a commission at no extra cost to you — it helps keep DiskRaptor free.
More about our Surfshark partnership.
Related reading
- How to Find and Remove Duplicate Files
- Disk Space Full on Windows 11? Here's the Fix
- The 5 Biggest Space Wasters on Every PC
- What Is a Disk Space Analyzer?
Reclaim your disk space
DiskRaptor is free, open source, and runs 100% locally.