NordVPN
SponsoredStrict no-logs VPN with 6,400+ servers in 111 countries. Threat Protection blocks ads, trackers, and malware while you work online.
Get NordVPN →Sort lines of text alphabetically or in reverse order, with optional case-insensitive matching, duplicate removal, empty-line stripping, and whitespace trimming. Everything runs in your browser — no data is sent to a server.
Sorting splits your text into individual lines, orders them lexicographically, and joins them back together. Lexicographic order is the same principle used in dictionaries: characters are compared one at a time from left to right using their Unicode code points.
By default this tool uses case-insensitive comparison, which means 'apple', 'Apple', and 'APPLE' are treated as identical for ordering purposes. Enable case-sensitive mode when you need uppercase letters to sort before lowercase (e.g., 'Z' before 'a' in ASCII order).
Alphabetizing name lists, tag clouds, or CSV column values are the most common tasks. Developers frequently sort import statements or configuration keys to make code reviews easier and diff outputs cleaner.
Data analysts use line sorting to quickly spot duplicate entries in exported lists or to align two datasets before a manual comparison. The duplicate-removal option condenses a list with thousands of entries to only unique values in one click.
Modern JavaScript engines use an optimized variant of TimSort (a hybrid of merge sort and insertion sort) for the Array.prototype.sort method. TimSort is stable, meaning lines that compare as equal preserve their original relative order — useful when you sort a deduplicated list and want consistent behavior.
For the vast majority of text lists you will encounter, the algorithm finishes in well under a millisecond in the browser, even for tens of thousands of lines. If you need locale-aware sorting (e.g., accented characters in French or German sorted correctly), consider using Intl.Collator in your own code, as this tool uses simple Unicode code-point comparison for maximum speed.
Yes. The output updates in real time as you type or change any option — there is no submit button.
No. By default the tool sorts case-insensitively so that 'Apple' and 'apple' sort together. Enable the 'Case-sensitive' checkbox to use raw Unicode code-point order instead.
Each newline character (\n) marks the end of a line. If you paste text from a spreadsheet or from Windows (\r\n line endings), the tool handles it correctly and sorts by logical lines.
The tool sorts lexicographically, not numerically. That means '10' sorts before '9' because '1' < '9'. For numeric sorting, pad numbers with leading zeros (e.g., '09' vs '10') before pasting.
It keeps the first occurrence of each unique line and discards subsequent identical ones. The comparison respects your case-sensitivity setting, so 'Apple' and 'apple' are treated as the same line only in case-insensitive mode.
No. All processing happens locally in JavaScript. Nothing is uploaded to any server.
There is no hard limit enforced by this tool. Performance depends on your device, but modern browsers handle hundreds of thousands of lines without noticeable lag.
Copy the column values from your spreadsheet application into the input area (they paste as one value per line), apply your options, copy the sorted output, and paste it back. Then re-attach your other columns manually or in a spreadsheet formula.
Strict no-logs VPN with 6,400+ servers in 111 countries. Threat Protection blocks ads, trackers, and malware while you work online.
Get NordVPN →Managed cloud hosting for WordPress and web apps on DigitalOcean, Vultr, and AWS. Fast setup, no server headaches.
Try Cloudways →Hire freelancers for design, writing, dev, and marketing — or sell your own services. Millions of gigs at every budget.
Browse Fiverr →