Sort Text Lines
Put a list in order: A to Z, Z to A, shortest first, by number, or a random shuffle. Optionally trim lines and drop blanks or duplicates.
Lines & sort options
Limits
- Numeric sort treats lines that do not start with a number as 0, so they group at the start (A–Z of those ties is not applied).
- Natural sort only special-cases decimal digit runs; it does not parse dates, versions with letters (v1 vs v1b) or locale-specific numerals.
- Shuffle is not a secure mixer for cryptography or lotteries that need an audited draw.
- Very large pastes (over about 500,000 characters) are refused so the tab does not freeze. Split the work into smaller pieces if you hit that limit.
Sorted lines
How to use Sort Lines
- Paste a listPaste one item per line, or load a local .txt file.
- Choose a sortPick A–Z, Z–A, length, numeric, natural order, reverse or shuffle. Tick case-insensitive, trim, drop blanks or unique if you need them.
- Copy or downloadCopy the result or download it as a .txt file.
Alphabetical, numeric and natural sorts
A–Z and Z–A use your browser’s Unicode collation, so accented letters sort in a locale-aware way. Numeric sort reads a number at the start of each line (so “10.5 apples” counts as 10.5). Natural sort compares digit runs as numbers inside the text, so “item2” comes before “item10”.
Shuffle uses the browser’s cryptographically strong random values when they are available. Re-shuffling gives a new order each time. Unique keeps the first occurrence of a line (after trim and case options are applied).
Frequently asked questions
What is the difference between numeric and natural sort?
Numeric sort looks at a number at the beginning of the line. Natural sort finds every run of digits anywhere in the line, so “ch2-s10” comes after “ch2-s3”.
Is my text sent anywhere?
No. Everything runs in your browser tab with JavaScript. Nothing you type or paste is uploaded, logged or stored on our servers.
How does Unique decide which line to keep?
The first line that matches, after trimming and the case-insensitive option, is kept. Later duplicates are dropped.
Can I sort CSV columns?
No. Each line is sorted as a whole. Split the file into one column per line first, or use a spreadsheet.
Related tools
All toolsText Cleaner
Trim, collapse spaces, strip punctuation or emoji, and tidy messy pasted text.
Word Frequency Counter
Count how often each word appears, with percentages and a CSV download.
Case Converter
UPPERCASE, lowercase, Title Case, Sentence case, camelCase, snake_case and more.
Find and Replace
Find and replace text or regular expressions, with a match count and preview.