Text Sort, Text Deduplicate

Text Sort, Text Deduplicate tool helps you process text content for sorting and deduplication.

All tools on this site run entirely in your browser locally. No data is uploaded to any server.

Sort Features:

  • English Sort: Sort alphabetically, ascending or descending
  • Number Sort: Sort by number, ascending or descending
  • Length Sort: Sort by character length, short to long or long to short

Dedup Features:

  • Highlight Duplicate: Use different background colors to mark different duplicate lines
  • Remove Duplicate: Delete duplicate lines, keep only unique content

FAQ:

  • Q: Why are numbers always listed before the other lines?
    A: With the default character-type grouping, lines are split into two groups: pure numbers (including negative values and decimals) and everything else. Numbers are always written first, ordered by value; the remaining lines follow in alphabetical order. Click Length to sort every line by its character count instead.
  • Q: Will "10" be sorted before "2"?
    A: No. Numeric lines are compared as numbers, so 2 comes before 10; negatives and decimals work too. Everything else uses JavaScript's default string order, which is case-sensitive and puts uppercase letters before lowercase ones.
  • Q: How do I switch between sorting modes?
    A: All sort buttons stay visible. Click English or Number to group lines by character type, or Length to sort every line by character count. Each click flips that group's direction and re-sorts immediately; the Sort button repeats whichever mode you used last.
  • Q: Which duplicate line is kept, and is it case-sensitive?
    A: Lines are trimmed before comparison and must match exactly, so "Apple" and "apple" are different. Remove Duplicate keeps the first occurrence, deletes later ones, and reports how many lines were removed and their original line numbers. The deduplicated text replaces what's in the editor.
  • Q: What do the duplicate colors mean, and can I click the line numbers?
    A: Each repeated value gets its own background color so different groups are easy to tell apart. Below the editor you'll see how many duplicate values there are and their line numbers, for example (2, 10) and (5, 14, 25). Click a line number to jump to that line; the same row also lists the lines that would be removed if you deduplicated.
  • Q: Do blank lines and surrounding spaces affect the result?
    A: Yes. English and Number sorting and duplicate handling trim every line, skip whitespace-only lines, and drop blank lines at the start and end, so lines differing only in surrounding spaces count as duplicates. Clicking Length is the exception: it uses each line's raw character count, so those spaces are included.