Practical guidesLists & tables

Remove duplicate lines without sorting.

Remove repeated lines from a pasted list while keeping the first occurrence of each line and the original order. Understand how trimming and letter case affect a match.

Open the text cleanup

Paste the list and keep the original order

Open Text cleanup and paste the list into Your text, one value per line. Under Sort lines, choose Keep original order. Tick Remove duplicates. With those settings, the first time a line appears is kept, and later copies are dropped; nothing is reordered.

Remove duplicates and Remove blank lines are on by default, and so is Trim whitespace. Change only the options you need before you copy the result.

Example input

SKU-001
SKU-002
SKU-001
SKU-003
SKU-002
 sku-001 

Decide whether surrounding spaces should count

When Trim whitespace is on, spaces at the beginning and end of a line are removed before duplicates are compared, so a line with accidental padding matches the trimmed value. In the sample, the final sku-001 still differs from SKU-001 because matching is case-sensitive.

Turn Trim whitespace off if leading or trailing spaces are part of the value. Whitespace in the middle of a line is never ignored.

Example result

SKU-001
SKU-002
SKU-003
sku-001

Letter case is significant

Apple and apple are different lines. There is no option to ignore letter case in this tool. If you need to treat them as the same value, normalise the case in a spreadsheet first, or compare two already-prepared lists with Compare two lists, which can ignore letter case.

Example result

Apple
apple

Blank lines and further cleanup

Remove blank lines drops empty lines and lines that contain only spaces. You can also add a prefix or suffix to every remaining line. Apply to input replaces the original text with the current result so you can run another step, for example a sort; Undo reverses those applied steps.

This tool works on one list. To see which values are missing from a second list, use Compare two lists and the missing-items guide. Your text is processed in your browser.

Open the text cleanup