inyourbrowser.com

Sort lines alphabetically

Paste any list of lines and sort them alphabetically in one click. Choose A–Z or Z–A, optionally remove duplicates, trim whitespace, and remove empty lines. The sorted output appears instantly. All processing runs locally in your browser.

Input

Sorted output

SORT OPTIONS

How it works

The input is split on newlines to produce an array of lines. Trim whitespace applies String.trim() to each line. Remove duplicates uses a Set keyed on the lowercased line to preserve the first occurrence. Sort modes use Array.sort() with localeCompare() for alphabetical ordering or a length comparison for length-based modes. Shuffle uses the Fisher-Yates algorithm with Math.random(). The result array is joined back with newlines. All processing runs in JavaScript in your browser.

Processing runs in your browser

All processing happens locally in your browser tab. Our servers are not involved at any point.

Related operations

For swapping recurring substrings across the list, try find and replace. To compare two sorted lists side by side, use text diff. For checking item counts after deduplication, see the word counter.

Frequently asked questions

How does alphabetical sorting work?
Lines are sorted using the default locale comparison (case-insensitive by default). Numbers sort before letters, and special characters sort before numbers in most locales. The sort is stable: lines with equal values keep their original relative order.
Does it sort case-sensitively?
The default A–Z sort is case-insensitive, so 'Apple' and 'apple' are treated as equal. The Z–A sort is also case-insensitive. For strict case-sensitive sorting, toggle the case-sensitive option in the side panel.
Can I sort a list with numbers?
Yes. Numeric strings sort lexicographically by default (so '10' comes before '9'). For natural number sorting where '9' comes before '10', use the length sort modes which handle numeric strings more intuitively.
Is my data sent to a server?
All text processing runs locally in your browser. No data is sent to our servers.

Related tools

Find & replace
Find and replace text with plain search or regular expressions. Supports case-sensitive and whole-word matching.
Text diff
Inline or side-by-side comparison. Handles plain text and structured diffs.
Word counter
Count words, characters, sentences, and paragraphs. All processing runs in your browser.
Case converter
Convert text between camelCase, snake_case, kebab-case, PascalCase and more.