Sort a list by frequency

Sort a list by frequency to rank items by how often they appear - most common first by default. Each unique item is collapsed to one line with its count, or you can keep every duplicate and just group them together. Runs entirely in your browser; nothing is uploaded.

Input
Ready
Output
Live

Rank list items by how often they appear

Sort a list by frequency when you want the popular items at the top, not the alphabetical ones. The tool counts every item, then orders them by that count - most frequent first by default, or least frequent first with one toggle.

By default each unique item is shown once, prefixed with its count (`3 apple`). Turn Show count off for a clean ranked list with no numbers, or turn Keep duplicates on to keep every occurrence and simply group identical items next to each other.

Counting is case-insensitive by default, so "Apple" and "apple" are treated as the same item; the first spelling seen is the one displayed. Flip Case sensitive on to count them separately. Ties are broken alphabetically (natural order, so "item2" sorts before "item10").

It all runs entirely in your browser as you type - your list is processed locally and nothing is uploaded.

How to use sort a list by frequency

  1. 1Paste or type your list into the input panel - one item per line.
  2. 2Leave Order on Most first for a popularity ranking, or switch to Least first to surface rare items.
  3. 3Keep Show count on to see each item's tally, or turn it off for a bare ranked list.
  4. 4Turn Keep duplicates on if you want every occurrence retained and grouped instead of collapsed to one line each.
  5. 5Copy the result, or hit Download to save it as a plain text file.

Keyboard shortcuts

Drive ListShift without touching the mouse.

Shortcut Action
Ctrl ZUndo last input change
Ctrl Shift ZRedo
Ctrl Shift EnterToggle fullscreen focus on the editor
EscExit fullscreen
Ctrl KOpen the command palette to jump to any tool
Ctrl SSave current pipeline draft Plus
Ctrl PRun a saved pipeline Plus

What Sort by Frequency does

Five ways to turn a raw list into a frequency-ranked one.

Surface the most common items

With Order on Most first, the items that appear the most rise to the top. Paste survey answers, tags, log lines, or search terms and read the popularity ranking straight off the output.

Find the rare ones too

Flip Order to Least first and the one-off entries float to the top instead - a fast way to spot typos, outliers, or values that appear only once in a large list.

Counts on or off

Show count prefixes each line with its tally (`3 apple`), tab-separated so it pastes cleanly into a spreadsheet. Turn it off when you just want the items in popularity order with no numbers.

Collapse or keep duplicates

By default each item appears once. Turn Keep duplicates on to retain every occurrence, grouped together - useful when you need the full list reordered rather than summarised.

Case-aware counting

Counting folds case by default so "Apple" and "apple" tally together under the first spelling seen. Turn Case sensitive on to count differing cases as distinct items.

Worked example

Most-frequent first, each unique item collapsed to one line with its count (tab-separated).

Input
apple
banana
apple
cherry
banana
apple
Output
3	apple
2	banana
1	cherry

Settings reference

Four toggles control ordering, counts, duplicates, and case.

Setting What it does Default
Order Most first (descending) or Least first (ascending) by count Most first
Show count Prefix each line with its tally, tab-separated On
Keep duplicates Retain every occurrence (grouped) instead of one line per item; counts are not prefixed in this mode Off
Case sensitive Count differing-case spellings as separate items Off

FAQ

How are items ordered?
By count - most frequent first by default, or least frequent first if you switch Order to Least first. Items with the same count are broken alphabetically in natural order (so "item2" comes before "item10").
Why is there a tab between the count and the item?
Show count emits `count<TAB>item` so the output pastes straight into a spreadsheet as two columns. Turn Show count off for a plain ranked list with no numbers.
Can I keep every duplicate instead of collapsing them?
Yes. Turn Keep duplicates on and every occurrence is retained, with identical items grouped together in frequency order rather than collapsed to a single line each.
Is counting case-sensitive?
No by default - "Apple" and "apple" are counted together under the first spelling seen. Turn Case sensitive on to count them separately.
Does my data get uploaded?
No. Everything runs entirely in your browser - your list is processed locally and nothing is uploaded. Even file imports are read in the browser, not sent to a server.