Text Line Tools
Sort, deduplicate, reverse, number, and shuffle text lines
About this tool
A Swiss-army knife for line-based text manipulation. Paste any text and apply operations like sorting (ascending, descending, or random), removing duplicate lines, stripping empty lines, reversing line order, adding line numbers, or shuffling lines randomly. Results are instantly ready to copy or download.
How to use
- 1 Paste or type your text in the input area.
- 2 Select a tab: Sort Lines, Remove Duplicates, Remove Empty Lines, Reverse Lines, Number Lines, or Shuffle Lines.
- 3 Configure any available options (e.g. sort direction).
- 4 Click the action button — the result appears instantly.
- 5 Use Copy or Download to save the result.
Why line-based editing deserves its own toolkit
A surprising amount of everyday data is just a list — one item per line. Email addresses pasted from a spreadsheet, a dump of log entries, a column of product SKUs, the imports at the top of a code file, a to-do list. Operating on that data line by line is awkward in a normal text editor and overkill in a spreadsheet. This toolkit treats the newline as the unit of work and gives you six common transformations in one place: sort, remove duplicates, remove empty lines, reverse, number, and shuffle. You paste text on the left, pick a tab, click the action, and the result appears on the right ready to copy or download as result.txt. Live counters show how many lines went in and how many came out, which is often the fastest way to spot a problem.
How each operation behaves — precisely
| Operation | What it does |
|---|---|
| Sort Lines | Orders lines alphabetically; toggle A→Z or Z→A, and an optional case-insensitive mode |
| Remove Duplicates | Keeps the first occurrence of each line, drops later repeats, preserves order |
| Remove Empty Lines | Deletes any line that is blank or whitespace-only |
| Reverse Lines | Flips the order top-to-bottom (last line becomes first) |
| Number Lines | Prefixes each line with a counter using your start value and separator |
| Shuffle Lines | Randomly reorders every line |
Two details matter in practice. Deduplication is exact and case-sensitive — Apple and apple are different lines, and a trailing space makes cat distinct from cat. And "empty" means whitespace-only: a line containing just spaces or tabs is removed, but a line with any visible character is kept.
The default sort is not numeric — and that surprises people
Sorting is lexicographic (dictionary order on the raw text), which is exactly what you want for words but not for numbers. Sort the lines 2, 10, 1 and you get 1, 10, 2 — because "10" compares character by character and "1" comes before "2". This is correct string behaviour, not a bug. If you need true numeric order, pad your numbers to equal width first (01, 02, 10) and they will sort correctly as text. The case-insensitive toggle changes a related quirk: by default uppercase letters sort before all lowercase (so Zebra precedes apple); enabling case-insensitive sorting compares everything in lowercase so the order matches what a human expects.
A worked example: cleaning a mailing list
You paste 500 email addresses copied from three different exports. They contain duplicates, a handful of blank lines, and inconsistent ordering. The workflow is a short pipeline:
- Remove Empty Lines first to drop the blanks — the input counter says 500, the output says 487.
- Paste that result back, switch to Remove Duplicates — output drops to 412, telling you there were 75 repeats.
- Finally Sort Lines with case-insensitive on, so the list is alphabetised regardless of how people capitalised their addresses.
The line counters at each step double as a sanity check: if "remove duplicates" reported 0 removed when you expected many, you would immediately suspect a trailing-space problem.
Number Lines and Shuffle, in detail
Number Lines lets you set the starting value and the separator string. With start 1 and separator . you get 1. first line, 2. second line — ready for a numbered list. Set the start to 0 for zero-indexed output, or change the separator to a tab or ) to match a different convention. Shuffle uses a Fisher–Yates shuffle, the standard algorithm that walks the list once swapping each element with a random earlier-or-equal position. This produces a genuinely uniform random order where every arrangement is equally likely — unlike the naive "sort by a random number" trick, which is subtly biased. That makes Shuffle suitable for picking a random order of names, randomising quiz questions, or drawing fair lots.
Practical tips and common mistakes
- Chain operations by re-pasting. Each click does one transformation. To dedupe and sort, run one, copy the output back into the input, and run the next — as in the example above.
- Reset only clears the output. The Reset button empties the result pane; your input text stays, so you can try a different operation on the same data.
- Watch for invisible whitespace. The number-one cause of "duplicates that won't dedupe" is a trailing space or a stray tab. If counts look wrong, it is almost always whitespace.
- Sorting won't fix number order. Pad with leading zeros if you need
1, 2, 10instead of1, 10, 2. - It all runs in your browser. No line of text is uploaded — handy when the list contains addresses or other data you would rather not send to a server.
Frequently Asked Questions
Count words, characters, sentences, paragraphs, and estimated reading time.
Reverse text, flip upside-down, sort lines, remove duplicates, shuffle, and more text utilities.
Convert text between UPPERCASE, lowercase, Title Case, camelCase, PascalCase, snake_case, and kebab-case instantly.
Deep statistical analysis of any text: word frequency, readability, syllables, letter distribution, and more.