Forum Discussion
EthanBrown
May 16, 2025Iron Contributor
Best duplicate file checker for quickly finding duplicates on Windows or Mac?
Hi everyone, My wife has an old laptop running Windows 11 at work and Ma Mani at home. She has been struggling with cluttered storage on the computer due to years of accumulating files. As you can s...
Nguyenais
May 16, 2025Bronze Contributor
You can use PowerShell or Command Prompt (CMD) to find duplicate files by comparing file names, sizes, or hashes.
Method 1: Find Duplicates by File Name & Size (Fast but Less Accurate)
Get-ChildItem -Recurse -File | Group-Object Name, Length | Where-Object { $_.Count -gt 1 } | Select-Object -ExpandProperty Group | Format-Table FullName
What it does: Lists files with the same name and size in a folder and its subfolders.
Limitation: Different files can have the same name/size, so this isn't foolproof.
Method 2: Find Exact Duplicates Using File Hashes (MD5/SHA1) (Most Accurate)
Get-ChildItem -Recurse -File | Group-Object { (Get-FileHash $_.FullName -Algorithm MD5).Hash } | Where-Object { $_.Count -gt 1 } | ForEach-Object { $_.Group | Select-Object FullName, Hash }
What it does:
- Scans all files recursively.
- Computes an MD5 hash (unique fingerprint) for each file.
Groups files with identical hashes (true duplicates).
No duplicate file checker required. It is a bit slower but 100% accurate since even renamed files are detected.