What are the file path length limits?

Applies To
OneDrive for Windows

File path length limits across Windows, macOS, OneDrive, SharePoint, and Office

Different platforms and applications support different maximum path lengths, and exceeding these limits can prevent files from syncing, opening, moving, or being renamed.

This article explains what a file path is, the path length limits across platforms, where you might encounter issues, how to check your path length, and tips for staying within the limits.

What is a file path?

A file path is the full address of a file on your computer or in the cloud. It includes every folder in the hierarchy and the file name with its extension. Every character in the path counts toward the limit, including separators (backslashes on Windows, forward slashes on macOS), spaces, and the file extension.

Windows (File Explorer) -- work or school account
C:\Users\JaneDoe\OneDrive - Contoso\Projects\2026\Q1\Budget_Report_v3.xlsx

Windows (File Explorer) -- personal account
C:\Users\JaneDoe\OneDrive\Projects\2026\Q1\Budget_Report_v3.xlsx

In these examples, the path starts with the drive letter (C:\), includes the user profile folder, the OneDrive sync folder, a nested folder structure, and the file name. Notice that the work or school account path includes the organization name (for example, OneDrive - Contoso), which uses more characters than the personal account folder (OneDrive). This difference means users with work or school accounts have fewer characters available for their file and folder names.

macOS (Finder)
/Users/janedoe/Library/CloudStorage/OneDrive - Contoso/Projects/2026/Q1/Budget_Report_v3.xlsx

On macOS, the path uses forward slashes and typically starts from the root / directory.

OneDrive for the web
Documents/Projects/2026/Q1/Budget_Report_v3.xlsx

In the browser, the path starts from the root of your OneDrive or SharePoint document library. It doesn't include the local sync folder path, which is why cloud paths are often shorter than local paths for the same file.

What are the path length limits across platforms?

The following table summarizes the maximum file path length for each platform. The most restrictive limit you encounter in everyday use is 260 characters on Windows File Explorer and Office desktop apps.

Platform Max path length Details
Windows Office desktop apps (Word, PowerPoint, Excel) 256 characters (260 UTF16 WCHARs) Can't open files whose full path exceeds 260 characters, even if the file is stored locally. Office apps use legacy Win32 APIs that enforce the MAX\_PATH = 260 constant.
Windows file system(default) 260 characters By default, the Windows file system enforces a 260-character maximum path length. This is the limit that most Windows applications, including File Explorer and Office, follow.
Windows File Explorer 260 characters Applies to opening, renaming, and moving files. Individual file or folder names can be up to 255 characters. Even with the Windows long path Group Policy setting enabled, File Explorer doesn't use it.
OneDrive and SharePoint (cloud storage) 400 characters The entire decoded file path, including the file name, can't exceed 400 characters.
Office for the web (Word, Excel, PowerPoint Online) 400 characters Files can be created, renamed, and moved up to this limit in the browser.
OneDrive sync 520 characters The total path is the combination of the local path (up to 400 characters) and the OneDrive root folder (up to 120 characters). Paths exceeding 520 characters show a sync error.
macOS Office desktop apps (Word, PowerPoint, & Excel) 1024 bytes (1024 UTF8-encoded bytes) Path limit measured in UTF-8 bytes, not characters. Files with multi-byte characters (e.g., accents, CJK) may hit the limit sooner than expected.
macOS Finder 1,024 characters Individual file or folder names are limited to 255 characters. Paths with multi-byte Unicode characters could exceed 1,024 bytes at the file system level even if the character count appears to be within the limit.
Windows file system (long path enabled) 32,767 characters To use longer paths, you must enable the LongPathAware Group Policy setting. Even then, each application must individually opt in to support extended-length paths. File Explorer and Office desktop apps don't currently opt in, so enabling the policy alone doesn't change the 260-character limit for most users.
Third-party apps Varies Third-party applications may have their own path length limits independent of the operating system. Check with the app developer if you encounter path-related errors in non-Microsoft software.

Where you might encounter path length issues

Files created online that can't be opened on desktop

You create an Office file in a deeply nested folder in OneDrive on the web. The cloud path is within the 400-character limit. When the file syncs to your PC, the full local path becomes longer because your OneDrive folder adds characters (for example, C:\Users\YourName\OneDrive - Your Organization Name\). If the total exceeds 260 characters, the file won't open in Office desktop apps or rename in File Explorer.

Folders that don't appear on your computer

You create a folder in OneDrive for the web with a name longer than 255 characters. The folder works in the browser, but it won't sync to Windows File Explorer or macOS Finder because both platforms limit individual file and folder names to 255 characters.

OneDrive sync pauses with a "path too long" notification

If a synced file's full path exceeds 520 characters, OneDrive displays a "path is too long" notification and sync client quits until the overlimit item is resolved.

SharePoint shortcuts and synced libraries

When you add a shortcut to OneDrive for a shared SharePoint library or Teams channel folder, the shortcut contents sync to your device under your OneDrive folder. If the shared library has deep nesting or long folder names, the local path can quickly exceed 260 characters -- even if everything works fine in the browser.

Files from migrations

When migrating files from other cloud storage services, the combined folder structure can unexpectedly exceed path limits, especially if the original structure had deep nesting.

"The action can't be completed" error dialog

If you see an error dialog that says, "The action can't be completed because the folder or a file in it is open in another program," it can sometimes indicate that the file path is too long. Despite the message referring to another program, the underlying cause is often that the path exceeds the platform's maximum length. Try shortening the file or folder name or move the file to a location closer to the root of your drive.

Office temporary files fail even under 260 characters

Office desktop apps create temporary lock files (for example, ~$Budget_Report_v3.xlsx) by appending characters to the original file path. If your file path is close to 260 characters, these derived paths can exceed the limit and cause errors when saving or opening.

How to check your file path length

On Windows

  1. Open File Explorer and navigate to the file.

  2. Select the address bar to display the full path.

  3. Copy the path, paste it into a text editor, and check the character count.

    Tip

    You can also right-click the file, select Properties, and look at the Location field. Add the file name length to the folder path length for the total.

    You can also use PowerShell to check the path length of a specific file:
    ("C:\Users\JaneDoe\OneDrive - Contoso\Projects\2026\Q1\Budget_Report_v3.xlsx").Length

    Or find all files with paths exceeding 260 characters in a directory:
    Get-ChildItem -Path "C:\Users\JaneDoe\OneDrive - Contoso" -Recurse | Where-Object { $_.FullName.Length -gt 260 } | Select-Object FullName, @{Name="PathLength";Expression={$_.FullName.Length}} | fl

On macOS

  1. Right-click (or Control-click) the file in Finder and select Get Info.
  2. The Where field shows the full folder path. Add the file name length for the total. You can also use Terminal to check the path length:
    echo -n "/Users/janedoe/Library/CloudStorage/OneDrive-Contoso/Projects/file.xlsx" | wc -c

On OneDrive for the web

  1. Navigate to the file in your browser.

  2. The breadcrumb trail and URL reflect the file path. Note that special characters are URL-encoded and count toward the 400-character limit.

    Note

    Special characters, spaces, and accented characters in file and folder names are URL-encoded in SharePoint (for example, a space becomes %20). These encoded forms count toward the 400-character limit, so a path that appears short in the browser might use more characters than expected.

Tips for working within path length limits

Use shorter file and folder names

Shorter names leave more room in the path for folder depth. For example:

  • "QBR Notes - Jan 2026" instead of "Quarterly Business Review Meeting Notes - January 2026"
  • "Eng & Tech" instead of "Department of Engineering and Technology"

Keep folder structures shallow

Each level of nesting adds characters to the path. Instead of deeply nested folders like Projects > 2026 > Q1 > Client Work > Contoso > Deliverables > Final > Approved, consider a flatter structure like Projects > 2026-Q1 Contoso > Final Deliverables.

Keep shortcuts to shared libraries manageable

Before adding a shortcut to a shared SharePoint library or Teams channel folder, check how deeply nested the library's folder structure is. If the library already has long paths, consider syncing only a subfolder rather than the entire library, or ask the library owner to flatten the structure. You can also rename the shortcut in OneDrive after adding it to use a shorter name.

Rename from the web when needed

If a file or folder has a path that's too long to work with in File Explorer, go to the OneDrive website or your SharePoint site and rename it there. Once the path is short enough, the file syncs to your desktop normally.

Place frequently used files closer to the root

Files stored closer to the top of your OneDrive folder have shorter paths. Consider keeping your most-used files in a folder structure that is only one or two levels deep.

Be aware of your OneDrive root folder length

Your OneDrive sync folder path (for example, C:\Users\YourName\OneDrive - Organization Name) uses characters before your file path even begins. A longer organization name means fewer characters are available for your files and folders. IT admins can shorten this folder name for their organization by using the Set a custom name for the OneDrive folder Group Policy.

Use OneDrive Files On-Demand

With OneDrive Files On-Demand, you can browse all your OneDrive files in File Explorer without downloading them to your device. When you need to work with a file that has a long path, open it in the browser where the 400-character limit applies instead of the 260-character desktop limit. Learn more about Files on Demand.

Check OneDrive sync notifications

When OneDrive encounters a path that's too long, it shows a notification. Select the OneDrive icon in the system tray (Windows) or menu bar (macOS) to see which files are affected so you can decide how to reorganize.

See also

Fix paths that are too long to sync in OneDrive

Restrictions and limitations in OneDrive and SharePoint

SharePoint Online limits

Maximum file path limitation (Windows)

Save disk space with OneDrive Files On-Demand

Need more help?

Account support. For help with your Microsoft account and subscriptions, visit Account & Billing Help.

Technical support. For technical support, select Contact Microsoft Support below, enter your problem and select Get Help.

Mobile users can contact Support by opening the OneDrive app and gently shaking your device.

Community support. Communities help you ask questions, give feedback, and hear from experts with rich knowledge. Ask the Microsoft Community. Do not disclose personal or sensitive information in public forums.