Resolving SharePoint “Invalid File Name” Character Errors (2025)

An “Invalid File Name” error in SharePoint Online, Microsoft Teams, or OneDrive occurs when a file or folder contains unsupported characters, illegal prefixes, or reserved system terms. When this happens, SharePoint blocks the upload, halts folder synchronization, and flags the file with a red sync badge or a rejection banner in your browser.

Fast Fix

Strip special characters from the file name, specifically < > : " / \ | ? *, and remove any spaces or periods from the very beginning or very end of the name. If the file name begins with ~$ or contains reserved system words like CON, PRN, or AUX, rename the file completely before uploading.


Diagnostic Snapshot

CategoryForbidden Elements
Illegal Characters`~ ” # % * : < > ? / \ {
Position-Specific RulesNo leading spaces, no trailing spaces, no trailing periods (.)
Reserved File NamesCON, PRN, AUX, NUL, COM0–COM9, LPT0–LPT9, _vti_, desktop.ini
Path LimitTotal decoded URL path length must remain under 400 characters

Why Invalid Character Rules Exist

Modern SharePoint Online is built on cloud-native web storage, but it constantly synchronizes with Windows File Explorer, macOS Finder, and legacy web protocols.

Windows and web file systems have conflicting rules:

  • The Web vs. Windows Collision: In standard web environments, characters like / and ? are reserved for URL routing and query parameters. In Windows File Explorer, characters like :, , and " are reserved for operating system operations and drive delimiters. To prevent local sync engines from crashing, SharePoint blocks these characters everywhere.
  • Modern vs. Legacy SharePoint Handling: Modern SharePoint Online natively supports # and % characters. However, if your company uses third-party backup tools, specialized web parts, or connects via older WebDAV interfaces, those symbols can still trigger file-name rejection errors.
  • Trailing Characters: A period or space at the end of a file name (e.g., Report .docx or Summary..docx) cannot be indexed cleanly by local Windows file systems and is rejected during the cloud-to-desktop synchronization pass.

If file synchronization is freezing on long folder structures, your issue may be total character count rather than a single letter; see How to Fix “File Path Too Long” in deep SharePoint Silos.


Action Steps to Correct the Errors

1. Rename the File Following Cloud-Safe Rules

Rename the problem file on your local drive using standard alphanumeric characters, underscores, or simple hyphens.

[Invalid Name]   "Q3/Q4_Sales:Final Report?.xlsx."
                        │
                        ▼  (Remove: quotes, slashes, colons, question marks, trailing period)
[Safe Name]      "Q3-Q4_Sales_Final Report.xlsx"
  • Remove Forbidden Characters: Ensure none of the following appear anywhere in the name: < > : " / \ | ? *
  • Fix Trailing and Leading Characters: Look at the beginning and end of the file name.
    • Incorrect: Budget2025.xlsx (leading space)
    • Incorrect: Budget2025.xlsx (trailing space)
    • Incorrect: Budget2025..xlsx (period before extension)
  • Check Hidden Extensions: In Windows File Explorer, select View > Show > File name extensions. Make sure a hidden character was not accidentally introduced into the file extension itself.

2. Remove Temporary Office Lock Files

If a file name starts with ~$ (for example, ~$StrategyDeck.pptx), you are looking at a hidden temporary lock file created automatically by Microsoft Office while a document is open.

  • These files should never be manually uploaded to SharePoint or Teams.
  • If you see this file in a local synchronized folder, save and close the actual document in Word, Excel, or PowerPoint. The ~$ file will automatically disappear.
  • If the file remains behind after closing Office, the application process crashed. End the process via Task Manager and delete the orphan ~$ file manually.

3. Rename Reserved Operating System Names

SharePoint Online enforces legacy MS-DOS device naming restrictions to guarantee that files synced down to Windows machines will not compromise system stability.

The following names cannot be used as the base name of a file or folder, regardless of extension:

CON, PRN, AUX, NUL
COM0, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9
LPT0, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, LPT9
  • Example failure: An uploaded file named AUX.docx or com1.txt will be rejected by SharePoint immediately. Change the name to something descriptive, such as Auxiliary_Notes.docx.
  • Do not start folder names with _vti_, as this string is reserved by SharePoint internal services.

4. Address Synchronizer Rejection

If the file uploads cleanly via your web browser at sharepoint.com but throws an invalid name error on your desktop, your local OneDrive sync app is rejecting the file.

  1. Hover your mouse over the OneDrive icon in the Windows taskbar system tray.
  2. Click the error message: “One or more files have an issue.”
  3. OneDrive will list the exact offending file and frequently offer an automated Rename button.
  4. Click Rename to let OneDrive automatically adjust characters or strip illegal spaces.

If your sync client continues reporting errors on validly named files, cross-reference Resolving “File Name is Too Long” OneDrive Sync Failures to check if character encoding length is the true underlying cause.


Hidden Problem: URL Encoding Bloat

A file name might have only 50 characters, but once uploaded, it can still trigger path and character errors.

When you use characters like spaces, commas, or regional symbols, SharePoint converts them into URL-encoded equivalents:

  • A space becomes %20 (3 characters)
  • Special symbols can expand into %C3%A9 (6 characters)

If a file is nested five levels deep inside SharePoint folders, that expansion can push an otherwise valid file over the 400-character URL threshold. If your users frequently encounter naming errors on nested documents, simplify folder structures and use standard dashes instead of spaces.