Sort lines by word position
Sort lines by a specific word within each line, not the whole line.
Sort lines by word position
Sort lines by word position reorders your text using one specific word from each line as the sort key, instead of comparing entire lines from the start. It's built for lists where the field you actually want to sort by isn't the first thing on the line — a roster written "Last First", a log line where the timestamp sits after a tag, or a dump of space-separated columns pasted straight from a spreadsheet.
Paste your lines and set the word position: 1 sorts by the first word, 2 by the second, and so on up to 20. Each line is split on whitespace, so runs of spaces or tabs between words count as a single separator and don't throw off the count. If a line has fewer words than the position you chose, the tool falls back to that line's last word as the key, so short or ragged lines still land somewhere sensible instead of breaking the sort. A completely empty line sorts as an empty key.
Two options refine the comparison. Descending order reverses the result — useful for "newest first" or "highest first" lists once you've picked the right word. Case-sensitive comparison switches from the default locale-aware, case-insensitive comparison to one that distinguishes uppercase from lowercase, which matters for tags, codes, or identifiers. The sort is stable, so lines sharing the same key keep their original relative order.
Typical uses include alphabetizing a name list by surname when it's formatted "Given Family", or straightening out any space-delimited list by the column that actually matters. Everything runs locally in your browser — your text is never uploaded, so pasting sensitive lists like contact rosters stays private.