Text

Sort Lines

Sort lists alphabetically, numerically, by length or randomly. Ascending or descending, with optional cleanup.

Instant🔒In your browserNo signup
Live

Why sort in the browser

Excel and Google Sheets sort, sure. But opening a sheet, pasting a column, sorting, and copying back is slow if all you have is a short list. A web tool sorts instantly. For SEO, marketing, programming or admin work, it's one of the most-used utilities.

Sort modes

  • Alphabetic — uses Intl.Collator for natural dictionary order.
  • Numeric — parses each line as a number. 10 comes after 2, not before (which is what string sort does).
  • Length — useful for copy review: shortest or longest lines first.
  • Random — shuffle items. Handy for raffles, A/B testing, or assigning presentation order.

Use cases

  • Sort a list of keywords before pasting into Google Ads or Search Console.
  • Alphabetize filenames before uploading to a server.
  • Order CMS tags to spot duplicates.
  • Reorder imports in a code file (a linter is better, but in a pinch this works).
  • Shuffle raffle entries or class presentation order.

The classic numeric-sort gotcha

In JavaScript, [2, 10, 3].sort() returns [10, 2, 3]. Why: sort() with no argument compares as strings, and "10" sorts before "2" because "1" < "2". That's why numeric mode runs parseFloat and compares numerically. If your list mixes numbers and text, non-numeric values land at the end.

Case and accents

By default, sorting is case-insensitive and uses natural English ordering. If you turn on "case sensitive", UPPERCASE sorts before lowercase (because their Unicode code points are lower). That's almost never what you want for human-facing lists, but it's right for some technical cases.

Optional cleanup

Before sorting you can:

  • Trim whitespace — prevents " Apple" from sorting separately from "Apple".
  • Remove empty lines — useful when you paste a list with stray newlines.

For explicit deduplication there's a dedicated tool on this site.

FAQ

Is sorting case-sensitive?

Default is no — toggle if needed.

How does it sort numbers?

Numeric mode parses each line as a number and sorts by value.

Does it handle accented characters?

Yes — Intl.Collator handles them in dictionary order.

Was this generator useful?