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.