OneDrive path too long errors and invalid character errors stop files during migration. Microsoft sets a 400 character limit for the full path and blocks characters like colons, question marks and asterisks. Learn the exact limits, find the files that fail and follow 6 steps to fix them before you retry.
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 the OneDrive path too long error and the invalid character errors behind them, 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 often allow names that OneDrive does not. Users build deep folders over the years, add dates and project names, and nobody checks the length. The copy tool then meets a rule and skips 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 often 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.
Microsoft's 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 it may shorten long paths and file names.
How do You Fix Path and Character Errors by Hand?
Microsoft's own fix is simple. 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 changes names that users and links rely on, and Microsoft notes that if you shared a file before it was renamed you may need to share it again.
How do You Fix OneDrive Path Too Long and Invalid Character Errors?
These are the steps I follow when a copy report shows skipped files.
- Read 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 stays under 400 characters and every name stays 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 stay untouched.
If sync trouble follows the copy, read OneDrive not syncing after migration. For the full move, read how to migrate OneDrive from one tenant to another.
What can a Migration Tool do About Path Errors?
No tool can beat a platform limit. A file that breaks a Microsoft rule needs a new name or a shorter path, whatever tool you use. What a tool can do is make the retry safe.
RecoveryTools OneDrive Migrator copies OneDrive for Business between tenants and within the same organization. It retries only failed items and never overwrites existing files, so you can fix names and copy again without touching what already moved. It also keeps original dates and hash checks every file. The source stays read-only.
The product page does not say that it renames files or shortens paths, so plan the cleanup yourself. It leaves behind sharing links, Personal Vault, OneNote notebooks, the recycle bin, retention and legal holds, sync app settings and guests.
Retry Failed OneDrive Files Without Starting Over
RecoveryTools OneDrive Migrator retries only failed items and never overwrites existing files. It hash checks every file and the source stays read-only. Test one account first, then move the rest.
No credit card, no sign-up. Works on Windows 11, 10 and Windows Server.
If skipped files stay missing after a retry, read 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 reads the new names.
- Keep 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 come up often. First, fixing files one by one when one parent folder is the cause. Second, renaming in the destination while the source keeps the old name, so the next pass copies the old name again. Third, ignoring blocked names like desktop.ini. Fourth, skipping the pilot and finding errors at cutover.
My Verdict on OneDrive Path Length and Character Errors
These errors are rules, not bugs. Microsoft sets them and no tool removes them.
Scan early, fix the parent folders first and retry only what failed. Then the report ends clean.
Frequently Asked Questions
What is the OneDrive Path Length Limit?
Microsoft sets a limit of 400 characters for the full decoded path, including the file name, in OneDrive and SharePoint in Microsoft 365. File and folder names on PC and Mac can be up to 255 characters.
Which Characters does OneDrive Not Allow?
Microsoft lists " * : < > ? / \ | as invalid. Leading and trailing spaces are not allowed either.
Which File Names are Blocked in OneDrive?
Microsoft lists .lock, CON, PRN, AUX, NUL, COM0 to COM9, LPT0 to LPT9 and desktop.ini. Names that contain _vti_ or start with ~$ are also blocked.
How do I Rename Files That OneDrive Rejects?
Microsoft says to rename the item to remove the bad characters before you upload it. On Windows select it and press F2. On a Mac select it and press Return.
Why did OneDrive Change My File Name?
Microsoft says names can change when they are too long, folders are too deep or the name has unsupported characters. The sync app replaces invalid characters with an underscore.
Can I Retry Only the Failed Files After a Migration?
Yes, with a tool that supports it. RecoveryTools OneDrive Migrator retries only failed items and never overwrites existing files, so you can fix names and copy again.
Does RecoveryTools OneDrive Migrator Rename Long Paths for Me?
The product page does not say so. Plan to shorten paths and rename blocked names yourself, then retry the failed items.
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. Product behavior comes from the RecoveryTools OneDrive Migrator page. Microsoft can change these limits, so check them before you plan.