Outils gratuits

Trier et dédupliquer les lignes

Trie les lignes par ordre alphabétique, naturellement, par longueur ou aléatoirement et peut supprimer les lignes en double ou vides.




What the Sort & Deduplicate Lines tool does

This tool treats your text as a list — one item per line — and reorders or cleans it in a single pass. You can keep the original order, sort alphabetically A–Z or Z–A, sort naturally so that 2 comes before 10, sort by line length, reverse the current order, or shuffle randomly. Alongside the ordering you can remove duplicate lines, ignore case when comparing, trim leading and trailing spaces from every line, and drop blank lines. It is the everyday workhorse for anyone who wrangles lists: deduplicating an email or subscriber export, alphabetising a bibliography or a set of imports, cleaning a column pasted out of a spreadsheet, tidying a wordlist, or normalising a batch of hostnames, IPs or proxies before feeding them somewhere else.

How it works technically

The tool splits your input on newlines (handling Windows \r\n, classic-Mac \r and Unix \n line endings) into an array of lines, then applies your options in a deliberate order. Trimming and blank-line removal happen first so they do not skew later steps. Deduplication keeps the first occurrence of each line and discards the rest, using a hash set for speed; with “ignore case” enabled it compares a lower-cased version, so Apple and apple are treated as the same entry. Sorting then runs on what remains: the alphabetical modes use the browser's locale-aware localeCompare, natural mode compares embedded numbers by value rather than digit-by-digit, length mode orders by character count, and shuffle produces a fresh random permutation on every run. Everything is string-based, so it behaves the same whether your lines are names, URLs or numbers.

Concrete examples and use cases

  • Deduplicate a mailing list: paste thousands of addresses, tick “remove duplicates” and “ignore case”, and collapse User@site.com and user@site.com into one.
  • Natural sort of versions or files: v1, v2, v10, v20 land in human order instead of v1, v10, v2, v20.
  • Clean a pasted column: trim stray spaces and remove the blank rows left behind by a spreadsheet copy.
  • Random sampling: shuffle a list of names to pick a fair order or draw the first few as a quick raffle.

Practical tips and gotchas

Order of operations matters: because trimming runs before deduplication, two lines that differ only by a trailing space are correctly seen as duplicates. Natural sort only helps when numbers appear inside the text; for pure words it behaves like an ordinary alphabetical sort. Locale-aware sorting means accented letters may not fall exactly where a raw byte sort would put them — usually what you want, occasionally surprising. Remember that deduplication is exact (after any case-folding and trimming): café written with a combining accent and café written with a single precomposed character look identical but are different strings, so normalise a source that mixes the two. Shuffle is genuinely random each time, so keep a copy if you need to reproduce a particular order.

Privacy: the tool runs 100% locally in your browser. Your list is split, sorted and de-duplicated entirely in JavaScript on your device — nothing is uploaded, nothing is logged, and no line ever leaves your machine, which matters when the list is customer emails, internal hostnames or anything else confidential. If your lines are IP addresses or servers you then want to inspect, our IP check tool looks up any single address the same private way.

Les gens ont trouvé cette page en recherchant

Vraies phrases de recherche auxquelles cette page répond — les liens ouvrent la page qui les couvre en profondeur.