Sign in with Microsoft
Sign in or create an account.
Hello,
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.
OneDrive can rename files with invalid characters

When OneDrive can't sync a file or folder because its name contains invalid characters, OneDrive can sometimes rename it for you.

If OneDrive is able to rename the file or folder, you'll see a Rename option in the notification area. If OneDrive can't rename the file or folder automatically, you'll need to manually rename it yourself.

To let OneDrive rename files or folders for you

Just select the Rename button in the notification that you receive. 

Screenshot of the Rename notification in the OneDrive desktop sync app

During automatic renaming, OneDrive replaces each invalid character with an underscore. For example, a file named .file for syncing would be renamed to _file for syncing.

The option to automatically rename files and folders appears only for names with the following issues:

  • Names beginning or ending with a space

  • Names ending with a period

  • Names containing unsupported Unicode code points

  • Names with surrogate pair issues

To rename files or folders manually

  • To rename a file or folder in Windows, open File Explorer, select the file and press F2.

  • To rename a file or folder on a Mac, open Finder, select the file and press the Return key.

Tip: To find the file or folder which needs attention, open File Explorer or Finder and navigate to the folder and file marked with the  OneDrive error icon, for example:

File Explorer showing OneDrive sync error

Invalid characters that OneDrive can't rename for you

Besides the invalid characters that OneDrive can correct for you, other characters and combinations of characters may also prevent files and folders from syncing. These other characters have special meanings when used in file names in OneDrive, SharePoint, Windows and macOS, such as "*" for wildcards, "\" in file name paths, and names containing .lock, CON, or _vti_. 

The following characters aren't allowed in file and folder names in OneDrive, OneDrive for work or school on Microsoft 365, and SharePoint in Microsoft 365:

" * : < > ? / \ |

If you're syncing files and folders with OneDrive for work or school, Microsoft has a support tool that can rename additional unsupported file and folder names. Read more about the Support and Recovery Assistant. This tool will only rename files and folders that you store in OneDrive for work or school (when you're signed in with your work or school account). It doesn't rename files or folders on your OneDrive.com when you're signed in with your Microsoft account.

Notes: 

  • Some organizations don't yet support # and % in names. If you're a global admin or SharePoint admin in Microsoft 365 Apps for business, see Enabling # and % Support on the SharePoint blog to learn how to allow these characters.

  • If you're using Office 2010, you can't use "&" in file and folder names.

See Also

Invalid file names and file types in OneDrive, OneDrive for work or school, and SharePoint

Sort, rename, or move photos and files in OneDrive

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

Was this information helpful?

What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!

×