Skip to content
Accessibility
Theme
Text size
High contrast
Limit animations
Readable fontAtkinson Hyperlegible
Increased text spacing
Underline links
Always show focus

Runs in your browser — nothing you paste is uploaded.

Line Tools

Sort, deduplicate, trim, reverse or shuffle a list of lines. Operations combine in one pass. Runs in your browser.

Sort

      

What it does

Line Tools takes a list — one item per row — and reshapes it. You can trim whitespace, drop blank rows, sort alphabetically or numerically, remove duplicates, reverse the order, or shuffle randomly, and you can combine any of these in a single pass. The result updates as you type and the line count is shown underneath.

How it works

The operations run in one fixed order regardless of how you tick the boxes: trim → remove empty → sort → dedupe → reverse → shuffle. That order matters. Trimming runs before dedupe, so " alice" and "alice" collapse to one entry. Shuffle runs last, so if you select both a sort and shuffle, the shuffle wins. Dedupe keeps the first occurrence and preserves the surrounding order. Numeric sort reads the leading number of each line with parseFloat, so 10 correctly sorts after 9 rather than before it the way a plain text sort would.

Gotchas

  • Dedupe is case-sensitive: Red and red both survive. Normalise case first with the Case Converter if you need case-insensitive dedupe.
  • Numeric sort on lines without a leading number produces NaN and unstable positions — use A→Z for mixed data.
  • Shuffle uses an unbiased Fisher–Yates swap, so every ordering is equally likely.

Worked examples

Cleaning a pasted email list: tick Trim, Remove empty and Dedupe to turn a messy copy-paste into a clean unique list. Randomising a draw: paste names, tick only Shuffle, and take the top line as the winner. For comparing two lists line by line instead, use Text Diff; to count the lines and words, see Text Stats.

Privacy

All processing is local; nothing is uploaded.

Frequently asked questions

In what order are the operations applied?

Always the same fixed order, regardless of the order you tick the boxes: trim, remove empty, sort, dedupe, reverse, shuffle. So trimming happens before deduping (lines differing only by whitespace collapse into one), and shuffle always runs last, overriding any sort you also selected.

Is the deduplication case-sensitive?

Yes. Dedupe compares lines exactly, so Apple and apple are treated as different and both kept. There is no fuzzy matching. For case-insensitive dedupe, normalise the case first with the Case Converter.

How does numeric sort handle non-numeric lines?

Numeric sort uses parseFloat, reading the leading number and ignoring trailing text, so 12px sorts as 12. Lines with no leading number become NaN and their position is unreliable — use alphabetical (A→Z) sort for mixed data.

Related tools