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 ...
    • 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 ...
    • 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 ...
    • Is it all SharePoint?

      Where files in Microsoft 365 are really stored In Microsoft 365 there are different places where you work with files — for example in Teams, on a SharePoint site, or in your personal OneDrive. This often leads to questions like: “Where are the files ...
    • Uploading photos efficiently to SharePoint and Teams (bulk upload via OneDrive)

      In many workflows, it is necessary to take photos of projects or documents directly on site using a smartphone and make them available within the company. Uploading these images individually via the Microsoft Teams app wastes valuable time. In this ...