Sort & Dedupe Lines — Unique Line Lists

Sort lines alphabetically or numerically, remove duplicates, trim whitespace and drop blank lines. The options are case-sensitive, and everything is browser-local.

Loading…
Sort and dedupe lines
Sorts lines alphabetically, numerically or by length, and removes duplicate and blank lines.

Developer notes

This version accepts pasted text only, with no file selection or drop. The limit is 64 KiB of UTF-8 text. “Show what changed” lists exactly which pasted lines were removed as duplicates or as blank lines. Both panels show up to 2,000 lines, and Copy always returns the full result.

Options

Sort mode
Order of the output lines: none, A → Z, Z → A, numeric or by length. The numeric sort reads the number at the start of each line.
Remove duplicates
Removes repeated lines and keeps the first occurrence.
Case sensitivity
When on, “Apple” and “apple” are different lines. It applies to duplicates and to sorting.
Trim lines
Removes leading and trailing spaces from each line before sorting and comparing.
Remove blank lines
Removes empty lines from the result.

Use cases

Clean up a list of hostnames, email addresses or log entries. Put two lists in the same order before you compare them. Pair it with the other Text & Markdown tools of the hub.

Examples

Sorting and deduplicating a list

Before

zebra Apple banana 10 cherry apple Banana 42 2 zebra [email protected] [email protected] [email protected] delta beta alpha Gamma gamma 100 20 5 nginx apache nginx

After

10 100 2 20 42 5 alpha apache Apple banana beta …

Numeric sort

Before

10 2 apple

After

2 10 apple

Related tools

Part of the text tools hub. See also beautify-markdown.

Sort and dedupe lines FAQ

Privacy and limits

Is my text uploaded?

No. Everything runs locally in your browser.

What is the size limit?

64 KiB of UTF-8 text per input.

Count words, build Markdown TOCs, and clean line lists — all in your browser.