S
SoSimple.tools
Text Utilities

Remove Duplicate Lines and Clean Up Any List

Paste a list, choose what to clean and copy the result. Remove duplicate and blank lines, trim spaces, strip bullets, sort the lines and join them with the separator you need

Runs in your browser: what you enter stays on your device

Your List

Cleaning options

Options run in a fixed order, from the top of this list to the bottom. Your text never leaves your browser.

Result
Lines in
0
Lines out
0
Duplicates removed
0
Blank lines removed
0

Paste or type a list to see the result

Share this tool

How to use this tool

  1. Paste your list into the box, one item per line, or press Try an example.
  2. Switch the cleaning options on or off. The result updates as you change them, and the counters show how many lines were removed.
  3. Pick a sort order, a separator and quotes if you need them, then press Copy Result.

Worked example

Pasting the seven lines of the sample below with the default options gives four lines: one blank line and two exact duplicates are removed. Turning on “ignore case” and sorting A to Z leaves three. To paste a column from a spreadsheet into a query, choose the comma separator and single quotes instead.

Methodology

The tool splits your text into lines at every line break (Windows, Mac and Linux line endings all work) and then applies the options you have switched on in a fixed order: trim spaces, collapse repeated spaces, remove bullets and numbers, remove blank lines, remove duplicates, sort or reverse, wrap in quotes and, last, join the lines with the separator you chose. The order matters. A line that holds only a bullet becomes blank before blank lines are removed, and duplicates are found after trimming, so “apple” and “apple ” count as the same item when trimming is on. Everything runs in your browser and nothing is uploaded or stored.

Rules used: A blank line is empty or contains only spaces and tabs. Bullets removed are -, *, •, – and · followed by a space, and numbers of up to four digits followed by . ) ] or : and a space, so “3.5 kg” and “-5” stay untouched. Duplicates are matched exactly; with “ignore case” on, “Apple” and “apple” match, and the first copy keeps its original spelling. Sorting uses your browser’s language rules, so accented letters sort as they do in your language. Numeric sorting reads the number at the start of each line, treats a comma as a decimal point and puts lines without a number last, in their original order. Length sorting counts characters.
Limits: Quotes are added around each item exactly as typed: quotes already inside an item are not escaped, so check the output before pasting it into code or a database. The tool cleans lines, not meaning, so it cannot tell that “NYC” and “New York” are the same thing. A single paste is limited to 1,000,000 characters, and a very large list can take a moment to process on a slow device.

A sample list, before and after

The same seven lines, cleaned twice. Spaces around the third item are trimmed and the blank line is removed in both runs.

Input (7 lines)

Apple
banana

Apple
  Cherry  
banana
apple

Default options (4 lines)

Apple
banana
Cherry
apple

Ignore case + A to Z (3 lines)

Apple
banana
Cherry

With the default options the counters read 7 lines in, 4 out, 2 duplicates and 1 blank line removed. Typical uses are tidying email, keyword or tag lists, and cleaning a column before pasting it into a spreadsheet, a query or a form.

Related tools

Frequently asked questions

How do I remove duplicate lines? ▼

Paste your list, keep “Remove duplicate lines” switched on and copy the result. The first copy of each line is kept and later copies are dropped. Turn on “Ignore uppercase and lowercase” if “Apple” and “apple” should count as the same line, and keep trimming on so extra spaces do not hide duplicates.

Does it change the order of my list? ▼

Not unless you ask. With “Keep original order” the remaining lines stay in the order you pasted them. You can also sort A to Z or Z to A, sort numbers, sort by length or reverse the list.

Can I turn a list into one comma-separated line? ▼

Yes. Choose a separator such as comma, comma and space, semicolon, tab, space or vertical bar, and optionally wrap each item in single or double quotes. It is handy for pasting a column from a spreadsheet into a query, a tag field or an email.

Is my text uploaded anywhere? ▼

No. The cleaning runs in your browser, so the text stays on your device and nothing is saved. If you reload or close the page, the box is empty again.

Why were some similar lines not treated as duplicates? ▼

Lines are compared exactly. A trailing space, a different capital letter, an accent or a different punctuation mark makes two lines different. Turn on trimming and “Ignore uppercase and lowercase” to catch the first two. The tool cannot know that two differently written names mean the same thing.