The short answer
Two limits apply to a OneDrive file. They do not come from the same place and do not have the same consequences:
| Limit | Source | Consequence |
|---|---|---|
| 400 characters | OneDrive, OneDrive for work or school and SharePoint in Microsoft 365: the entire path, including the file name | 🔴 The file cannot be synced (the "file path is too long" error). |
| 255 characters | Windows ("MAX_PATH" limit: 260 characters in total, drive letter and terminating character included) | ⚠️ The file syncs, but Windows and some applications cannot open it from File Explorer. |
Why you read 255, 256 or 260
The number varies depending on what is counted: the drive letter (C:\), the terminating character Windows adds, or the file name only. The official Windows limit is 260 characters, terminating character included. OneDrive Path Checker flags paths over 255 characters as warnings and paths over 400 characters as critical.
What counts toward the length
- For the 400-character limit: the full folder path and the file name, once decoded (a space counts as one character).
- For the Windows limit: the full local path from the drive root, including your Windows user name and the name of the OneDrive folder, for example
C:\Users\julie\OneDrive - My Company\Projects\Document.docx. The same file can therefore open on one computer and not on another.
Can the limit be raised?
Not the 400-character limit of OneDrive and SharePoint. The Windows limit (260 characters in total), however, can be lifted for compatible applications from Windows 10 (version 1607): long path support must be enabled in the Registry (the LongPathsEnabled value) or with the "Enable Win32 long paths" group policy, with administrator rights. Not every application supports it, and it does not change OneDrive's 400-character limit.
Check your files
Hunting for these paths by hand across thousands of folders is unrealistic. OneDrive Path Checker scans a OneDrive folder in seconds and lists files over 255 characters (warnings) and over 400 characters (critical), with the number of excess characters. You rename them from the application, then export a PDF or CSV report.