Clean up a list in one go

Trim, drop blanks, drop repeats, sort and fix letter case together. Nothing leaves your browser.

How it works

  1. Paste your list
  2. Switch on the clean-ups you want
  3. Copy the cleaned list

The order of the steps

The steps always run in the same order, whatever order the switches appear in. First trim, which removes spaces, tabs and other whitespace such as non-breaking spaces from both ends of each line. Second the letter case change. Third drop blank lines, meaning lines with nothing left in them after trimming. Fourth drop repeated lines, keeping the first of each. Fifth sort. Because trimming and the case change come before the repeat check, 'Apple ' and 'apple' match when trim is on and the case is set to lower, and they do not when the case is left as typed. Switch off any step and the others still run in this order.

Letter case choices

Leave keeps the letters as typed. Lower and UPPER change every letter. Title lowers everything first and then capitalises the first letter of each word, where a word starts at the start of a line or after a space. Punctuation in front is skipped, so "alice becomes "Alice, and MARY-ANN O'NEIL becomes Mary-ann O'neil: hyphens and apostrophes inside a word do not start a new word. For a full case change, such as sentence case or camel case, use the case converter. Letters from alphabets without case, such as Chinese, are not changed. The case is changed before repeats are compared, so with Lower on, Apple and APPLE count as one.

Repeats, sorting and blank lines

Repeated lines are matched exactly, after the earlier steps. Where case is left as typed, Apple and apple are different lines and both stay. The first copy is kept in its place. Sort A to Z ignores case and compares accented letters with their plain forms; lines that compare equal keep their order. With drop blank lines off, a blank line is an ordinary line: the first one sorts to the top and repeats of it are dropped if repeats are on. Windows, old Mac and Unix breaks are each one line break and the result uses plain Unix breaks.

Single steps and limits

If you only need one of these, the single-purpose pages show settings the list cleaner leaves out, such as keeping the last copy or turning a run of blank lines into one. The result shows lines in, lines out and lines removed. The work happens in this tab and nothing is uploaded. Your switches are remembered in this browser; the list is not. Text up to 1,000,000 characters is handled, and longer text shows a message asking you to split it.

Frequently asked questions

In what order are the clean-ups applied?

Trim, letter case, drop blank lines, drop repeated lines, sort. A line with only spaces is trimmed to nothing and then dropped as blank, and a repeat is found after trimming and the case change.

Why did Apple and apple both stay?

Letter case is set to Leave, so they differ. Set it to lower, UPPER or Title and they become the same line, and the second one is dropped.

What does Title do to names like McDonald?

It lowers everything and capitalises the first letter of each space-separated word, so McDonald becomes Mcdonald. Pick Leave to keep such names as typed.

Is the sort case sensitive?

No. Banana and apple sort as apple, Banana. Lines that compare as equal, like Apple and apple, stay in their original order.

Can I keep the last copy of a repeat instead of the first?

Not here. The list cleaner always keeps the first. The remove duplicate lines page has a Keep last choice, and can also ignore case or spaces when matching.