Fix path too long errors in OneDrive in 6 steps. Open report, count path, shorten, strip characters, rename, retry. Count the full path against the 400 character limit. Shorten parent folders first since one folder fixes thousands. Rename items with blocked characters or names like CON. Retry only the failed items after the fix. Hand renaming breaks links so share the file again.
Your copy finishes at 98 percent. Then the report lists a few hundred files that never arrived.
I see this on almost every OneDrive project. This guide explains why a path too long message appears and the invalid character errors behind it, using Microsoft's own limits and shows how to fix them before you retry.
Why does OneDrive Show a Path Too Long Error After Migration?
Old file shares and old tenants accept names that OneDrive does not. Users build deep folders over the years, add dates and project names and nobody checks the length. The copy then meets a rule and omits the file.
Moving a folder under a new parent also adds length. A path that fit before the move can go over the limit after it. That is why the error shows up on files that opened fine for years.
What are the OneDrive Path Length and Character Limits?
Microsoft's page on restrictions and limitations in OneDrive and SharePoint lists the rules. Here are the ones that cause most failures.
| Rule | Microsoft limit |
|---|---|
| Full path with file name | 400 characters in OneDrive and SharePoint in Microsoft 365 |
| Every file or folder name | 255 characters on PC and Mac |
| OneDrive root path plus file path | 520 characters |
| Invalid characters | " * : < > ? / \ | |
| Spaces | No leading or trailing spaces |
| Single file size | 250 GB |
Which File Names does OneDrive Block?
Microsoft also blocks certain names. The list includes .lock, CON, PRN, AUX, NUL, COM0 to COM9, LPT0 to LPT9 and desktop.ini. Names that contain _vti_ are not allowed and names that start with ~$ are not allowed either. At the root of a library, a folder called forms is not supported.
Another Microsoft page, on why OneDrive changes a file name, adds a few more. It says OneDrive can rename items that start or end with a space, end with a period or contain unsupported Unicode. In the sync app it replaces invalid characters with an underscore and shortens long paths and the start of file names.
What is the Manual Way to Fix OneDrive Path and Character Errors?
Who it suits. Non technical user who fixes a few files on one PC or Mac. Source file size limit. 255 characters per name and 400 characters for the full path Extra application. None, because File Explorer or Finder is enough.
The fix is quick. Rename the file or folder to remove the bad characters before you upload it. On Windows select the item and press F2. On a Mac select it and press Return.
That works for ten files. It does not work for ten thousand. Hand renaming also edits names that users and links rely on. Microsoft says to share a file again if you shared it before it was renamed, because recipients cannot open the edited name.
How do You Fix OneDrive Path Too Long and Invalid Character Errors?
Who it suits. Technical admin who fixes many files after a copy. Source file size limit. 250 GB per file, 400 characters for the full path and 255 per name Extra application. None, because File Explorer or Finder is enough.
I follow these steps every time a copy report shows failed files.
- Open the error report. Sort by error type so you can see path errors and character errors in separate groups.
- Count the full path. Check that the full path with the file name remains under 400 characters and every name remains under 255.
- Shorten and flatten. Cut long folder names and remove extra levels at the source. One shorter parent folder fixes thousands of files.
- Remove invalid characters. Rename items that contain " * : < > ? / \ | and strip leading and trailing spaces.
- Rename blocked names. Fix names like CON, NUL, desktop.ini, .lock and anything with ~$ or _vti_.
- Retry only the failed items. Copy again so the files you already moved remain untouched.
If sync trouble follows the copy, see OneDrive not syncing after migration.
If failed files remain missing after a retry, see OneDrive not opening after migration.
What are the Best Practices to Avoid OneDrive Path Errors?
- Scan before you copy. Find long paths and bad characters in the source first.
- Flatten deep folders. Fewer levels means shorter paths.
- Fix at the source. Rename there so the next pass uses the new names.
- Save a rename list. Users search by old names so send them a short list.
- Test one account. A pilot shows the error types early.
Which Mistakes Make OneDrive Path Errors Worse?
Four mistakes cost the most time. First, fixing files one by one when one parent folder is the cause. Second, renaming in the destination while the source retains the old name so the next pass copies the old name again. Third, ignoring blocked names like desktop.ini. Fourth, omitting the pilot and finding errors at cutover.
My Verdict on OneDrive Path Errors
Microsoft sets these limits as rules so any path too long stop is not a bug and no setting removes it.
Scan early, fix the parent folders first and retry only what failed. Then the report ends clean.
Frequently Asked Questions
Does OneDrive Limit the Full Path to 400 Characters?
Yes. Microsoft sets a limit of 400 characters for the full decoded path, including the file name, across OneDrive and SharePoint in Microsoft 365. File and folder names on PC and Mac can be up to 255 characters.
Does OneDrive Block Colons and Question Marks in Names?
Yes. Names cannot contain " * : < > ? / \ | in OneDrive. Leading and trailing spaces are not allowed either.
Does OneDrive Block Names Like CON and Desktop.ini?
Yes. The blocked list includes .lock, CON, PRN, AUX, NUL, COM0 to COM9, LPT0 to LPT9 and desktop.ini. Names that contain _vti_ or start with ~$ are also blocked.
Does OneDrive Rename Files on Its Own?
Yes. Microsoft says the sync app replaces invalid characters with an underscore and shortens long paths. OneDrive can also rename items that start or end with a space or end with a period.
Can I Rename Files That OneDrive Rejects?
Yes. Rename the item to remove the bad characters before you upload it, as Microsoft advises. On Windows select it and press F2 and on a Mac select it and press Return.
Can I Find the Files OneDrive Flagged?
Yes. Look for the red X error icon in File Explorer or Finder. Select Rename in the OneDrive notification to let OneDrive fix the name or rename the item yourself.
Do I Share a File Again After Renaming It?
Yes, if you shared it before the rename. Microsoft says recipients cannot open the edited name so rename the file and then share it again.
Published 19 October 2026. Path and name limits come from Microsoft's page on restrictions and limitations in OneDrive and SharePoint. Rename behavior comes from Microsoft's page on why OneDrive changes a file name. Microsoft can edit these limits so check them before you plan.