Find Duplicate Files in SharePoint Online: Step-by-Step Guide

author Written By Deep Sikha
author Approved By Sonika Rawat
Updated on 11 Sep 2026
Reading Time 8 minutes

User Query: Is there a way to identify duplicate files in a SharePoint library that holds approximately 12,500 files? There are roughly 1,850 possible duplicate files found by using file names and sizes. However, what is the best method to verify duplicates without reviewing all the files one by one?


Introduction: Duplicates tend to be found in many SharePoint Online libraries as a result of uploading similar files or maintaining different copies for various reasons by multiple users. It is not an easy task to find those duplicates if the library has thousands of files. Unfortunately, there is no way in SharePoint to run a duplicate file search in a whole library. As a result, a professional SysInfo Microsoft SharePoint Migration Tool can help to find Duplicate files in SharePoint Online.

Quick Solution: How Do I Identify Duplicate Files in SharePoint Online?

You can find duplicates in SharePoint Online by:

  • Checking Version History to make sure the files are not simply different versions.
  • Sorting and grouping a SharePoint library by file name, size, or modified date.
  • Reviewing smaller libraries manually.
  • Syncing SharePoint files with OneDrive and checking them locally.
  • Using PowerShell and file hashes to identify files with identical content.

For a small library, SharePoint views and manual checking may be enough. For 1000+ files, PowerShell or a dedicated duplicate-analysis solution can save considerable time.

Manual Methods to Find Duplicate Files in SharePoint Online

If your SharePoint library includes a few or even some files, then you can search for duplicates without relying on any third-party applications. There are various options available within SharePoint that will help you find duplicate files by their size, date, or even name.

Method 1: Check Version History First

Before treating two files as duplicates, check whether you are actually looking at different versions of the same file. SharePoint version history stores earlier versions of a document. These versions should not be confused with separate duplicate files.

Steps to check version history

  1. Open your SharePoint document library.
  2. Locate the file. Right-click the file.
  3. Select Version History.
  4. Review the available versions.
  5. Restore or remove an older version if required by your retention and governance policies.

For example, suppose you have FinancialReport.xlsx with 12 previous versions. You do not have 13 separate duplicate files. You have one file with version history. This simple check can prevent unnecessary deletion.

Method 2: Use SharePoint Views to Identify Potential Duplicates

SharePoint views can help you narrow down duplicate candidates without downloading the entire library. You can organize a document library using properties such as: Name, File size, Modified date, Modified by, File type, and Created date.

How to create a useful SharePoint view

  1. Open the SharePoint document library.
  2. Select the view options. Create or modify a view.
  3. Add useful columns such as Name, Size, and Modified.
  4. Sort files by name or size.
  5. Look for groups of files with matching or similar information.
  6. Open the suspected duplicates and compare their content.

For example: These files are worth checking, but the matching size alone does not prove they are duplicates.

File Name Size Modified
Employee-Policy.docx 2.4 MB Jan 12
Employee-Policy.docx 2.4 MB Jan 15
Employee-Policy-New.docx 2.4 MB Jan 15

Important limitation for large libraries

SharePoint's list-view threshold can make large libraries difficult to work with. A Microsoft Q&A discussion involving approximately 28,000 items shows how administrators can run into problems when trying to export and review large document libraries. The discussion also points users toward PowerShell and OneDrive as possible approaches. So, this method is more practical when the library is relatively manageable.

Method 3: Finding Duplicates in SharePoint Online Manually

If you have a small number of documents, this method is suitable. For example, if a project library contains 300 files, you may be able to identify obvious duplicates by sorting the files and checking their properties. Follow these steps:

  1. Open the SharePoint document library.
  2. Sort the files by Name.
  3. Look for identical or similar file names.
  4. Compare the file sizes.
  5. Check the modified dates.
  6. Open the suspected files.
  7. Compare their content.
  8. Keep the correct copy and mark the unnecessary copy for removal.

Suppose a library contains the following: The first two files may be duplicates, but you should open and compare them before deleting anything.

  • ClientAgreement.pdf — 8.5 MB
  • ClientAgreement-Final.pdf — 8.5 MB
  • ClientAgreement-Old.pdf — 8.2 MB

Method 4: Find Duplicate Files in SharePoint Online Using PowerShell

For large SharePoint environments, PowerShell provides a more automated approach. Instead of manually opening thousands of files, you can collect file information and group files based on properties such as file name, size, path, and hash.

PowerShell:

#Parameters
$SiteURL = "https://contoso.sharepoint.com/sites/24Dec"
$Pagesize = 2000
$ReportOutput = "C:\Duplicates.csv"
$ClientId = "7cda65de-xxxxx-b2-a485-bf6e2a70a909"
#Connect to SharePoint Online site
Connect-PnPOnline $SiteURL -ClientId $ClientId -Interactive
#Array to store results
$DataCollection = @()
#Get all Document libraries
$DocumentLibraries = Get-PnPList | Where-Object {$_.BaseType -eq "DocumentLibrary" -and $_.Hidden -eq $false -and $_.ItemCount -gt 0 -and $_.Title -Notin("Site Pages","Style Library", "Preservation Hold Library")}
#Iterate through each document library
ForEach($Library in $DocumentLibraries)
{ #Get All documents from the library
$global:counter = 0;
$Documents = Get-PnPListItem -List $Library -PageSize $Pagesize -Fields ID, File_x0020_Type -ScriptBlock ` { Param($items) $global:counter += $items.Count; Write-Progress -PercentComplete ($global:Counter / ($Library.ItemCount) * 100) -Activity `
"Getting Documents from Library '$($Library.Title)'" -Status "Getting Documents data $global:Counter of $($Library.ItemCount)";} | Where {$_.FileSystemObjectType -eq "File"}
$ItemCounter = 0
#Iterate through each document
Foreach($Document in $Documents)
{
#Get the File from Item
$File = Get-PnPProperty -ClientObject $Document -Property File
#Get The File Hash
$Bytes = $File.OpenBinaryStream()
Invoke-PnPQuery
$MD5 = New-Object -TypeName System.Security.Cryptography.MD5CryptoServiceProvider
$HashCode = [System.BitConverter]::ToString($MD5.ComputeHash($Bytes.Value))
#Collect data
$Data = New-Object PSObject
$Data | Add-Member -MemberType NoteProperty -name "FileName" -value $File.Name
$Data | Add-Member -MemberType NoteProperty -Name "HashCode" -value $HashCode
$Data | Add-Member -MemberType NoteProperty -Name "URL" -value $File.ServerRelativeUrl
$Data | Add-Member -MemberType NoteProperty -Name "FileSize" -value $File.Length
$DataCollection += $Data
$ItemCounter++
Write-Progress -PercentComplete ($ItemCounter / ($Library.ItemCount) * 100) -Activity "Collecting data from Documents $ItemCounter of $($Library.ItemCount) from $($Library.Title)" `
-Status "Reading Data from Document '$($Document['FileLeafRef']) at '$($Document['FileRef'])"
}
}
#Get Duplicate Files by Grouping Hash code
$Duplicates = $DataCollection | Group-Object -Property HashCode | Where {$_.Count -gt 1} | Select -ExpandProperty Group
Write-host "Duplicate Files Based on File Hashcode:"
$Duplicates | Format-table -AutoSize
#Group Based on File Name
$FileNameDuplicates = $DataCollection | Group-Object -Property FileName | Where {$_.Count -gt 1} | Select -ExpandProperty Group
Write-host "Potential Duplicate Based on File Name:"
$FileNameDuplicates| Format-table -AutoSize
#Group Based on File Size
$FileSizeDuplicates = $DataCollection | Group-Object -Property FileSize | Where {$_.Count -gt 1} | Select -ExpandProperty Group
Write-host "Potential Duplicates Based on File Size:"
$FileSizeDuplicates| Format-table -AutoSize
#Export the duplicates results to CSV
$DataCollection | Export-Csv -Path $ReportOutput -NoTypeInformation

Basic PowerShell Workflow:

Connect to SharePoint

↓

Read document libraries

↓

Collect file information

↓

Calculate or retrieve hash values

↓

Group files by hash

↓

Identify repeated hashes

↓

Export duplicate report

↓

Review files

↓

Delete only confirmed duplicates

File Hash Size Location
Report.docx ABC123 4 MB /Finance/2026
Report-Final.docx ABC123 4 MB /Projects/2026

Why use a hash?

The most useful property for an exact duplicate check is generally the file hash. A hash is a calculated value based on file content. If two files have the same content, they can produce the same hash value when the same hashing method is used.

This means files such as ProjectPlan.docx and ProjectPlan-Final.docx can still be identified as duplicates when their content is identical.

  • File names can change.
  • File locations can change.
  • Modified dates can change.
  • But when the underlying content is identical, a content hash provides a much stronger comparison than the file name alone.

Built-in SharePoint Deduplication Option to Delete Duplicate Files in SharePoint Online

For cases where there are numerous files in a SharePoint Online Library, it becomes tedious to check them individually in search for any duplicates. In order to help with this efficiently, the SysInfo SharePoint Migration Tool has inbuild SharePoint Deduplication option. It scans the selected SharePoint sites and helps find duplicate files.

The tool works in three phases. First, it fetches the files, then checks them for duplicates, and finally lets you remove the unwanted copies. It checks files using content hash, file name, file type, and creation date. This also helps find cases where two files have different names but contain the same data. In addition, it migrates SharePoint Sites Between Office 365 Tenants.

Steps to Delete Duplicate Files in SharePoint Online

  1. Download the software, click on Deduplication, and choose SharePoint Deduplication.
  2. Enter your credentials to authenticate your SharePoint connection.
  3. Select the SharePoint sites from which you need to remove theDuplicates.
  4. Use advanced features, including file content, name, and more. Pick the latest version and start the duplicate removal process.

Note: For a detailed, step-by-step guide with screenshots and advanced configuration instructions, refer to the SysInfo Tenant-to-Tenant Migration Tool.

Case Study: Removing Duplicates from SharePoint Environment Before Migration

In one company, there were 48,000 files present in the company's SharePoint environment. In the preliminary inspection, it was observed that 14,400 (30%) files were duplicates. Many of these files had been uploaded multiple times or were saved in various places.

Instead of migrating 48,000 files, the company chose to use SysInfoTools to detect and remove duplicate files before migrating SharePoint Site to Another Tenant. Deduplication resulted in the presence of 33,600 files, which were unique files. The amount of data required to be migrated to the destination tenant was reduced due to this process. The company avoided transferring any unnecessary copies of the files through this process.

Before Deduplication: 48,000 Files

Duplicates: 14,400

After Deduplication: 33,600 Unique Files

Reduction in Data: 30%

Conclusion

The process to find duplicate files in SharePoint Online can be simple when you have a small document library. You can sort files by name, size, or modified date and manually check the suspected copies. The process becomes more difficult when the library contains thousands of files. Most importantly, do not delete files simply because they have the same name or file size.

Frequently Asked Questions

Q1. How can I identify duplicate files in SharePoint Online?

Ans. There are different methods available to find duplicate files in SharePoint Online, including the SharePoint View, Version History, PowerShell, and a professional method. The method you use depends on the volume of your data.

Q2. Can duplicate files be detected across multiple SharePoint sites?

Ans. Using the professional tool, you can choose multiple SharePoint sites to detect and remove duplicate files.

Q3. Is it possible to automatically delete duplicate files in SharePoint Online?

Ans. Yes. The SysInfo SharePoint Migration Tool can scan SharePoint sites for duplicate files and lets you delete the unwanted copies after reviewing the results. You can also choose to skip deletion if you only want to check the duplicates.

Q4. Is duplicate detection suitable for large SharePoint Online environments?

Ans. Yes. It can be useful for large SharePoint environments where checking thousands of files manually would take too much time. You can select the required sites, run a duplicate scan, and review the results.

Q5. Can duplicate files be found based on file content instead of the filename?

Ans. Yes. The tool can use a content hash to find files with the same content, even when their file names are different.

Q6. Is SharePoint Online data secure while scanning for duplicates?

Ans. Yes. The tool scans the selected SharePoint data to identify duplicates without requiring you to download the files individually for manual checking.

Q7. Can duplicate files be identified across different document libraries?

Ans. Yes. The SharePoint Deduplication option can scan selected SharePoint sites and identify duplicate files across document libraries and other selected locations.

Q8. Can I move SharePoint Online data to another site after finding duplicates?

Ans. Yes. After reviewing or removing duplicate files, you can use the SysInfo SharePoint Migration Tool to migrate the required SharePoint data to another site or tenant.