A OneDrive invalid filename warning can stop an item from syncing even when the file itself opens correctly on another device. The problem may be a prohibited character, a reserved name, a folder name further up the path, or a platform-specific path-length limit.
In this guide
Example verification: The names and arithmetic are illustrative. No OneDrive or SharePoint sync test was performed.
Start with the exact item named in OneDrive’s sync message. Avoid deleting files or renaming an entire synced library just to clear the warning.
Identify the affected account and item first
Open the OneDrive cloud icon in the Windows notification area and look for the reported sync problem. If more than one OneDrive account is connected, make sure you are checking the account that owns the affected folder. A personal OneDrive and a company SharePoint library may have different settings or administrators.
Find the item in File Explorer if it exists locally. If the error relates to an item created online or on another device, inspect the correct library in OneDrive or SharePoint on the web. Record its full location, not only the final filename. Keep a safe copy of any important local changes that have not yet synced.
Check for a OneDrive invalid filename or reserved name
Microsoft documents prohibited names and characters for OneDrive and SharePoint [1]. Some restrictions also come from the operating system. For example, an ordinary Windows filename cannot contain a question mark or a colon. An item originating elsewhere may still cause trouble when synchronized to Windows.
Examples to diagnose (illustrative names, not files that were created or synced for this article):
| Name | Potential problem | Safer descriptive alternative |
|---|---|---|
Invoice: April.xlsx | Colon | Invoice-April.xlsx |
NUL.txt | Reserved Windows device name | null-values-notes.txt |
Budget?.xlsx | Question mark | Budget-draft.xlsx |
Q2 Report | Trailing space | Q2 Report |
Also look for names such as desktop.ini, _vti_ and temporary Office names beginning with ~$, as applicable. A temporary file made by an open application is not the same thing as the real document. Close the application and let it manage its own temporary files; do not rename a lock file to try to recover a document.
The restrictions page explains exceptions that can depend on organizational settings and application versions. For instance, support for certain symbols such as # and % can vary in some organizations [1]. Do not bulk-remove every punctuation mark or non-English character just because one file fails to sync.
Check the full path, not just the filename
A short filename can sit inside a very long hierarchy. OneDrive and SharePoint apply a limit of 400 characters to the decoded cloud path, including the filename [2]. Local Windows and Office applications can have their own limits, and the local sync root adds more characters.
Suppose a synthetic cloud folder path is 375 characters long, without its final separator, and the filename is 30 characters. The resulting path would be 406 characters. Renaming a folder so that the path is shortened by 20 characters would produce a 386-character path. The arithmetic illustrates why inspecting the full path matters even when the final filename is reasonable. A path within the cloud limit is not a guarantee of compatibility with every local application.
Use a shorter, descriptive parent directory when a path limit is confirmed. On a shared library, coordinate the change with the owner before renaming or moving folders: existing links and applications may depend on their location.
Choose the smallest safe change
| Symptom | First action |
|---|---|
| One name contains an invalid character | Rename that item with a descriptive alternative |
| Many items in one deep folder fail | Inspect the shared parent path |
| A temporary Office file is flagged | Close the originating Office document normally |
| One item fails only in an Office app | Check the specific application’s naming and path restrictions |
| The error persists after a valid rename | Confirm the correct account, current sync status and destination name |
If the existing name is invalid on Windows and cannot be changed through File Explorer, an authorized owner may be able to rename it in the web interface or on the device where it was created. Confirm that the proposed name is not already occupied. On a managed account, ask the administrator if permissions or library policies prevent a safe correction.
Verify that the rename actually fixes syncing
After correcting the specific item, allow OneDrive to process the change. Inspect the sync status and verify that the intended file appears in the appropriate online folder. Open it if necessary and confirm its content or version. If you moved or renamed something important, verify that people or applications relying on it can still find it.
If the warning remains, do not immediately reset OneDrive or delete its local folders. Recheck the exact error, the parent directories, file type and account. Microsoft’s sync troubleshooting guidance describes additional checks for SharePoint libraries [3]. Escalate to your organization’s support team for a shared or managed library.
A filename fix is successful when the intended file is accessible and synchronized, not merely when an error icon disappears.

Sources
[1] Microsoft Support, Restrictions and limitations in OneDrive and SharePoint: https://support.microsoft.com/en-us/onedrive/restrictions-and-limitations-in-onedrive-and-sharepoint
[2] Microsoft Support, What are the file path length limits?: https://support.microsoft.com/en-us/onedrive/what-are-file-path-length-limits
[3] Microsoft Support, Fix SharePoint Online sync problems: https://support.microsoft.com/en-us/sharepoint/sync/fix-sharepoint-online-sync-problems
[4] Microsoft Learn, Naming Files, Paths, and Namespaces: https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file



