# Use natural sorting

**URL:** <https://community.mp3tag.de/t/use-natural-sorting/50751>\
**Category:** Support\
**Created:** [November 10, 2020, 12:43pm UTC](https://community.mp3tag.de/t/use-natural-sorting/50751 "2020-11-10T12:43:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mville](https://community.mp3tag.de/user_avatar/community.mp3tag.de/mville/32/9437_2.png) [@mville](https://community.mp3tag.de/u/mville)\
**Post date:** [November 10, 2020, 12:43pm UTC](https://community.mp3tag.de/t/use-natural-sorting/50751/1 "2020-11-10T12:43:33Z")

</div>

I have the _Use natural sorting_ option enabled, hoping to emulate the numerical sorting default found in Windows 10 File Explorer.

However, when I sort by %\_folderpath% the results are not as expected.

e.g. in File Explorer, sorting 3 folders appears as expected:  
Help!  
Help! (Original Motion Picture Soundtrack) [2014 US Remaster]  
Help! [2009 Remaster]

in MP3Tag the sort order is different:  
Help! (Original Motion Picture Soundtrack) [2014 US Remaster]  
Help! [2009 Remaster]  
Help!

I'm not sure if this is a bug. Please can anyone advise further?

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [November 10, 2020, 12:54pm UTC](https://community.mp3tag.de/t/use-natural-sorting/50751/2 "2020-11-10T12:54:40Z")

</div>

I think that the natural sorting means that the case of a letter is ignored and certain internal characters like the apostrophe also.  
In respect to the folder ... I can only suspect that "Help!" is not just "Help!" but actually "Help!" - and the backslash is further down the character code table than the space character in

> [@mville](#):
>
> Help! (Original

Here is an example if you sort by the full path:  
 ![sorting](https://community.mp3tag.de/uploads/default/original/2X/9/9f160a24a3278274a32a1998d84fd1b1d5388469.jpeg)  
The solo "Notorious" comes after the "Latin Rascal Mix"

---

<div class="post-metadata">

**Author:** ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)\
**Post date:** [November 10, 2020, 1:16pm UTC](https://community.mp3tag.de/t/use-natural-sorting/50751/3 "2020-11-10T13:16:34Z")

</div>

According to Wikipedia the "natural sort order" is an ordering of strings in alphabetical order, except that multi-digit numbers are treated atomically.

There is no hint about the sort order of special charaters like `[` or `]` or `(` or `)` or others

> **[Natural sort order](https://en.wikipedia.org/wiki/Natural_sort_order)**
>
> Natural sort order is an ordering of strings in alphabetical order, except that multi-digit numbers are treated atomically, i.e., as if they were a single character. Natural sort order has been promoted as being more human-friendly ("natural") than the machine-oriented pure alphabetical order.
> 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 ...

The natural sort order helps to sort strings like

```
Title1
Title2
Title3
Title11
Title12

```

more human-friendly.

~~I don't see any logical reason to prefer a `(` before a `[`~~

BTW: I found this interesting answer on [superuser.com](http://superuser.com)

> <https://superuser.com/questions/681322/windows-explorer-sorting-order-for-special-characters>

---

<div class="post-metadata">

**Author:** ![mville](https://community.mp3tag.de/user_avatar/community.mp3tag.de/mville/32/9437_2.png) [@mville](https://community.mp3tag.de/u/mville)\
**Post date:** [November 10, 2020, 1:26pm UTC](https://community.mp3tag.de/t/use-natural-sorting/50751/4 "2020-11-10T13:26:41Z")

</div>

> [@ohrenkino](#):
>
> In respect to the folder ...  
> the backslash is further down the character code table than the space character

Correct. Backslash at the end of folders is the problem here.

Replacing backslash with $char(32):  
e.g. $left(%\_folderpath%,$sub($len(%\_folderpath%),1))$char(32)  
or $regexp(%\_folderpath%,^(.+)\x5c$,$1 )

provides the expected sort order, but slows down the sort. Surely, this can be done by the internal code, if the _Use natural sort_ option is enabled?

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [November 10, 2020, 5:55pm UTC](https://community.mp3tag.de/t/use-natural-sorting/50751/5 "2020-11-10T17:55:21Z")

</div>

You could use the property "Sort by" in the column definition and sort by a string that got removed all the common path separators:  
`$replace(%_folderpath%,/,, ,,_,,:,,\,)`

---

<div class="post-metadata">

**Author:** ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)\
**Post date:** [February 9, 2026, 12:28pm UTC](https://community.mp3tag.de/t/use-natural-sorting/50751/6 "2026-02-09T12:28:55Z")

</div>


