🔒 Processed locally in your browser — no data uploaded
← Back to Home

Text Dedup & Sort

Input text (one entry per line)
Result

What the Text Dedup & Sort does

This tool treats your input as a list with one entry per line and offers five ways to reorganise it. Deduplicate strips repeated values, A-Z sorting arranges the list by text, number sorting orders it by a leading figure, Shuffle reorders at random, and the duplicates view shows you which values occur more than once before you throw anything away.

Every action reads the input box again and replaces the previous result rather than stacking on top of it, so the box stays the single source of truth. Blank lines are removed before anything runs, which matters when a spreadsheet column copies across with empty rows between entries: the count reported after each action reflects real entries, not the gaps you pasted.

How to use it

  1. Paste one item per lineEach line becomes one entry, so copying a spreadsheet column alone pastes cleanly. Blank lines are dropped first, and spaces inside a line are kept exactly as typed, including anything trailing the final character.
  2. Remove repeated valuesDeduplicate keeps the first appearance of each value and discards later copies, so the order of your first occurrences survives. It does not re-sort the list alphabetically, which makes it safe to run on an ordered export.
  3. Sort or shuffleA-Z compares lines as text, number sorting reads a figure from the start of each line, and Shuffle produces a random order. All three act on the complete list, duplicates included, so dedupe first if you want a clean set.
  4. Inspect the repeatsShow Duplicates Only prints each value that appeared at least twice, once per value. Run it before deduplicating when you need to see what would be removed, rather than trusting a count you have not checked.

Options and formats

DeduplicateExact, case-sensitive matching after blank lines are dropped. A trailing space is part of the value, so two rows that look identical on screen can survive as separate entries without any warning.
Sort A-ZUses a locale-aware comparison instead of raw character codes, which keeps accented letters near their unaccented neighbours rather than pushing them past every plain letter. Digits sort ahead of letters, as you would expect in a directory listing.
Sort by numberReads a number from the beginning of each line and orders by value, so 2 comes before 10 where text sorting would put 10 first. Lines that do not start with a figure cluster at one end unpredictably.
ShuffleProduces a random permutation of the list, which suits picking a reading order or drawing names from a hat. There is no seed and no history, so nothing about the result can be reproduced or audited later.
Show duplicates onlyLists each repeated value once rather than once per occurrence. Three copies of one address produce a single line, so the line count tells you how many distinct values repeat, not how many extra rows they add.

Things to watch out for

Trailing spaces break matchingA line ending in a space is a different value from the same line without one, so deduplication can leave pairs that look identical on screen. Clean the text in an editor first, or run it through a whitespace stripper before pasting it here.
Case variants split valuesApple and apple count as two entries. Lists that came from several people or several systems often mix capitalisation, and deduplicating them raw gives you roughly double the rows you expected with no warning about it.
Sorting overwrites your orderEach action replaces the result area, so sorting after deduplicating destroys the first-seen order that deduplication preserved. Keep a copy of the list in a second document before you sort, or re-paste the original to start over.
Multiple values in one lineThe tool works line by line, so two addresses separated by a comma on one line count as a single entry and never deduplicate against each other. Split multi-value cells so each value gets its own line before pasting.

Frequently asked questions

Does deduplication keep the first or the last copy?

The first. Values are collected in the order they are first seen, so the surviving row is always the earliest occurrence in the text you pasted. If you need the newest record from an export, sort that export by date descending before pasting it here.

Can I count how many times a value repeats?

Not directly. The duplicates view tells you which values repeat and the line count tells you how many distinct repeats exist, but per-value occurrence counts are not printed. A spreadsheet with a COUNTIF column against the original list does that part more precisely.

How does number sorting handle decimals and negatives?

It reads a figure from the start of the line, so 3.5 and -12 are understood, while a line beginning with text or a symbol such as #42 is not. Mixed lists end up partly ordered, with the unreadable lines gathered at one end in their original relative sequence.

Will shuffling produce the same order twice?

No. Each press draws a fresh random permutation and there is no seed box, so a previous result cannot be reproduced. Copy the order you like before pressing again, because the result area is overwritten in place and the earlier arrangement is gone.

Why is my line count lower than what I pasted?

Lines that are empty or hold only spaces are discarded before any action runs. A table copied with a blank row between entries loses those rows, so the figure after each action counts entries rather than the physical lines that came out of your source document.

Is there a limit on list size?

No fixed limit, since everything runs in the page through JavaScript sets and sorts that handle tens of thousands of short lines comfortably. Very long individual lines slow the sorting down, because every comparison has to walk more characters before it can decide which line comes first.