/

How to Enable or Disable File Explorer Numerical Sorting in Windows 10 

by Mikhail Blacer, IT Technical Writer
How to Enable or Disable File Explorer Numerical Sorting in Windows 10 blog banner image
How to Enable or Disable File Explorer Numerical Sorting in Windows 10 blog banner image

Try our #1 rated endpoint management platform on G2

NinjaOne dashboard screenshot

Automate the Hardest Parts of IT

Key Points

  • Windows 10 File Explorer uses numerical sorting by default, placing “File 2” before “File 10.” Disabling numerical sorting switches to lexicographical order, placing “File 10” before “File 2.”
  • To disable numerical sorting, set the NoStrCmpLogical DWORD value to 1 under HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer. Set it to 0 or delete it to restore numerical sorting.
  • The Registry change applies system-wide, affecting all users rather than individual folders. Administrator permissions are required to modify this setting; restart your PC after making the change.

Numerical sorting in Windows File Explorer is the default method for organizing files and folder names that include numbers. Names are sorted based on the values of the numbers instead of treating the numbers as characters in a text string. In short, the numbers in file names are interpreted logically so that “File 2” comes before “File 10”.

In some instances, a user might want to disable numerical sorting in File Explorer in Windows 10 to better suit their workflow. In that case, “File 10” would come before “File 2”.

Here’s a guide to enabling and disabling numerical sorting in Windows 10.

How to enable or disable numerical file name sorting in Windows 10 using the Registry Editor

You can edit a specific Registry setting to disable numerical file name sorting on Windows 10 if you have administrator permissions. Here’s how:

  1. Open the Registry Editor. Press the Win + R, type regedit, and press Enter.
  2. Next, navigate to the following path:
    • HKEY_LOCAL_MACHINE > Software > Microsoft > Windows > CurrentVersion > Policies >
  3. Create or modify the DWORD value. If the Explorer key does not exist:
    • Right-click Policies, select New > Key, and name it
  4. In the Explorer key:
    • Right-click the right side of the screen
    • Proceed to New > DWORD (32-bit) Value. Name it NoStrCmpLogical.
  5. After this, set the value to enable or disable numerical sorting. Double-click NoStrCmpLogical and then:
    • To disable numerical sorting (use alphabetical order) in File Explorer, set NoStrCmpLogical to 1.
    • To enable numerical sorting (default behavior), set NoStrCmpLogical to 0 or delete it.
  6. Finally, restart your PC so the changes can take effect.

Troubleshooting common issues with File Explorer’s numerical sorting

Sorting doesn’t change after editing the Registry

If numerical sorting still isn’t working after following the steps above, perform the following:

  1. Make sure the key and value names are correct. The value must be named exactly NoStrCmpLogical. Otherwise, Windows will not recognize it.
  2. Double-check you’re in the correct registry location. The key must be made or modified in this path:
    • HKEY_LOCAL_MACHINE > Software > Microsoft > Windows > CurrentVersion > Policies >
    • It should not be under HKEY_CURRENT_USER or elsewhere. If you need further help, check out how to find Windows Registry keys.
  3. Reboot your computer. Registry changes require a complete reboot to take effect.

I do not have the appropriate administrator permissions

If you do not have administrative privileges, you may be unable to create or modify registry keys under HKEY_LOCAL_MACHINE. You can run regedit as an administrator. If you can’t, secure permissions from your IT administrator.

I cannot find the Explorer key

If you cannot find the Explorer key in HKEY_LOCAL_MACHINE > Software > Microsoft > Windows > CurrentVersion > Policies > Explorer, you will need to create it yourself.

Improve file organization with Windows numerical sorting

Overall, numerical sorting in Windows File Explorer helps show files in a logical and easy-to-read order. It’s the default setting, which makes it simpler to organize sequences. For example, a file named “Text 4” will appear before “Text 10” instead of after it.

However, disabling numerical file name sorting on Windows 10 can benefit specific tasks and workflows. For example, you might need to name and organize your files in strict lexicographic sorting, especially if you handle patch files and vast amounts of images and their earlier versions.

You can easily control this behavior using the Registry Editor. However, be sure to run it as an administrator and that you have the appropriate permissions. Follow the steps above, double-check the registry path and value names, and restart your PC to allow the changes to take effect.

Quick-Start Guide

Regarding NinjaOne’s capabilities, they do provide scripting capabilities that could be used to modify this registry key. You could create a custom script in NinjaOne that uses PowerShell or a .reg file to make this registry change.

FAQs

Numerical sorting, also called natural sorting, orders numbers in file and folder names by their numerical value. For example, “File 2” appears before “File 10.” Windows 10 File Explorer uses this behavior by default when sorting by name.

Open Registry Editor as an administrator and navigate to HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer. Create a DWORD (32-bit) value named NoStrCmpLogical, set it to 1, and restart your PC. File Explorer will then use lexicographical sorting, placing “File 10” before “File 2.”

To re-enable numerical sorting, change NoStrCmpLogical to 0, or delete the value from the Registry key that turns it off. Restart your PC, then sort files by Name in ascending order to see “File 2” before “File 10.”

Check that NoStrCmpLogical is spelled correctly, uses the DWORD (32-bit) type, and is saved under the intended Policies\Explorer key. Confirm its value is 1 to disable numerical sorting or 0 to enable it, then restart your PC. Also, check that File Explorer is sorting by Name rather than by date, size, or type.

No. The NoStrCmpLogical Registry setting does not provide a per-folder option. You can change each folder’s Sort by settings, but those controls do not switch between numerical and lexicographical name sorting.

You might also like

Ready to simplify the hardest parts of IT?