โšกSwiftKit
โ† All Toolsโ˜• Support
๐Ÿ”คText & Editorial

Line Sorter & Deduplicator

Alphabetize lists, remove duplicate entries, strip empty lines, and reverse ordering in real-time.

Sort:
0 lines ยท 0 chars
0 lines

Natural Alphabetical Sorting

Uses internationalized string collation (localeCompare) so alphanumeric items like "Item 2" naturally precede "Item 10".

Deduplication

Instantly scrubs repeated entries from database extracts, keyword lists, or email registries while preserving clean line breaks.

Confidential & Offline

Your data never leaves your browser. Safe for proprietary customer lists, subscriber emails, and internal inventory spreadsheets.

What each sort button does, using the sample list

Start from this list of ten lines, which includes two duplicate fruits and two numbered items. With the default options on, the cleaned list has 8 lines because the repeated Apple and Banana are removed.

Zebra
Apple
Mango
Banana
Apple
10 Orange
2 Orange
Pineapple
Banana
Grape
A โ†’ Z

Result (in order): 2 Orange, 10 Orange, Apple, Banana, Grape, Mango, Pineapple, Zebra

What to know: Numbers sort before letters, and 2 comes before 10

Z โ†’ A

Result (in order): Zebra, Pineapple, Mango, Grape, Banana, Apple, 10 Orange, 2 Orange

What to know: The exact reverse of A to Z

Shortest first

Result (in order): Apple, Grape, Mango, Zebra, Banana, 2 Orange, 10 Orange, Pineapple

What to know: By number of characters; ties go alphabetically

Longest first

Result (in order): 10 Orange, Pineapple, 2 Orange, Banana, Apple, Grape, Mango, Zebra

What to know: Longest line first; ties go alphabetically

Reverse order

Result (in order): Grape, Pineapple, 2 Orange, 10 Orange, Banana, Mango, Apple, Zebra

What to know: Flips the cleaned list as it stands, without sorting it

Natural sorting: why 2 comes before 10

Computers normally sort text letter by letter, which puts "file10.txt" before "file2.txt". This sorter reads numbers inside the text as whole numbers, so a list of file names comes out the way you would arrange it by hand:

One limit to know about: a minus sign is treated as punctuation, so negative numbers are not sorted by value. -5, 3, -10, 20 comes out as -5, -10, 3, 20. For a list of numbers that includes negatives or decimals, use a spreadsheet's numeric sort.

The four cleaning options, with examples

Remove duplicate lines

Example input: apple, Apple, APPLE, banana

Result: apple, banana

Good to know: Ignores capital letters by default and keeps the first spelling it meets

Case-sensitive sorting (also makes duplicates case-sensitive)

Example input: apple, Apple, APPLE, banana

Result: apple, Apple, APPLE, banana

Good to know: All four are kept. With duplicates off, sorting b, B, a, A gives a, A, b, B

Trim extra spaces

Example input: apple, "apple " (trailing space), " apple" (leading space)

Result: apple (1 line, 2 duplicates removed)

Good to know: With trimming off, all three count as different lines

Remove blank lines

Example input: b, (blank), a

Result: a, b

Good to know: With this off, a blank line is kept as an empty line in the result

Trimming, removing blank lines and removing duplicates are on by default, because that is what most lists need. If you only want to sort and keep every line, untick the options you do not want and the result updates at once.

Where a sorted, de-duplicated list helps

Large lists are fine: 100,000 lines sorted and de-duplicated in about a second or two on an ordinary laptop. Because the work happens on your own device, nothing is uploaded, which matters for customer or subscriber lists. Related: compare two lists with the diff checker, or join lines together with the line break remover.

Knowledge Base

Frequently Asked Questions

How do I sort a list alphabetically?โ–ผ

Paste one item per line and press A to Z (or Z to A). Sorting uses your browser's language rules, so accented letters sort sensibly and numbers inside text are compared as numbers.

How do I remove duplicate lines?โ–ผ

Tick the option to remove duplicates. Matching is not case sensitive unless you turn on the case-sensitive option.

Can I sort by line length?โ–ผ

Yes. There are buttons for shortest first and longest first, and a button to reverse the current order.

Can it clean up blank lines and extra spaces?โ–ผ

Yes. You can trim spaces from each line and strip empty lines before sorting.

How big a list can it handle?โ–ผ

Lists of hundreds of thousands of lines work, because sorting happens on your own device. Pastes over 200,000 characters are processed after a short pause while you type.

Why does 2 come before 10 here, when other sorters put 10 first?โ–ผ

Plain computer sorting compares text one character at a time, so "10" lands before "2" because 1 comes before 2. This sorter reads whole numbers inside the text as numbers, so "file2.txt" comes before "file10.txt" and "2 Orange" before "10 Orange", which is the order a person expects.

Does it sort negative numbers correctly?โ–ผ

Not by value. A minus sign is treated as punctuation, so -5 comes before -10 instead of after it. Positive whole numbers inside text sort correctly. For a list of numbers that includes negatives or decimals, a spreadsheet's numeric sort is the safer choice.

Which spelling is kept when duplicates differ in capital letters?โ–ผ

The first one in your list. With apple, Apple and APPLE, only apple is kept, unless you tick case-sensitive sorting, in which case all three stay. Words that differ by an accent, such as Zoe and Zoรซ, are treated as different, so both are kept.

Does the sort order depend on my language?โ–ผ

Yes. The order of accented letters follows your browser's language settings, which is what you want for names and words in your own language. For ordinary English letters the result is the same everywhere.

Does it change my original list?โ–ผ

No. Your list stays in the left-hand box exactly as you pasted it, and the cleaned and sorted version appears on the right. Change an option or a sort button and the result updates straight away. Use Copy List to take the result away.