How to Disable Numerical File Name Sorting and Enable Classic Literal Sorting in Windows Explorer?

If you are a Windows XP or later OS user, you might have noticed that Windows Explorer uses a different kind of sorting mechanism for file names containing numbers compared to Windows 2000 and earlier versions.

For example, if you have a folder containing files having names as 1, 246, 3, 111, 22, 33 and 2, Windows XP and later will sort them as following:

1
2
3
22
33
111
246

Advertisement

On the other hand, Windows 2000 and earlier versions will sort them as following:

1
111
2
22
246
3
33

Noticed the difference? Windows XP and later use an intelligent mechanism for file names sorting and show the file names having numbers in increasing number values. On the other hand, Windows 2000 and earlier versions sort file names by each number in file names.

Although Windows XP and later sorting mechanism looks better than the previous sorting mechanism but sometimes it becomes a little bit annoying when you don’t want Windows to sort file names by number values, you just want Windows to sort file names by numbers so that you can get file names starting with same digit in a single place rather than showing in different places.

Actually the new Windows file name sorting mechanism is known as “Intuitive or Numerical” where file names are sorted by increasing number values. On the other hand Windows 2000 and earlier versions file name sorting is called “Literal” where file names are sorted by each digit in file name.

In this tutorial, we’ll tell you a way to disable new intuitive file name sorting and enable classic literal file name sorting in Windows XP and later.

Windows_Filename_Sorting_Order_Comparison.png

Advertisement

So without wasting time, lets start the tutorial. We’ll tell you 2 methods to do this task:

  • METHOD 1: Using Group Policy Editor
  • METHOD 2: Using Registry Editor

METHOD 1: Using Group Policy Editor (gpedit.msc)

1. Type gpedit.msc in Start Menu search box or RUN dialog box and press Enter. It’ll open Group Policy Editor.

2. Now go to:

Computer Configuration -> Administrative Templates -> Windows Components -> Windows Explorer

3. In right-side pane, double-click on “Turn off numerical sorting in Windows Explorer” and set its value to Enabled.

Disable_New_Intuitive_Filename_Sorting_in_Windows_Using_GPEdit.png

4. That’s it. It’ll immediately disable new intuitive file name sorting and bring back classic literal file name sorting in your Windows.

PS: If you want to restore default file name sorting, simply set value of “Turn off numerical sorting in Windows Explorer” to either Not Configured or Disabled.

METHOD 2: Using Registry Editor (regedit)

Some Windows editions such as Home Basic, Home Premium and Starter don’t come with Group Policy Editor. If you can’t use Group Policy Editor, here is a Registry method given to do the same thing:

1. Type regedit in Start Menu search box or RUN dialog box and press Enter. It’ll open Registry Editor.

2. Now go to following key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer

If you don’t see “Explorer” key under Policies key, create it manually.

3. Now in right-side pane, create a new DWORD NoStrCmpLogical and set its value to 1

Disable_New_Intuitive_Filename_Sorting_in_Windows_Using_Regedit.png

4. That’s it. Restart or log off and you’ll get Windows 2000 style classic literal file name sorting back in Windows XP and later.

PS: If you want to restore default file name sorting, simply set value of “NoStrCmpLogical” to 0 or delete the DWORD.

NOTE: If you don’t want to modify Registry manually and want a ready-made Registry script to do the task automatically, download following ZIP file, extract it and run the extracted REG file. It’ll ask for confirmation, accept it:

Download Registry Script

The ZIP file also contains another registry script to restore default sorting mechanism.

Feel free to share your feedback about this trick in your comment. Did you know it before?

Published in: Troubleshooting Guides, Windows 7, Windows Vista, Windows XP

About the author: Vishal Gupta (also known as VG) has been awarded with Microsoft MVP (Most Valuable Professional) award. He holds Masters degree in Computer Applications (MCA). He has written several tech articles for popular newspapers and magazines and has also appeared in tech shows on various TV channels.

Comments

NOTE: Older comments have been removed to reduce database overhead.

  1. Another awesome fix! I’ve always hated that numerical sort but didn’t know you could turn it off. Thanks!

  2. @ VG , I have a tip for you ! I read the whole article , and then realized there was a ready made registry script for doing so ! You should actually put the download link for the registry script at the top of the article , not at the bottom 😛

  3. I just had to replace an old WinXP computer on which I had made the registry change to go back to the old literal sorting rule, but couldn’t remember how to do that when I found this article. It was perfect and allowed me to bring back my familiar literal sorting rule on my new Dell Win7 machine. Thank you so much!

  4. For Windows 8, the name changed from Windows Explorer to File Explorer, which also affects the gpedit.msc settings.

  5. How about windows 10.

    would you please give some instruction to do so in windows 10 Home edition.

    Windows cannot find gpedit.msc ( content.screencast.com/users/KambizBehjati/folders/Snagit/media/3a90abe2-b373-4734-b446-a39be05a5c36/12.14.2015-15.26.png )

    also NoStrCmpLogical is not exist at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer

    Thank you

  6. ^^ Its already mentioned in the tutorial that gpedit.msc is not a part of Home editions. Thats why you need to create the DWORD manually in Registry Editor. If you are not familiar with Registry Editing, try the automatic Registry script given at the end of the topic.

  7. In Windows 10 Pro, I was able to run gpedit.msc to open the Local Group Policy Editor. And just like Sebastian Helm noted for Windows 8, in Windows 10 the option in the registry is under “File Explorer” instead of “Windows Explorer.”

    So you navigate in the Local Group Policy Editor to:
    Computer Configuration -> Administrative Templates -> Windows Components -> File Explorer -> Turn off numerical sorting in File Explorer

  8. this isn’t the real issue for me. I would rather see numbered files sorted in intuitive format. The issue is if I have a file A5GHT.txt and a file ABGHT.txt the later comes BEFORE the former. If I change it to literal then 5 comes before B and everything looks good EXCEPT that now 111 comes b4 2.
    So how do I win the battle and make 2 come b4 111 AND 5 come b4 B?

  9. Hi. I have W10 home edition, and adding NoStrCmpLogical made no difference. Do I have to create it somewhere else? Also, when creating it, I have to choose between hexadecimal and decimal; which is it, and do I write 1 in hex/decimal, accordingly? Thanks for answering, if someone still is…

  10. Hi,

    many thanks for the above information – very useful.

    I have a question – is it possible to sort a set of folders (default intutive file sortig) but after ignoring the first four alpha numeric characters? For example i have folders as under:

    0345.super
    0346.alpha
    0347.krypton
    0348.asc
    0349.br bio
    0350.super
    0351.asc

    The default sorting would place them the way they are shown above, which I do require. However, I also have a requirement to have these sorted out after ignoring the first (in this case 4) characters, which would then sort as under:

    0346.alpha
    0348.asc
    0351.asc
    0349.br bio
    0347.krypton
    0345.super
    0350.super

    many thanks!

  11. ^^ There is no Registry tweak or built-in feature to do that but may be some 3rd party software allow you to do this?

  12. I have a similar problem with the sorting order – I tried the regedit tip, and it did indeed work as far as NUMERICAL sorting goes.. However my problem (as I am from Denmark, and use a danish Windows version) has to do with the special characters Æ, Ø, and Ã… that are included in the danish alphabet.. – Explorer sort them correctly (alphabetically), but seem to also have included the letter-combination “AA” that has traditionally been used in place of Ã…, when using non-danish keyboards, so that files are sorted as follows:

    example_a.txt
    example_b.txt

    example z.txt
    example å.txt
    example aa.txt

    (It’ll sort it that way in the cases “aa”, “AA”, and “Aa” – but not in the case “aA”)

    Placing æ, ø, and Ã¥ after z is just fine, but does anyone know if and how the “aa” letter-combination can be omitted, since I would like to be able to use alphanumerical strings as prefix to my mp3 files to set the sorting order. But of course it ought to be the same order on my android mobile as in the windows folder.. – And besides, putting “aa” after “z” is just plain silly.

  13. And by the way: Similarly the dash character; “-” at the beginning of the filename is treated as “to-be-ignored”, so that the file is sorted according to the next character after the dash – rather than being sorted among the special characters, alongside the underscore character.. The regedit-tip doesn’t do away with that either.. Any tips for howto get rid of that too?

  14. I have Windows 10. I have been fighting with that so called intelligent “Intuitive or Numerical” sort for over a year. I just found this website.
    I first created a System Restore point.
    I followed your “METHOD 2: Using Registry Editor (regedit)” instructions and then did a restart.
    The Classic Literal Sort is back and it works just the way a true sort should.

    Thank you, Rob

  15. No one has addressed the file renaming route. That may allow you to negotiate the sort order mess, which has frustrated me for quite a while now. I was very glad to find this website. (The dash (hyphen) issue still bites me once in a while. Renaming files is the only cure for that that I have found.)
    Thanks for the tips!
    RAW

  16. Thank you thank you thank you, a thousand times thank you!

    For over two years have been battling with the broken alpha-numeric file sorting in Windows 10. I used method #2, (regedit), Your bug fix works perfectly. Windows 10 just got a whole lot better (but it’s still not a patch on Win2k).

  17. Thank you for this fix. Just another example of the idiocy from Microsoft coders who think that sorting method is ‘Intuitive’ at all.

    If I am searching files with names like ‘989489534’ and ‘1844894435’ it is sheer stupidity to list the one starting with the nine BEFORE the file starting with a one just because the first file name has one less digit than the first.

    Using that logic a file named ‘Zebra’ should be listed before ‘Aardvark’ because ‘Zebra’ has less letters.

    But I guess the brain-dead morons at Microsoft expect people to count every letter in file names.

  18. Thank you – has made my life keeping 50,000+ numerically-named files in their correct directories a lot easier!

  19. Using Windows Xp, I had to re-install it and installed it upon a drive which already had a (non-working) version.

    I ended up with two files for WINDOWS on the disk. The two folders are WINDOWS and WINDOWS0.

    Which folder can I remove which has the working Windows?

    An e-mail answer would be good, otherwise forget it.

    This is a serious request.

    Peter K. Sharpen

  20. ^^ Run disk cleanup and it should detect the previous Windows installation files. It’ll provide you an option to remove them.

  21. Thank you for this article.
    You might hint at (or link to) whether the other “intuitive” sorting quirks like spaces & punctuation are or are not affected by this toggle setting. Also, mention the relevance of Ms Word or Office sorting, which I suspect I will soon be discovering for myself.

    PS: to keep track of the effect rather than the “reason” for these .REGs, I named them Set Literal Sorting.reg & Set Numeral Sorting.reg

Leave a Comment

Your email address will not be published. Required fields are marked *

NOTE: Your comment may not appear immediately. It'll become visible once we approve it.