Text List Tools — Sort, Dedupe & Clean Lines

Sort lines A-Z, Z-A or numerically, remove duplicate and empty lines, reverse the order, trim each line, and add a prefix or suffix to every line.

Loading tool…

Text List Tools — Sort, Dedupe & Clean LinesPaste a list of lines and reshape it in one place: sort A-Z, Z-A or numerically, remove duplicate lines, reverse the order, trim whitespace from each line, drop blank lines, and wrap every line with a prefix and suffix. The result updates live as you change any option, with line counts for the input and output. Everything runs locally in your browser, so your list is never uploaded.

What is Text List Tools — Sort, Dedupe & Clean Lines?

Text List Tools is a free online line-based list editor that cleans and reorders a block of text one line at a time. Developers, data wranglers, and writers use it to sort lists alphabetically or numerically, remove duplicate lines, reverse line order, trim leading and trailing spaces, delete empty lines, and bulk-add a prefix or suffix to every line. It is handy for tidying CSV columns, deduping email or URL lists, sorting imports, building SQL IN-clauses, and turning a plain list into quoted or bulleted items. Because the widget renders only with JavaScript, this text is the indexable description: sort lines, dedupe a list, reverse, trim, remove blank lines, and add a prefix/suffix online.

How to use Text List Tools — Sort, Dedupe & Clean Lines

  1. Paste or type your list into the Input box, one item per line.
  2. Pick a sort mode with the segmented control: none keeps the original order, A-Z and Z-A sort alphabetically, and numeric sorts by the first number found in each line.
  3. Tick any cleanup options you need: remove duplicate lines, reverse the order, trim each line, or remove empty lines.
  4. Type a prefix and/or suffix to wrap around every line — for example a quote and comma to build a code list.
  5. Read the transformed list in the read-only Output box and watch the input and output line counts update.
  6. Use the Copy button next to the Output label to copy the result, or Clear to empty the input.

Examples

Sort A-Z and remove duplicates

Input

banana
apple
banana
cherry

Output

apple
banana
cherry

Quote and comma-wrap every line for a code list

Input

red
green
blue

Output

"red",
"green",
"blue",

Numeric sort by the first number in each line

Input

item 10
item 2
item 1

Output

item 1
item 2
item 10

Frequently asked questions

What do the four sort modes do?
None leaves lines in their original order. A-Z and Z-A sort alphabetically using a locale-aware comparison. Numeric reads the first number found in each line (integer or decimal, including negatives) and sorts by it; lines that contain no number are pushed to the end.
In what order are the operations applied?
The tool processes each line in a fixed pipeline: trim each line, remove empty lines, remove duplicates, sort, reverse, then add the prefix and suffix. So duplicates are detected after trimming, and the prefix/suffix is added last, after sorting and reversing.
How does removing duplicate lines work?
It keeps the first occurrence of each line and drops later identical lines, preserving the order in which lines first appear. If you also enable trim each line, lines are trimmed before duplicates are compared, so lines differing only by surrounding spaces are treated as the same.
What do the line counts show?
The two stat cards show how many non-empty lines are in the input and in the output, so you can immediately see how many duplicates or blank lines were removed.
Is my list uploaded anywhere?
No. Everything runs 100% client-side in your browser. Your text is never uploaded to a server, so you can safely process private lists such as emails, URLs, or internal data.

Related tools