LazyTools – Header

Sort Text Online

Sort any list alphabetically, naturally, numerically, by length, by last word, or randomly — with live preview, duplicate removal, custom delimiters, undo, and download. Free, client-side, no sign-up.

Client-Side ✓ Free Forever No Sign-Up
12K+monthly searches
6sort modes

Sort Text Lines

Runs in your browser — nothing sent to a server
Sort options
Clean-up options
Sort by:
0 Items (input)
0 Items (output)
0 Duplicates found
0 Total words
Input list 0 lines
Sorted output 0 lines
4.7/5
876 ratings

Rate this tool

How useful was the Sort Text tool?

Sort your list in 4 steps

Pick a mode, set options, paste your list, and copy or download the sorted result.

1

Choose a sort mode

Select from 10 modes: A→Z, Z→A, Natural (numbers treated correctly), Numeric, Shortest/Longest first, By Last Word, Reverse, or Shuffle.

2

Set your delimiter

Choose whether to sort line-by-line, or by comma, semicolon, tab, space, or any custom separator — perfect for CSV data or space-separated tags.

3

Paste your list

Paste any list. Enable Live preview to see the sorted result update instantly as you type. Toggle duplicate removal and empty line removal as needed.

4

Copy or download

Click Copy to clipboard for instant use, Download .txt for a file, or Undo to revert to the previous state.

Advertisement
728 × 90 — Leaderboard Ad

Frequently asked questions

Everything you need to know about sorting text online.

Alphabetical sort compares characters one by one using their Unicode values. "Item 10" sorts before "Item 2" because the character "1" comes before "2". Natural sort treats consecutive digits as a single number — so "Item 2" correctly sorts before "Item 10". Use Natural sort for numbered lists, file names, versions (v1.2, v1.10), or any list where numbers appear within text.
By Last Word sorts each line based on its final word only, ignoring everything before it. This is ideal for sorting full names (like "John Smith", "Emma Wilson") by surname without reformatting them into "Last, First" format first. It also works well for sorted file paths where you want to sort by filename, or numbered items where you want to sort by the last meaningful word.
Numeric sort extracts the numeric value of each line and sorts purely by that number. Lines like "100", "9", "42" will sort as 9 → 42 → 100 (not 100 → 42 → 9 as in alphabetical). Non-numeric lines default to 0. This mode is best for lists of pure numbers — prices, scores, quantities, rankings — where you want true numeric ordering rather than string-based ordering.
Yes — use the Comma-separated delimiter option in the "Sort by" row. This treats each comma-delimited item as a separate entry, sorts them, then rejoins them with commas. Similarly, you can sort semicolon-separated, tab-separated, or space-separated values, or enter any custom delimiter. This is useful for sorting CSS class names, tag lists, spreadsheet cells, or keyword lists.
With Remove duplicate lines enabled, the tool keeps only the first occurrence of each unique line and removes all subsequent copies. When combined with case-insensitive mode, lines that differ only in capitalisation (e.g. "Apple" and "apple") are treated as duplicates. Deduplication is applied after trimming but before sorting, so the resulting list will be both deduplicated and sorted.
Yes. By default, Case-insensitive sort is enabled — uppercase and lowercase letters are treated as identical, so "Apple", "apple", and "APPLE" all sort to the same position. Uncheck the option for case-sensitive sorting where uppercase letters (A–Z) sort before their lowercase equivalents (a–z), following standard ASCII/Unicode ordering.
No. The entire tool runs locally in your browser using JavaScript. Your text never leaves your device and is never transmitted to LazyTools or any third party. This means you can safely sort sensitive data like customer names, internal keyword lists, or confidential documents.

LazyTools vs other text sorters

How we compare on features that matter for real sorting tasks.

Feature LazyTools ✦ texttools.org onlinetexttools.com miniwebtool.com toolslick.com
Alphabetical A→Z / Z→A
Natural sort (numbers in text)
Sort by character length
Numeric sort (by pure number value)
Sort by last word (e.g. surnames)
Shuffle / randomise
Custom delimiter (CSV, pipe, tab…)
Remove duplicate lines
Remove empty lines
Number output lines
Live preview (auto-sorts as you type)
Undo / revert
Live stats (items, duplicates, words)
Side-by-side input / output
Download output as .txt
100% client-side (private)