Invalid File Names and Characters in OneDrive and SharePoint

When naming files and folders for use in OneDrive or SharePoint, it's important to follow Microsoft 365’s rules to avoid sync issues or errors. Some characters and names are not supported and may prevent files from uploading or syncing properly.

Characters You Should Avoid

Do not use the following characters in file or folder names:

  • For most Microsoft 365 services: " * : < > ? / \ |
  • For older systems (e.g., SharePoint Server 2013): ~ " # % & * : < > ? / \ { | }

Also not allowed: Leading or trailing spaces at the beginning or end of a file or folder name.

Restricted File and Folder Names

Some file and folder names are completely blocked and cannot be used at all:

  • .lock
  • CON, PRN, AUX, NUL
  • COM0 to COM9
  • LPT0 to LPT9
  • _vti_ (this string cannot appear anywhere in the name)
  • desktop.ini
  • Any file name starting with ~$
  • “forms” (if used as a folder name at the root level of a library)
  • Folder names beginning with a tilde ~ are not allowed in SharePoint

Tips for Renaming Files

  • To rename a file or folder in Windows, select it and press F2.
  • On a Mac, select the item and press the Return key.

Additional Notes

  • Some organizations may still restrict use of # and % in names. Your admin can enable support for these characters if needed.
  • If you're using Office 2010, you can't use & in file or folder names.
  • If you're saving from Office desktop apps and the folder name contains a semicolon (;), saving may fail.

Source: Microsoft Help & Support