Forum Discussion
How is the SharePoint Online file path length counted?
Hey! Good question. This confuses a lot of people.
The 400 character limit counts the decoded URL path starting after your tenant domain. So contoso.sharepoint.com doesn't count. Everything after it does. Site path, library name, folders, file name, all the slashes.
Here's the key part most people miss. URL encoding doesn't affect the count. A space shows as %20 in the browser but SharePoint counts it as one character, not three. Same with apostrophes and other special characters.
Quick example. If your file lives at: contoso.sharepoint.com/sites/HR/Shared Documents/Policies/2024/Handbook.pdf
SharePoint counts this part: /sites/HR/Shared Documents/Policies/2024/Handbook.pdf
That's 50 characters. You've got 350 left to play with.
Pro tip1. Watch out for OneDrive sync. It adds your local Windows path on top of the SharePoint path. That's usually where things break first.
Pro tip2. Migrations are the danger zone. Files that worked fine in network drives often break when moved to SharePoint
Best,
Ahmed Masoud
- virendrakDec 11, 2025Iron Contributor
Thank you for the response. One more detail to note:
the slash after the domain and the file extension aren’t included in the path length calculation.