I can't figure it out how to sort folders by name in Finder.

My expected results should look like this:


But instead it looks like this:

enter image description here

Here are my settings:


Grouping is turned off.

I think this is a bug. Grouping is turned off everywhere (grouping doesn't change anything here). I've deleted .DS_Store files.

I am running macOS Mojave 10.14.5 (18F132)

Even if I switch to another view, it does not work.

another screenshot

What else could I try to fix this?


I think this is alphabetical vs natural search order being used in Terminal(or wherever the code block comes from) and Finder respectively.

Why is a folder which starts with a 2 on the bottom?

Because it is 27 which is treated as a block while sorting and is greater than other single numbers which are also being treated as blocks. Another example is in the longer screenshot. 5f comes before 06a as 5 is smaller than 06.

Numbers are smaller than alphabets in both cases.

In the code block, we have character-wise sorting where single digits are being compared. So a larger number like 062 sometimes comes before 06a as 2 is smaller than a.

For example, in alphabetical sorting "z11" would be sorted before "z2" because "1" is sorted as smaller than "2", while in natural sorting "z2" is sorted before "z11" because "2" is sorted as smaller than "11".

Alphabetical sorting:



Natural sorting:



Functionality to sort by natural sort order is built into many programming languages and libraries


Mac OS X sorting is based on the Unicode Collation Algorithm (Technical Standard UTS #10) defined by the Unicode Consortium. This standard provides a complete and unambiguous sort ordering for all Unicode characters and is available on the Unicode Consortium website (http://www.unicode.org).

There are no hints that this behaviour can be changed in Finder. It was observed in 2002-03:

| improve this answer | |
  • Comments are not for extended discussion; this conversation has been moved to chat. – bmike Nov 20 '19 at 11:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .