Line Tools
Sort, dedupe, reverse, trim and shuffle lines of text in one click.
Your files never leave your device. Everything runs in your browser.
What Line Tools does
Line Tools applies ten one-click clean-up operations to a list: sort A→Z or Z→A, remove duplicates, reverse the order, shuffle, trim spaces, remove empty lines, number lines, strip numbering, and join everything into one line. Paste one item per line and click an operation — the list in the box is rewritten on the spot.
It handles the small chores that come up constantly with list-shaped text: tidying a column copied out of a spreadsheet, deduplicating entries, reversing an export, collapsing indentation, numbering steps, or shuffling names for a draw. Each button works on the current content of the box, so operations chain — sort, dedupe, then number, for instance.
A line counter sits next to the buttons so you can check the list before and after cleaning. A sort of “banana, Apple, cherry, 10, 2” comes back as “10, 2, Apple, banana, cherry”, and deduplicating “b, a, b, c, a” leaves “b, a, c” — first occurrences kept.
How to use Line Tools
- Paste your list into the box, one item per line.
- Click Sort A→Z or Sort Z→A for a locale-aware alphabetical sort.
- Clean up with Remove duplicates, Trim spaces or Remove empty.
- Rearrange the list with Reverse order or Shuffle.
- Add structure with Number lines, or strip existing prefixes with Remove numbers.
- Use Join into one line to collapse the list into a single space-separated line, then Copy result.
Features
- Ten one-click operations on the current text: sort up, sort down, dedupe, reverse, shuffle, trim, remove empty lines, number, remove numbering and join.
- Operations chain because each one rewrites the box, so several clean-up steps can be combined.
- Sort is locale-aware through localeCompare, so accented characters and non-English text sort naturally instead of by raw character code.
- Deduplication keeps the first occurrence of each exact line.
- A live line counter and a Copy result button.
- No uploads: the list never leaves the browser.
Tips and common mistakes
- The sort is lexicographic, not numeric: “10” sorts before “2”. Pad numbers with leading zeros first if you need numeric order.
- Sorting and deduplication compare exact strings, so “Apple” and “apple” are different lines — and so are “apple” and “apple ”.
- Shuffle uses the browser's random function, so the order changes on every click and previous results cannot be recreated. It is a convenience shuffle, not a verifiable draw.
- Blank lines belong to the list: they are sorted, reversed, shuffled and given numbers unless you use Remove empty.
- Trim spaces also collapses runs of spaces inside a line to a single space, so “ a b ” becomes “a b”.
- Remove numbers strips prefixes such as “12. ” and “12) ”; text like “42 no dot” is left untouched.
Frequently asked questions
Is the sort numeric or alphabetical?
It is alphabetical and locale-aware, comparing text rather than number values, so “10” comes before “2”. Pad numbers with zeros or sort numeric data in a spreadsheet if that matters.
Which duplicate does Remove duplicates keep?
The first occurrence; later exact copies are dropped. The comparison is case-sensitive and does not ignore surrounding spaces, so “apple”, “Apple” and “apple ” are three different lines.
Is the shuffle secure or repeatable?
Neither. It is a Fisher–Yates shuffle driven by JavaScript's Math.random, so the result changes on every click and cannot be reproduced or audited. For anything that must be provably fair, use a dedicated random draw instead.
How are blank lines treated?
They stay in the list for sort, reverse, shuffle, number and join, and duplicates of blank lines are merged like any other line. The Remove empty button drops them, including lines that contain only spaces.
Why does the line counter show one more line than I expect?
The counter splits on newline characters, so a trailing newline at the end of the text counts as an extra empty line. Even an empty box shows “1 lines” for the same reason.
Can I undo an operation?
No. Each operation rewrites the text immediately and there is no undo, so keep the original list in a file or another tab until the result is what you want.
Related text tools: Find & Replace, Word Counter, Regex Tester, Text Diff Checker.
Every operation runs on the text in your browser; the list is never uploaded.