# Another sort observation

**URL:** https://discourse.joplinapp.org/t/another-sort-observation/49832
**Category:** Support
**Created:** [11 May 2026 20:48 UTC](https://discourse.joplinapp.org/t/another-sort-observation/49832 "2026-05-11T20:48:57Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![jslawrence](https://avatars.discourse-cdn.com/v4/letter/j/cdc98d/32.png) [@jslawrence](https://discourse.joplinapp.org/u/jslawrence)
#### Post date: [11 May 2026 20:48 UTC](https://discourse.joplinapp.org/t/another-sort-observation/49832/1 "2026-05-11T20:48:57Z")

</div>

### Operating system

Linux

### Joplin version

3.5.13

### What issue do you have?

I have noticed that Joplin doesn't sort well. When I create a note, I give it a number at the beginning of the title. This _usually_ results in proper sorting, but I have seen lately that Joplin will list several notes in order then display two or three out of order, then go back to in-order. for example 1,2,3,8,9,4,5,6,7,10. I have tried re-typing the numbers but that doesn't seem to work. Any ideas?

---

<div class="post-metadata">

### Author: ![Eduardo](https://avatars.discourse-cdn.com/v4/letter/e/6a8cbe/32.png) [@Eduardo](https://discourse.joplinapp.org/u/Eduardo)
#### Post date: [11 May 2026 21:02 UTC](https://discourse.joplinapp.org/t/another-sort-observation/49832/2 "2026-05-11T21:02:17Z")

</div>

If you use numbers at the beginning of note titles for alphabetical sorting, you should always keep the same number of digits.  
For example, instead of:  
1, 2, 3, 4, 5, 10  
use:  
01, 02, 03, 04, 05, 10  
or even:  
001, 002, 003, 010  
The reason is that Joplin sorts titles alphabetically, not numerically. Otherwise, the number 10 may appear before 2 or create other strange ordering behavior.

---

<div class="post-metadata">

### Author: ![jslawrence](https://avatars.discourse-cdn.com/v4/letter/j/cdc98d/32.png) [@jslawrence](https://discourse.joplinapp.org/u/jslawrence)
#### Post date: [12 May 2026 12:27 UTC](https://discourse.joplinapp.org/t/another-sort-observation/49832/3 "2026-05-12T12:27:57Z")

</div>

So I should use a, b, c, etc? I tried adding the zero for single digit entries, but that actually made sorting more "unsorted" and didn't address 37 being listed before 30. Are there other ways to sort? I'm trying to keep these entries in order (mostly) by date, does Joplin sort by date?

---

<div class="post-metadata">

### Author: ![jslawrence](https://avatars.discourse-cdn.com/v4/letter/j/cdc98d/32.png) [@jslawrence](https://discourse.joplinapp.org/u/jslawrence)
#### Post date: [12 May 2026 12:30 UTC](https://discourse.joplinapp.org/t/another-sort-observation/49832/4 "2026-05-12T12:30:44Z")

</div>

Update: I added the zero before the single digit numbers and now those entries have disappeared

---

<div class="post-metadata">

### Author: ![jslawrence](https://avatars.discourse-cdn.com/v4/letter/j/cdc98d/32.png) [@jslawrence](https://discourse.joplinapp.org/u/jslawrence)
#### Post date: [12 May 2026 12:33 UTC](https://discourse.joplinapp.org/t/another-sort-observation/49832/5 "2026-05-12T12:33:02Z")

</div>

found them listed under "conflicts"

---

<div class="post-metadata">

### Author: ![jslawrence](https://avatars.discourse-cdn.com/v4/letter/j/cdc98d/32.png) [@jslawrence](https://discourse.joplinapp.org/u/jslawrence)
#### Post date: [12 May 2026 12:44 UTC](https://discourse.joplinapp.org/t/another-sort-observation/49832/6 "2026-05-12T12:44:36Z")

</div>

Not sure how, but switching between increasing and decreasing order seems to have fixed this (if temporarily).

---

<div class="post-metadata">

### Author: ![banan314](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/banan314/32/5012_2.png) [@banan314](https://discourse.joplinapp.org/u/banan314)
#### Post date: [12 May 2026 19:39 UTC](https://discourse.joplinapp.org/t/another-sort-observation/49832/7 "2026-05-12T19:39:49Z")

</div>

> [@Eduardo](#):
>
> The reason is that Joplin sorts titles alphabetically, not numerically

I believe Joplin sorts numerically @Eduardo

> ### Text Fields (Alphabetical)
> 
> When sorting by text fields like `title`, Joplin uses `getCollator()` for locale-aware string comparison, which handles international characters and natural sorting (e.g., "A3" comes before "A20"). Note.ts:313-331 Note.test.ts:339-364

> ```typescript
> const collator = getCollator();
> 
> return notes.sort((a: NoteEntity, b: NoteEntity) => {
> if (noteOnTop(a) && !noteOnTop(b)) return -1;
> if (!noteOnTop(a) && noteOnTop(b)) return +1;
> 
> let r = 0;
> 
> for (let i = 0; i < orders.length; i++) {
> const order = orders[i];
> // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
> let aProp = (a as any)[order.by];
> // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
> let bProp = (b as any)[order.by];
> if (typeof aProp === 'string') aProp = aProp.toLowerCase();
> if (typeof bProp === 'string') bProp = bProp.toLowerCase();
> 
> if (order.by === 'title') {
> r = -1 * collator.compare(aProp, bProp);
> } else {
> if (aProp < bProp) r = +1;
> if (aProp > bProp) r = -1;
> }
> if (order.dir === 'ASC') r = -r;
> if (r !== 0) return r;
> 
> ```

---

<div class="post-metadata">

### Author: ![jslawrence](https://avatars.discourse-cdn.com/v4/letter/j/cdc98d/32.png) [@jslawrence](https://discourse.joplinapp.org/u/jslawrence)
#### Post date: [14 May 2026 15:02 UTC](https://discourse.joplinapp.org/t/another-sort-observation/49832/8 "2026-05-14T15:02:57Z")

</div>

What if I used a date? for example 20260514?

---

<div class="post-metadata">

### Author: ![banan314](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/banan314/32/5012_2.png) [@banan314](https://discourse.joplinapp.org/u/banan314)
#### Post date: [14 May 2026 20:33 UTC](https://discourse.joplinapp.org/t/another-sort-observation/49832/9 "2026-05-14T20:33:03Z")

</div>

> [@jslawrence](#):
>
> What if I used a date? for example 20260514?

dates in the format YYYYMMDD follow the natural ordering for numbers, so they will be correctly sorted as well. However, the collator doesn't recognize it as a date as such

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex028/uploads/cozic/original/3X/1/c/1c948e33314e232a0927789508474d8624f4270b.png) [@system](https://discourse.joplinapp.org/u/system)
#### Post date: [13 June 2026 20:33 UTC](https://discourse.joplinapp.org/t/another-sort-observation/49832/10 "2026-06-13T20:33:57Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
