OneDrive refuses to sync a file and the error reads "we can't sync this item because the path is too long" — or some variation. The cause is the same one Windows has had for decades: a file path over 260 characters. This guide covers four ways to fix it, ordered from quickest to most thorough, so you can pick the right one based on how many files are affected.
OneDrive doesn't introduce a new path length limit — it inherits whichever is stricter between Windows and the OneDrive backend. There are three layers in play:
Windows MAX_PATH (260 characters) — the legacy limit on the full absolute path of any file. By default Windows enforces this for all standard file operations, which means OneDrive can't even read a file whose path is over the limit.
OneDrive's local sync engine — independently rejects any item it considers too deep, even if Windows long paths are enabled. This is a sync-layer check, not a Windows-API check.
OneDrive for Business / SharePoint backend (400 characters) — the URL limit applied server-side once a file uploads. A file fine under the local 260-char limit can still be rejected at the cloud if the resulting URL — including the tenant prefix — exceeds 400 characters.
The default OneDrive folder path doesn't help: C:\Users\YourName\OneDrive\ is already 25-plus characters before any of your files exist. Add a synced SharePoint library, then a few nested project folders with descriptive names, and you cross 260 fast.
If you see any of these, you're hitting the same root cause:
"We can't sync this item because the path is too long"
"OneDrive can't sync this file. The path is too long. Try moving the file closer to the root of your OneDrive."
"Sync error: file or folder name is too long"
"Path too long: this item could not be synced"
"The file name(s) would be too long for the destination folder" (when copying into a OneDrive-synced folder)
OneDrive's recommended fix in its own dialog — "move the file closer to the root" — works for one or two files but doesn't scale. The four methods below do.
By default, OneDrive lives at C:\Users\YourName\OneDrive\. Moving it to C:\OneDrive\ shaves about 20 characters off every path inside — often enough to clear all but the worst offenders.
Right-click the OneDrive cloud icon in the system tray and choose Settings.
Open the Account tab and click Unlink this PC. Confirm. Local files stay in place.
Sign back in. When OneDrive prompts for a folder location, click Change location and choose a short path like C:\OneDrive\.
Wait for OneDrive to re-index. Files that previously failed often start syncing automatically.
Watch for: the new folder must not already exist with content, and you'll need enough free space for OneDrive to verify each file before it considers the location healthy.
Windows 10 (1607+) and Windows 11 ship with a setting that lets the Windows API handle paths up to 32,767 characters. Turning it on helps Windows-aware applications reach files past the 260 limit — useful when you need to access the file to fix it, even if OneDrive itself still won't sync it.
Press Win + R, type regedit, press Enter.
Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem.
Find LongPathsEnabled, double-click, change the value from 0 to 1, click OK.
Restart Windows for the change to take effect.
Important: this does not fix OneDrive directly. OneDrive enforces its own path-length checks at the sync layer, independent of the Windows API. Enabling long paths makes it easier for tools like LPFE, Explorer, and PowerShell to reach the affected files so you can rename them — but it won't make OneDrive itself accept a 270-character path.
For a handful of problem paths, the most direct fix is to find each one and rename it down. OneDrive surfaces the offenders in its sync activity panel, so you don't have to search blindly.
Click the OneDrive cloud icon, then View sync problems. Each entry lists the file path and the reason.
For each item, identify the shallowest folder you can rename to gain the most characters back. Renaming a parent shortens every child path inside it simultaneously.
Rename in Explorer using shorter, descriptive names. Aim to drop the total path well under 260 characters — leave some headroom for files that may move or be added later.
Wait for OneDrive to retry the sync. Items typically clear within a minute of the rename.
Limitation: manual renames are practical for 5 or 10 paths. Past that — especially on synced SharePoint libraries with hundreds of historical paths — you need bulk tooling.
Long Path File Editor (LPFE) was built specifically for this scenario. Point it at your OneDrive folder, let it scan recursively, and apply rule-based renames across every offender — with a live before-and-after preview before any change touches the disk.
Add your OneDrive folder. Click "Add Folder" and select your OneDrive root (C:\Users\You\OneDrive\ or wherever you've placed it). LPFE walks the entire tree and flags every path over 260 characters.
Set rules. Toggle "Remove Spaces," "Remove Brackets," or load a Find/Replace text file to swap long phrases (e.g. "Department of Justice" → "DOJ") across every path automatically.
Preview. The "Proposed Path" column updates live as you adjust rules — confirm each rename before anything is committed.
Commit. LPFE renames shallowest-first (parent folders before children, automatically) and writes a CSV log of every change. Undo is available if anything looks wrong.
Let OneDrive resume. Once the renames are done, OneDrive picks up the new paths and starts syncing. The path-too-long errors clear themselves.
Tip: pause OneDrive sync (cloud icon → "Pause syncing") before running LPFE on a large batch. This prevents OneDrive from trying to re-sync files mid-rename, which can produce duplicate sync errors that resolve themselves but look noisy.
Free trial includes all 9 rules, capped at 25 entries. Full version is $49 one-time — no subscription, ever.
Download Free →| Method | Fixes existing paths? | Admin required? | Works at scale? | Best for |
|---|---|---|---|---|
| Move OneDrive folder | Indirect — shortens roots | No | Partial | Quick win for any user |
| Registry / Group Policy | No | Yes | Partial | Helping Windows reach affected files |
| Manual rename | Yes | No | No — very slow | 1–10 problem files |
| LPFE bulk rename | Yes | No | Yes — full OneDrive folder | Hundreds of files, SharePoint libraries, IT cleanup |
OneDrive personal respects the Windows 260-character limit. OneDrive for Business — backed by SharePoint — enforces a 400-character total URL limit and a 256-character per-segment limit. A path that's fine locally can still be rejected on upload to OneDrive for Business if the resulting SharePoint URL exceeds 400 characters once the tenant URL prefix is added.
The Windows LongPathsEnabled setting only changes how Windows-aware applications can read and write files locally. OneDrive enforces its own checks at the sync layer and on the server side. Long paths in Windows make the affected files reachable so you can rename them — but they don't make OneDrive itself accept paths over its limits.
The fastest path: right-click the OneDrive cloud icon, open Settings, and review the sync activity panel — every flagged item lists the file path and the reason. For a complete inventory across the entire OneDrive folder, point LPFE at the OneDrive root and let it scan. It lists every path over 260 characters in one pass and lets you rename them in bulk.
Yes. Right-click the OneDrive cloud icon, open Settings, go to the Account tab, and click Unlink this PC. Then sign in again and choose a shorter folder location during setup — for example, C:\OneDrive\ instead of the default location under your user profile. Files re-sync automatically once the new location is set.
Yes, and the limits are stricter. OneDrive for Business is backed by SharePoint, which enforces a 400-character total URL limit and a 256-character per-segment limit. A path that fits comfortably under the Windows 260-character limit can still be rejected on upload because the resulting SharePoint URL exceeds 400 characters once the tenant URL prefix is added.
OneDrive treats a rename as a move within the same library, so version history is preserved on the renamed item. Only the path changes — the file content, modified date, and version stack stay attached. As with any bulk operation on synced data, pausing OneDrive sync during the rename and verifying a small batch first is a reasonable precaution.