Skip to content
Test versionSearch

Text and writing

Sort lines and remove duplicates

Sort whole lines using English collation, reverse their order or keep the first occurrence of each duplicate. Length sorting counts visible grapheme clusters, with alphabetical ties. Trimming and blank-line removal run first. Case-insensitive duplicate matching lowercases text; it does not equate accents. This version does not shuffle lines.

How it worksFAQRelated tools

Content reviewed:

Also available for Germany, in German 

Paste text, choose options and calculate. Up to 20,000 UTF-16 code units (an emoji can use more than one). Empty input is allowed except for naming conversion.

Processing stays in this browser tab. Input is not sent, saved in browser storage or added to the URL. The original TXT download contains the result. The additional JSON export contains the input, selected options and exact result. Copy may require permission; selecting text is available as a fallback. Changing an input clears the previous result. Optional own UTF-8 file up to 32 KiB and 20000 UTF-16 units; raw file and form line endings are recorded separately. CSV protects formula-like lines with an apostrophe; printable HTML refuses unsupported control characters. Optional live calculation is off by default.

How it works

Sort whole lines using English collation, reverse their order or keep the first occurrence of each duplicate. Length sorting counts visible grapheme clusters, with alphabetical ties. Trimming and blank-line removal run first. Case-insensitive duplicate matching lowercases text; it does not equate accents. This version does not shuffle lines. Additional own JSON/numbered-line CSV/printable HTML exports record the unchanged calculation result. Processing stays in this browser tab. Input is not sent, saved in browser storage or added to the URL. The original TXT download contains the result. The additional JSON export contains the input, selected options and exact result. Copy may require permission; selecting text is available as a fallback. Changing an input clears the previous result. Optional own UTF-8 file up to 32 KiB and 20000 UTF-16 units; raw file and form line endings are recorded separately. CSV protects formula-like lines with an apostrophe; printable HTML refuses unsupported control characters. Optional live calculation is off by default. Numeric smallest-first and largest-first modes accept one plain signed decimal per line, with a dot or comma decimal mark and a digit before it. Up to 100 retained lines and 100 characters per retained line, after the selected trimming and blank-line removal. Equal values keep their spelling and input order. Fractions, exponents and thousands separators are not accepted. Numeric comparison uses exact rational values; it does not round or convert entered values to floating-point numbers. A comma always marks decimals: 1,000 means one.

Worked example

Example input: pear apple pear banana

Worked example

With these example values the calculator gives the result below. You can change any value in the form above.

Inputs

Input text
pear apple pear banana
Operation
Alphabetical A–Z
Trim line edges first
No
Blank lines
Keep blank lines
Case matching
Case-sensitive

Result

Result
Unicode code points: 22

Frequently asked questions

How do I sort lines alphabetically?

Paste your text, choose A to Z and run. The tool sorts whole lines using English collation. Pear, apple, pear and banana become apple, banana, pear and pear.

How do I remove duplicate lines?

Choose to keep the first occurrence of each duplicate. Case-insensitive matching lowercases text and does not equate accents.

Can I sort numbers?

Yes. Enter one plain decimal per line, such as -2 or 1.25. A comma always marks decimals, and fractions, exponents and thousands separators are not accepted.

How does sorting by length work?

It counts visible grapheme clusters, with alphabetical ties.

Can I shuffle lines?

No. This version does not shuffle lines.

What limits apply?

Up to 20,000 UTF-16 code units, or an optional UTF-8 file up to 32 KiB. Numeric order accepts up to 100 lines of 100 characters.