Local Preflight / Path length limits
SharePoint and OneDrive path length limits
There are two limits, not one. The cloud limit is 400 characters. Once files sync to a Windows PC, Office desktop apps hit a much lower limit. Here is how each is counted, with a calculator.
Short answer
- In SharePoint and OneDrive: the full decoded path, including the file name, can't exceed 400 characters. It is counted from the site onwards, e.g.
sites/Finance/Shared Documents/…/file.xlsx. Thehttps://contoso.sharepoint.com/part doesn't count. A space counts as one character, not three (%20). - After syncing to Windows: Word, PowerPoint and File Explorer fail above 259 characters and Excel above 218, counted from
C:\.
Sources: Microsoft Support, What are the file path length limits? and Restrictions and limitations in OneDrive and SharePoint.
Path length calculator
Paste where the file will live and its path inside the folder you are moving. Nothing leaves this page.
Worked example: why a file opens online but not in Excel
A file at sites/Finance/Shared Documents/Archive/2024 Clients/…/Board pack.xlsx might be 170 characters in SharePoint, well under 400. When Jane syncs the Archive folder, the OneDrive app places it under:
C:\Users\jane.doe\Contoso Ltd\Finance - Archive\2024 Clients\…\Board pack.xlsx
The organisation name, the site name and the library name are added to the front. That can push the same file past 218 characters, and desktop Excel refuses to open it even though it works in the browser. Nothing is wrong in SharePoint, so the admin often can't see the problem.
How to shorten paths without losing structure
- Move content higher. Put a department's folders directly in a library instead of
Shared Documents/Department/Team/…. Each level removed saves its full name. - Use short site and library names.
sites/fininstead ofsites/Finance-and-Accounting-Teamsaves about 25 characters on every file. - Shorten the longest folder names first. One 80-character folder name near the top affects thousands of files.
- Sync less. Syncing a sub-folder instead of the whole library shortens every local path.
Check a whole folder at once
The calculator checks one path. Local Preflight checks every file in a folder against both limits, plus invalid names, and tells you how many characters to remove from each.
Last reviewed 28 September 2026.