Local Preflight

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

Source: Microsoft Support, Restrictions and limitations in OneDrive and SharePoint.

Each rule, with an example and a fix

RuleFailsRename to
Invalid charactersQ&A: pricing?.docxQ&A - pricing.docx
Leading or trailing spaceInvoices /Invoices/
Reserved device nameCON, AUX, COM1CON_, AUX-files
Reserved file namedesktop.ini, .lockUsually not needed in SharePoint; leave it out
_vti_ in the namesite_vti_backup.zipsite-vti-backup.zip
Starts with ~$~$Budget.xlsxDelete it: it is a leftover Office lock file, not your document
forms at library rootShared Documents/forms/Shared Documents/Forms archive/ (fine inside any sub-folder)
Case-only duplicates in one folderReport.pdf and report.pdfReport.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

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.

Check a folder (free)See a sample report

Last reviewed 28 September 2026. If Microsoft changes these rules, this page and the checker are updated together.