What are the Limits on File Names?

Written by Barry Dysert (last updated August 26, 2019)

Believe it or not, file name limits aren't all that easy to come by. The reason it's difficult is because you have limits imposed by NTFS itself, limits imposed by the Windows operating system, and limits imposed by the application dealing with the files (e.g., Windows Explorer or File Explorer).

Experimentation reveals that for a file created at "C:\", you can create a file name with at most 255 characters. If you were to try to create a file with a longer path (e.g., "C:\Documents"), the length of the file name would have to be reduced accordingly. This implies that in addition to the length of the actual file name, you also have to deal with the name of the path, which, according to Microsoft, is set at 260 characters for local files.

File names can use any character in the current code page, including Unicode characters and characters in the extended character set (128–255), except for the following:

  • < (less than)
  • > (greater than)
  • : (colon)
  • " (double quote)
  • / (forward slash)
  • \ (backslash)
  • | (vertical bar or pipe)
  • ? (question mark)
  • * (asterisk)
  • Integer value zero, sometimes referred to as the ASCII NUL character
  • Characters whose integer representations are in the range from 1 through 31

 This tip (5835) applies to Windows 7, 8, and 10.

Author Bio

Barry Dysert

Barry has been a computer professional for over 35 years, working in different positions such as technical team leader, project manager, and software developer. He is currently a software engineer with an emphasis on developing custom applications under Microsoft Windows. When not working with Windows or writing Tips, Barry is an amateur writer. His first non-fiction book is titled "A Chronological Commentary of Revelation." ...

MORE FROM BARRY

Using Batch Files, Part 1

This tip is part of a series that shows you how to create and use Windows batch files. It introduces a few commands and ...

Discover More

What is the Purpose of the Forwarded Events Event Log?

The Forwarded Events event log collects events that have been forwarded from other computers. In this way you can login ...

Discover More

Using Powercfg to Change the Name of a Power Scheme

The Powercfg utility allows you to control how power is used on your system. This tip shows you how to use the ...

Discover More
More WindowsTips

Removing a File Type Program Association

Removing a file type program association is a task for third-party utilities. You can, however, change the association ...

Discover More

Using the DiskPart Utility

The DiskPart utility is a low-level command-line program that lets you manage disks, virtual disks, partitions, and ...

Discover More

Configuring Windows to Do Backups on a Schedule

Performing regular backups of your system offers you peace of mind because you don't have to worry about data loss in the ...

Discover More
Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is nine minus 1?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


Newest Tips