The path length limit in SharePoint Online – What you need to know!

The path length limit in SharePoint Online – What you need to know!

Whether it’s issues with syncing to OneDrive, during governance workshops, or directly from users – the question about path length in SharePoint Online keeps coming up:

👉 “How is the path length calculated?”
👉 “What’s the maximum limit?”

No wonder there’s confusion: conflicting information circulates online, and even tools or AI assistants often give wrong answers. 🤯

That’s why we’re clearing things up now – clear, understandable, and without myths!


👉 “How exactly is the path length in SharePoint calculated?”

You may have already seen contradictory answers:

Some say 256 characters, others 400, and many claim it depends on the encoded URL (for example, with 3 characters for %20 for spaces).
❌ Both are incorrect!
✅ SharePoint Online measures the decoded path length.


🔍 Why so much confusion?


Encoded vs. Decoded:
In the browser, spaces appear as %20 or slashes as %2F. If you count these, you think the limit is exceeded – but that’s not true.

Different environments:
On-premises and cloud have different limits.

AI answers:
Many AI tools repeat the myth of the “encoded path length.”

Tools:
Some migration tools report the encoded length, while SharePoint checks the decoded length.


✅ What does SharePoint Online actually count?

SharePoint Online enforces a limit of 400 characters for the decoded path, which includes:

✔ Site name
✔ Document library
✔ Folders and subfolders
✔ File name (without extension)

Not counted:
❌ The domain (e.g., https://tenantname.sharepoint.com/)
❌ The file extension (.docx, .xlsx, etc.)

Spaces or special characters each count as one character.
Example:
Decoded: Meine Zeiterfassung 2025.xlsx = 24 characters
Encoded: Meine%20Zeiterfassung%202025.xlsx = 28 characters


💡 Best Practices

  • Keep folder structures shallow – avoid 8, 9, or 10 levels.
  • Avoid unnecessary characters in folder names.
  • Use clear, short names, but don’t panic about longer file names.
  • Train employees: spaces and special characters are fine as long as the total length fits.


👉 Tip: For safety and consistency (e.g., with OneDrive sync), file and folder names should stay under 255 characters.

    • Related Articles

    • Managing SharePoint Online Themes with PowerShell

      ? Introduction The visual appearance of SharePoint sites plays a key role in user experience and corporate identity... ✅ Prerequisites SharePoint Online Management Shell is installed Administrator rights for SharePoint Online Windows PowerShell 5.x ...
    • How to connect to a specific SharePoint site via PowerShell

      If you want to connect to a specific SharePoint site with PowerShell, the recommended approach is to use PnP PowerShell and connect with Connect-PnPOnline. Microsoft’s Connect-SPOService cmdlet is used to connect to the SharePoint admin center, not ...
    • Why a Team is Not Visible in Microsoft Teams (Despite SharePoint Access)

      Have you invited someone to a project, and while they can see the files in SharePoint, the corresponding Team simply doesn't appear in their Microsoft Teams app? This is a common misunderstanding. In this article, we explain the cause without ...
    • Why can't I see all SharePoint content in Teams?

      Why can't I see everything that's stored on the associated SharePoint page in Microsoft Teams under "Shared"? Many are familiar with this situation: Directly on the SharePoint page belonging to a team, there are folders or other content that I don't ...
    • Recreate deleted owner groups for SharePoint sites connected with M365

      If out-of-the-box (OOB) groups such as owners, members, or visitors, have been accidentally deleted from your SharePoint site, these steps will help you restore them. End users can unintentionally delete default SharePoint groups, resulting in a ...