Every edit in a SharePoint library keeps the previous file in full. Office autosave means "every edit" can be every few minutes. With the default of 500 major versions, a 30 MB deck that a team worked on for a month can quietly be 10 GB. Most tenants have never looked.
The fast answer: Storage Metrics
Site settings → Storage Metrics (or go straight to https://<site>/_layouts/15/storman.aspx). It lists every library with its total size, and you can drill into folders and files. The Total Size per file includes all its versions; the modern library view's File size column does not.
Two limits: it is per site collection, so a tenant audit is one site at a time, and it lags 24–48 hours behind reality.
The precise answer: sum the versions
To get "of this library's 400 GB, how much is versions", you need each file's current size and each version's size:
Connect-PnPOnline -Url https://contoso.sharepoint.com/sites/Finance -Interactive
$lib = 'Documents'
$items = Get-PnPListItem -List $lib -PageSize 2000 -Fields FileRef,File_x0020_Size,SMTotalSize |
Where-Object FileSystemObjectType -eq 'File'
$current = ($items | Measure-Object { [int64]$_['File_x0020_Size'] } -Sum).Sum
$withVers = ($items | Measure-Object { [int64]$_['SMTotalSize'].LookupId } -Sum).Sum # SMTotalSize = size incl. versions
"{0} files | current {1:N1} GB | incl. versions {2:N1} GB | versions {3:N1} GB ({4:P0})" -f `
$items.Count, $current/1GB, $withVers/1GB, ($withVers-$current)/1GB, ($withVers-$current)/$withVers
SMTotalSize is the same number Storage Metrics uses. On tenants where it comes back empty, fall back to Get-PnPFileVersion per file and sum Size; it is slower (one call per file) but exact.
To rank the offenders:
$items | Select-Object @{n='Path';e={$_['FileRef']}},
@{n='Current MB';e={[math]::Round($_['File_x0020_Size']/1MB,1)}},
@{n='Total MB';e={[math]::Round($_['SMTotalSize'].LookupId/1MB,1)}} |
Sort-Object 'Total MB' -Descending | Select-Object -First 25
The top 25 usually tells the story: a handful of large, frequently-edited Office files and one folder of exported reports that a flow re-uploads daily.
Reading the numbers
- Versions are 60–90% of the library. Normal for libraries with big Office files and autosave. A version limit or intelligent versioning will reclaim most of it.
- Versions are under 20%. The problem is somewhere else: the recycle bin, the Preservation Hold Library, or another site. See where the missing gigabytes are.
- One file has thousands of versions. Almost always a file written by a flow or a sync loop. Fix the writer, not the limit.
- The number does not move after a trim. Storage usage updates on a 24–48 hour cycle. Check again tomorrow.
What to do with the answer
- Set intelligent versioning tenant-wide (SharePoint admin centre → Settings → Version history limits → Automatic) so the problem stops growing.
- Trim the libraries where versions dominate, after a what-if report: how to get below 100 versions and trim safely.
- Leave the rest.
The audit above is what TrimVersions365's free Analyze tab does for every library on a site in one pass: files, historical versions, estimated version storage, ranked. Pro adds the what-if and the trim.