Remove Duplicate Lines

Keep one copy of every line, in the original order.

Also called: remove duplicates, unique lines.

FreeNo sign-upRuns in your browser
TEXT & WRITING

Remove Duplicate Lines

Keep one copy of every line, in the original order.

Runs locally in your browser
Ready. Fill in the fields above, then press Run tool.
Privacy note: this tool runs in your browser, so the text you enter stays on your device.

Find a tool

Loading tools…

Watch: how to use the Remove Duplicate Lines (12 seconds)

Recorded on a phone, steps written on screen, no sound.

About the Remove Duplicate Lines

Remove duplicate lines and keep one copy of each, in the original order, optionally ignoring upper/lower case.

Duplicate line example

The list Lahore, Karachi, lahore, Islamabad, Karachi (one per line) becomes Lahore, Karachi, lahore, Islamabad: the second Karachi is removed, and lahore stays because its case is different.

With Ignore upper/lower case ticked, lahore also counts as a duplicate, leaving Lahore, Karachi, Islamabad. The first copy of each line is kept, in its original order.

How to use the Remove Duplicate Lines

  1. Enter your textType or paste your text.
  2. Pick the optionsignore upper/lower case (the defaults suit most uses).
  3. Press Run toolThe result appears right under the button.
  4. Copy or download the resultCopy text results with Copy output; when the tool makes a picture or file, use its Download button.

This tool works inside your browser: what you enter stays on your device.

Example

A sample input and the result the Remove Duplicate Lines gives for it (produced by the tool itself, not typed by hand).

Input text
Lahore Karachi Lahore Islamabad Karachi

Result:

Lahore
Karachi
Islamabad

Good to know

What you need
You type or choose: Input text
Where it runs
In your browser, on your device.
Cost
Free, no sign-up.

Questions

Does it sort the lines?

No; use Sort Text Lines for that.

Are blank lines removed?

Repeated blank lines count as duplicates.

Can it ignore upper and lower case?

Yes. Tick 'Ignore upper/lower case' and Lahore and lahore count as the same line; the first one is kept.

More tools in Text & Writing

See all Text & Writing tools