Local Preflight / File name rules
OneDrive and SharePoint file name rules
What Microsoft 365 won't accept in a file or folder name, what happens when you try, and how to rename each case. Checked against Microsoft's documentation on 28 September 2026.
Short answer
- Characters not allowed:
"*:<>?/\| - Names not allowed:
.lock,CON,PRN,AUX,NUL,COM0–COM9,LPT0–LPT9,desktop.ini,_vti_anywhere in a name, and names starting with~$ - Also not allowed: a space at the start or end of a name,
formsas a name at the root of a document library, and゛orဧas the first character of a folder name - Allowed today:
#,%,&,~(not followed by$at the start),{ },[ ], accented and non-Latin letters
Source: Microsoft Support, Restrictions and limitations in OneDrive and SharePoint.
Each rule, with an example and a fix
| Rule | Fails | Rename to |
|---|---|---|
| Invalid characters | Q&A: pricing?.docx | Q&A - pricing.docx |
| Leading or trailing space | Invoices / | Invoices/ |
| Reserved device name | CON, AUX, COM1 | CON_, AUX-files |
| Reserved file name | desktop.ini, .lock | Usually not needed in SharePoint; leave it out |
_vti_ in the name | site_vti_backup.zip | site-vti-backup.zip |
Starts with ~$ | ~$Budget.xlsx | Delete it: it is a leftover Office lock file, not your document |
forms at library root | Shared Documents/forms/ | Shared Documents/Forms archive/ (fine inside any sub-folder) |
| Case-only duplicates in one folder | Report.pdf and report.pdf | Report.pdf and Report (2).pdf |
Two problems most lists miss
Case-only duplicates
SharePoint and OneDrive treat Report.pdf and report.pdf as the same name. Windows does too, so this rarely appears on a Windows file server. It does appear on Linux-based NAS devices, in some Dropbox and Google Drive exports, and on Macs formatted as case-sensitive. The second file either fails or quietly becomes a conflict copy.
Invisible characters
A Mac folder with a custom icon contains a hidden file called Icon followed by a carriage return. Copy-pasted names can also carry control characters you can't see. Neither can be stored in SharePoint, and the error message doesn't show the character, so they are hard to track down by hand.
Warnings that aren't hard blocks
- Device names with an extension such as
aux.txtorcon.log. SharePoint may store them, but Windows can't create them, so they break for colleagues who sync the library to a Windows PC. - Names ending with a period such as
Final.. Windows drops the trailing period, which can cause sync conflicts. - Very long paths. These are covered separately in SharePoint and OneDrive path length limits.
Outdated advice to ignore
Older guides say # and % are not allowed, or that names can't start with a tilde. Microsoft added support for # and % years ago, and the current restriction only covers names starting with ~$. Renaming files unnecessarily breaks links in other documents, so only rename what is actually blocked.
Find all of them before you move the folder
Checking names one by one doesn't scale beyond a few hundred files. Local Preflight lists every name above in a folder of any size, with the exact path and a suggested new name. It runs in your browser, doesn't upload anything, and works on Mac and Windows.
Last reviewed 28 September 2026. If Microsoft changes these rules, this page and the checker are updated together.