How-to guide
How to Sort Lines Alphabetically Online (Free, No Signup)
To sort lines online, paste your list into the Sort Lines tool on hellagape.com and copy the result: the tool can "sort lines alphabetically, numerically, by length or in reverse order," updates instantly as you type, and runs entirely in your browser with no signup and nothing sent anywhere. This guide walks through the steps, hand-checked worked examples in all three sort modes, the Excel/Sheets and command-line equivalents, and the mistakes that make lists sort "wrong."
How to sort lines (step by step)
- Open the Sort Lines tool. No account or install is needed.
- Paste your text into the Your text box, one item per line (names, keywords, filenames, SKUs — anything one-per-line). New to the tool? Click Load sample first to see it work on example data.
- Choose a Sort order: Alphabetical (A–Z, the default), Numeric (by number), or Line length (shortest to longest).
- Tick Descending (Z–A) if you want reverse order. Leave it unticked for ascending order.
- Read the RESULT panel. It updates instantly as you type — there is no button to press.
- Click Copy to copy the sorted list, then paste it wherever you need it. Click Clear to start again. Nothing is stored or transmitted; closing the tab clears everything.
That is the whole workflow. The tool has no settings beyond sort order and direction: no case toggle, no trim option, no dedupe switch. Three modes, one direction flip — done instantly.
Worked examples (hand-checked)
Alphabetical (A–Z)
Input (6 lines, deliberately scrambled):
cherry
apple
date
banana
fig
elderberry
Alphabetical ascending compares each line letter by letter — apple, banana, cherry, date, elderberry, fig:
apple
banana
cherry
date
elderberry
fig
Tick Descending (Z–A) and the same six lines reverse exactly: fig, elderberry, date, cherry, banana, apple. No lines are added or removed — sorting only reorders. If your output has a different line count than your input, something else changed (see common mistakes).
Numeric
Numeric mode orders by number value, which fixes the classic alphabetical trap where "10" sorts before "2" (because "1" < "2" as text). Input:
10 apples
2 pears
30 plums
1 melon
Numeric ascending reads the leading number on each line — 1, 2, 10, 30:
1 melon
2 pears
10 apples
30 plums
Alphabetical mode on the same input would give 1 melon, 10 apples, 2 pears, 30 plums — correct as text, wrong as quantities. Rule of thumb: if the lines start with numbers and you care about amount, use Numeric; if you care about dictionary order, use Alphabetical.
Line length (shortest to longest)
Input:
watermelon
fig
banana
kiwi
Counting characters (letters only here): fig = 3, kiwi = 4, banana = 6, watermelon = 10. Line-length ascending:
fig
kiwi
banana
watermelon
Length sorting is handy for spotting outliers — the shortest and longest entries in a keyword list, for example — and for tidying lists where uniform length matters (codes, tags, labels). Tick Descending for longest-first.
What the tool does not do
Because there are no extra toggles, be aware of the boundaries:
- No natural sort. Filenames like
file2andfile10sort as text in Alphabetical mode (file10beforefile2). Rename with zero-padding (file02,file10) first if filename order matters. - No dedupe or trim. Duplicate lines stay duplicated, and lines with stray leading/trailing spaces sort by those spaces. Clean first with Remove Duplicate Lines or Remove Extra Spaces, then sort.
- No shuffle. Sorting is deterministic; for random order use the List Shuffler instead.
Order matters: normalise first (case, spaces, duplicates), sort second.
Sorting lines in Excel, Google Sheets, and the command line
- Excel: select the column, then Data → Sort A to Z (or Z to A). In Microsoft 365,
=SORT(A2:A100)returns a sorted copy without touching the original. - Google Sheets: Data → Sort range, or
=SORT(A2:A). - Linux/macOS/WSL:
sort list.txt(A–Z),sort -r list.txt(Z–A),sort -n list.txt(numeric). - VS Code: select the lines, open the Command Palette, run Sort Lines Ascending/Descending. Notepad++: Edit → Line Operations → Sort Lines Lexicographically Ascending.
Use the spreadsheet route when the data must stay in the sheet; use the online tool for a one-off paste — especially on a phone, or when the list contains emails or customer data you would rather not upload anywhere. This tool processes everything locally in your browser, so the list never leaves your device.
Tips and common mistakes
- One item per line. Comma-separated values on a single line count as one line. Split them onto separate lines first, then sort.
- "10 before 2" is not a bug. That is alphabetical (text) order. Switch to Numeric mode for quantity order.
- Check the line count. Sorting never adds or removes lines. If counts differ, you pasted differently than you thought — often a trailing blank line.
- Sort whole CSV rows, not columns. Each CSV line sorts as one record. To sort by one column only, extract that column first (or sort inside the spreadsheet).
- Very large lists: the tool runs in your browser's memory with no stated size limit beyond your device. For multi-megabyte logs, the command-line
sortis sturdier.
Related hellagape text tools: Remove Duplicate Lines (dedupe before sorting), Remove Line Breaks (join broken lines first), Case Converter (normalise capitalisation), Word Counter (verify counts before and after).
Frequently asked questions
How do I alphabetise a list of lines?
Paste the list (one item per line) into the tool's text box and leave Sort order on Alphabetical. The A–Z result appears instantly; tick Descending (Z–A) for reverse order, then click Copy.
How do I sort lines by number instead of alphabetically?
Choose Numeric in the Sort order dropdown. Lines are ordered by number value (1, 2, 10, 30) instead of text order (1, 10, 2, 30). Use it whenever lines start with quantities, prices, or counts.
How do I sort lines by length?
Choose Line length in the Sort order dropdown. Lines order shortest to longest; tick Descending for longest first. It is useful for spotting outlier entries in keyword or code lists.
Is my text uploaded to a server?
No. The tool runs entirely in your browser ("Typing updates the result instantly. Nothing is sent anywhere."). Your list is processed in memory on your device and is never uploaded, logged, or stored.
Does the tool remove duplicates or blank lines?
No — the tool has no dedupe or trim toggles. Duplicates stay in the output (adjacent after sorting, which makes them easy to spot). Remove them first with the Remove Duplicate Lines tool if you need a unique list.
How do I sort lines in Excel or Google Sheets?
In Excel, select the column and use Data → Sort A to Z, or =SORT(A2:A100) in Microsoft 365. In Google Sheets, use Data → Sort range or =SORT(A2:A). Use the online tool when the list lives outside a spreadsheet or must not be uploaded.
Why does "file10" sort before "file2"?
Because Alphabetical mode compares text character by character: "file1…" comes before "file2…". The tool has no natural-sort mode. Zero-pad numbers (file02, file10) before sorting if filename sequence matters.
Is Sort Lines free to use?
Yes. The tool is free with no signup, no install, and no stated line limit beyond your device's memory. It works in any modern browser, including on phones.
Try it now
Sort Lines
Sort lines alphabetically, numerically, by length or in reverse order.
Keep reading