📝 Line Sorter and Deduplicator

Sort, deduplicate, shuffle, reverse, or trim lines of text. Case-insensitive, natural sort, length sort, and prefix/suffix options.

Last updated: November 8, 2026 · By the BoltQuickTools team

Input
Output

Cleaning up a list one pass at a time

Lists pasted from logs, spreadsheets or email tend to arrive with repeats, stray spaces and blank lines, and file10 sorted ahead of file2. This page applies sorting and cleanup together, so you can get a finished list without a shell or a spreadsheet.

Setting it up

  1. Paste into Input, one item per line, or click Sample.
  2. Choose a mode in Sort: No sort, A to Z, Z to A, Natural A to Z (1, 2, 10), Natural Z to A, Length ascending, Length descending, Shuffle or Reverse order.
  3. Tick any of Case-insensitive sort, Remove duplicates, Dedupe ignoring case, Trim whitespace, Drop empty lines and Lowercase output. Case-insensitive sort and Drop empty lines start ticked.
  4. Optionally fill Prefix each line and Suffix to wrap every line, for example to make a bullet list or quoted values.
  5. The Output updates as you change anything. Use Copy to take it, or Use Output as Input to run a second pass.

The steps always run in the same order: trim, drop empties, lowercase, dedupe, sort, then prefix and suffix.

A full example

Click Sample for this input:

banana
apple
Cherry
banana
file10.txt
file2.txt
file1.txt

  date
elderberry
apple

With the default settings the blank line goes, but the repeats stay, the padded line sorts first because its leading spaces count, and file10.txt comes before file2.txt:

  date
apple
apple
banana
banana
Cherry
elderberry
file1.txt
file10.txt
file2.txt

Change Sort to Natural A to Z (1, 2, 10), tick Trim whitespace and Remove duplicates, and set the prefix to a hyphen and a space:

- apple
- banana
- Cherry
- date
- elderberry
- file1.txt
- file2.txt
- file10.txt

The stats line then reads Input: 11 lines · Output: 8 lines · 82 chars.

Results that may surprise you

To see what changed between two versions of a list, use text diff. For changing capitalisation beyond lowercase, the case converter has more options.

Practical questions

How do I remove duplicates but keep the original order?

Set Sort to No sort and tick Remove duplicates. Each line stays where it first appeared.

If I dedupe ignoring case, which spelling is kept?

The first one in the input. With Foo then foo, the output keeps Foo. Tick Lowercase output if you want a uniform result.

Can I turn a list into a comma-separated SQL list?

Partly. Set Prefix each line to ' and Suffix to ',. Each value then sits on its own line with quotes and a comma, and you remove the final comma yourself.