Certain characters and names cause errors when saving, copying or syncing. Following these rules makes files work on Windows, macOS, OneDrive and SharePoint.
Don't use these characters
\ / : * ? " < > |
Also avoid
Spaces at the beginning or end and a period at the end of the name.
Reserved names: CON, PRN, AUX, NUL, COM0–COM9, LPT0–LPT9.
In OneDrive and SharePoint also: names starting with ~$, containing _vti_, or named .lock or desktop.ini.
Length
Single file or folder name: up to 255 characters.
OneDrive and SharePoint: the full path including folders can be up to 400 characters. Avoid deeply nested folders with long names.