The error says We can't sync this item because the path is too long. It does not say which of four different limits you crossed, and they are enforced by different software at different lengths.
The four limits
| Limit | Who enforces it | Counts | Typical symptom |
|---|---|---|---|
| 400 | SharePoint / OneDrive service | the decoded URL path from the library root: folder/sub/file.docx | Upload refused; sync error; "path is too long" in the browser |
| 260 (MAX_PATH) | Windows Explorer and classic apps | the full local path: C:\Users\jd\OneDrive - Contoso\Sales - Documents\folder\sub\file.docx | File visible in Explorer but cannot be opened, renamed or deleted; sync loops |
| 259 | Word, Excel, PowerPoint, Access | full local path incl. extension | "The file name is too long" / "Sorry, we couldn't open" from Office only |
| 520 | OneDrive sync client | local OneDrive root (up to 120) + relative path (up to 400) | Sync client refuses to sync the item even with long paths enabled in Windows |
Plus a fifth that is not a path limit: each segment (a single file or folder name) is capped at 255 characters.
Working out which one you hit
- Does it fail in the browser too? Then it is the 400 limit. Rare in practice; usually a migration from a deep network share.
- Works in the browser, fails on the PC in Explorer? 260. The most common case. The local prefix (
C:\Users\<user>\OneDrive - <tenant name>\<site> - <library>\) is typically 60–90 characters before the SharePoint path even starts, so a 180-character SharePoint path is a 260+ local path. - Opens in Explorer, fails only in Word/Excel? 259. One character tighter than Windows and it ignores the LongPaths setting.
- Windows long paths are on and it still won't sync? 520, or a 255-character segment.
- Mac only? macOS allows 1,024 in the path, but each segment is 255 bytes, not characters — accented and non-Latin names hit it early.
Fixes, from cheap to expensive
- Rename a high folder. One rename near the root fixes every path beneath it.
Q3 Financial Reporting and Analysis - Working Files→Q3 Finsaves 50 characters for hundreds of files. - Shorten the local root. The
OneDrive - Contoso Holdings International BVfolder name is part of every local path; the tenant display name can be shortened in the Microsoft 365 admin centre, or the user can relink OneDrive to a shorter local folder. - Enable long paths in Windows (
HKLM\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled = 1, Windows 10 1607+). Fixes Explorer and long-path-aware apps. Does not fix Office's 259. - Use shortcuts, not sync. Add shortcut to OneDrive on a subfolder syncs a shorter tree than the whole library.
- Flatten the structure. The permanent fix, and the one that needs a report of which paths are over the limit for which client before anyone renames anything.
The June 2025 change
OneDrive tightened enforcement of these limits in mid-2025. Files that had quietly lived over the line stopped syncing, and in some reports were renamed or reverted to older versions by clients trying to resolve the conflict. If a user says "OneDrive deleted my files", check the sync client's error list and version history before assuming loss.
Seeing it before it breaks
The useful report is not "files over 400" — almost nothing is. It is "files whose local path would exceed 260 for a Windows user, 259 for Office, or 255 bytes per segment on a Mac", per client profile, ranked by which folder rename fixes the most of them. SyncHealth365 runs that scan for free, read-only, against Microsoft's documented limits per client, and it is the next post's subject.