snaptools
Sort & Dedupe Lines error
⌃⏎ run · clear · / focus input
// about this tool

Sort & Dedupe Lines Online

Updated 2026-07-09

Sort lines alphabetically and remove duplicate lines online for free. Paste a list, choose a sort order, and toggle options like de-duplicate, trim whitespace, ignore case, and remove blank lines — the cleaned-up result updates instantly. Everything runs in your browser, so nothing is uploaded.

Cleaning a list by hand is tedious and error-prone. Whether you're tidying exported emails, a keyword list, or config entries, this tool sorts and de-duplicates in one step and tells you how many lines it removed.

// how to use

  1. 1 Paste your list (one item per line) into the input panel.
  2. 2 Pick a sort order and toggle options like remove duplicates, trim, or ignore case.
  3. 3 Copy or download the cleaned-up list from the output panel.

// examples

Sort and dedupe
Input
banana\napple\nbanana\ncherry
Output
apple\nbanana\ncherry
Sort by length
Input
ccc\na\nbb
Output
a\nbb\nccc

// common uses

Cleaning up lists of emails, IDs, or keywords De-duplicating exported data Alphabetising imports, config entries, or word lists Preparing tidy lists for docs and spreadsheets

// faq

Alphabetical A→Z and Z→A, by line length (shortest first), or None to keep the original order while still de-duplicating or cleaning.
Duplicate removal keeps the first occurrence of each line and drops the rest. Enable "Ignore case" to treat lines like "Apple" and "apple" as the same.
Yes — set the sort order to None and keep "Remove duplicates" on. The original order is preserved with later repeats removed.
Trimming each line strips leading and trailing whitespace before comparing and sorting, and removing blank lines drops empty lines from the result.
No — sorting and de-duplication run in your browser, so nothing leaves your machine.

Use this via API

Get a free API key →
curl -X POST https://snaptools.dev/api/v1/tools/sort-lines \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"banana\\napple\\nbanana\\ncherry"}'
Esc
↑↓ navigate open Esc close