Forum Discussion

3 Replies

  • virendrak's avatar
    virendrak
    Iron Contributor

    How SharePoint Online File Path Length is Counted

    • Decoded Path Length (the real limit): SharePoint Online enforces a 400‑character limit on the decoded path.
    • That means spaces, special characters, folder and file names are counted as they appear in plain text, not in their encoded %20 or %2F form.
    • What Counts Toward the Limit: 
    • ✅ Site name (after the domain)
    • ✅ Document library name
    • ✅ Folder and subfolder names
    • ✅ File name (without extension)
    • What Does Not Count: 
    • ❌ The domain (https://tenant.sharepoint.com/)
    • ❌ File extension (e.g., .docx, .xlsx)

    Example

    https://tenant.sharepoint.com/sites/ProjectX/SharedDocuments/2025/Design/Blueprints/Final Draft v2.docx

    • Count starts after sites/ProjectX/
    • Includes: Shared Documents/2025/Design/Blueprints/Final Draft v2
    • Excludes: https://tenant.sharepoint.com/ and .docx

    If that decoded string exceeds 400 characters, the file won’t upload, sync or migrate properly.

    SharePoint Online’s file path limits are often misunderstood. Below article breaks down what actually counts toward the 400?character limit, clears up common myths, and shows practical ways to count length. Whether you’re an admin or end user, you’ll learn how to manage paths effectively and keep your files accessible.

    Confused About SharePoint Online File Path Limits? Here’s What You Should Really Count

  • 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

    LinkedIn

    • virendrak's avatar
      virendrak
      Iron 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.

Resources