GlobalKit

Sort Lines

Sort a list alphabetically, naturally (item 2 before item 10) or by line length, ascending or descending, with the right letter order for Turkish.

Up to 500,000 characters. Each line break starts a new item.

Alphabetical follows the language rule; natural also orders numbers by value (item 2 before item 10); length sorts by number of characters.

No: a and A are equal and keep their input order. Accents always count, so c and ç stay different. Yes: a comes before A. Does not apply to sorting by length.

Spaces are removed from the output as well.

Empty and whitespace-only lines are kept at the top (ascending) or bottom (descending), or removed.

Decides where letters such as ç, ğ, ı, ö, ş, ü and ä are placed. Defaults to the page language.

Lines
0

How it works

Paste one item per line and pick how to compare them. The result updates as you type. A line break of any kind (Windows CRLF, Unix LF, old Mac CR, Unicode line and paragraph separators) ends a line, and the output is always joined with plain LF. One break at the very end of the text does not create an extra empty line.

There are three ways to compare:

The sort is stable: lines that compare as equal always stay in the order you gave them.

Why the language rule matters

Code-point order, which is what many simple sorters use, puts every capital letter before every lowercase letter and every non-ASCII letter after "z". For Turkish that means Ç, Ğ, Ö, Ş and Ü end up at the bottom. The language rule fixes this: Turkish places ç after c, ğ after g, ö after o, ş after s, ü after u, and sorts dotless ı before i. The English and German rules give the same order for ä, ö, ü and ß (they sit beside a, o, u, and ß sorts like ss), so the choice only matters for Turkish. The rule defaults to the language of the page and you can change it for any list. It affects only the order, never the text of the page.

Case and accents

With Case sensitive set to No, case is ignored but accents are not: "c" and "ç" stay different letters, and "a" and "A" tie. With Yes, lowercase precedes uppercase of the same letter. Under the Turkish rule, "I" and "ı" tie when case is ignored, and so do "İ" and "i".

Examples

Input linesSettingsResult
item 10
item 2
item 1
Alphabeticalitem 1
item 10
item 2
item 10
item 2
item 1
Naturalitem 1
item 2
item 10
v2
v10
v1
Natural, descendingv10
v2
v1
b
A
a
B
Case sensitive: NoA
a
b
B
B
b
A
a
Case sensitive: Yesa
A
b
B
ç
d
c
C
Case sensitive: Noc
C
ç
d
a
A
b
Descending, case ignoredb
a
A
i
ı
j
h
English ruleh
i
ı
j
i
ı
j
h
Turkish ruleh
ı
i
j
st
ß
sr
ss
German or English rule (same result)sr
ss
ß
st
ccc
b
aa
d
bb
Line length, ascendingb
d
aa
bb
ccc
ab
😀
abc
Line length, ascending😀
ab
abc
b
(empty)
a
(empty)
c
Ascending, keep empty lines(empty)
(empty)
a
b
c
b
(empty)
a
Descending, keep empty linesb
a
(empty)

Things to watch for

Frequently asked questions

Last updated: 10/11/2026

Related tools