Sort Text Lines
Paste a list below and sort it alphabetically, by line length or by number. Sorting is stable and happens instantly in your browser.
- Free, no sign-up
- Runs in your browser
Drop your file here, or
TXT, CSV, JSON, Markdown, HTML, XML, DOCX, PDF, RTF and more
Options
Runs in your browser
Result
Your sorted text will appear here.
Add your text, then press Sort lines.
How to use Sort Lines
- Paste your list, one item per line.
- Choose the order: A → Z, Z → A, shortest or longest first, or numerically.
- Fine-tune: case-sensitive sorting, ignoring surrounding spaces, natural number order, and removing duplicates or empty lines.
- Copy or download the sorted list.
Example
item10 Banana item2 apple Cherry
apple Banana Cherry item2 item10
Case-insensitive A → Z with natural number order, so item2 comes before item10.
Good for
- Alphabetizing names, glossaries and bibliographies
- Ordering file names and versions naturally
- Sorting numbers or prices pasted from a spreadsheet
- Finding the shortest or longest entries in a list
Natural order and numbers
With natural order on, numbers inside text are compared by value, so “file2” sorts before “file10”. Numeric sorting uses the first number in each line — including negatives, decimals and thousands separators — and lines without a number go last.
What happens to your text
Your text is processed in your browser and kept only in this tab’s memory. It is not uploaded, saved or used for analytics.
Related guides
How-to
How to Remove Duplicate Lines
Remove duplicate lines from a list or text file in seconds — online with TextVix, in Excel, in Google Sheets, or on the command line.
How-to
How to Sort a List Alphabetically
Sort any list in alphabetical order online, in Word, Excel, Google Sheets or on the command line — including natural number order and Z–A.
Questions about Sort Lines
More answers in the TextVix FAQ.
Where do empty lines go?
Empty lines are moved to the end so they don’t clutter the top of your list. You can also remove them.
Does case matter when sorting?
By default, no — “apple” and “Apple” sort together. Turn on case-sensitive sorting to put uppercase before lowercase.
Can I shuffle or reverse lines?
Yes. Use the Reverse Lines or Shuffle Lines tools in the Sort category.
Is my text uploaded anywhere?
No. This tool runs entirely in your browser. Your text and files are never sent to a server or stored.

