Sort Lines
Sort lines of text alphabetically (A-Z or Z-A), by number, by length, or with natural sort. Ignore case, trim whitespace, remove duplicates, and drop blank lines.
ToolsSoup's Sort Lines tool is a free online sorter that reorders any list or block of text one line at a time. Paste your lines and sort them alphabetically from A to Z or Z to A, by their numeric value, by line length, or with a natural alphanumeric sort that keeps numbers in human order. Optionally ignore case, trim each line, remove duplicates, and drop blank lines as you sort. Everything runs in your browser — no uploads, no sign-up, and your text never leaves your device.
What does sorting lines mean?
Sorting lines means rearranging the rows of a text so they follow a chosen order instead of the order you typed or pasted them in. The most common order is alphabetical, where lines are compared character by character so words and names line up A to Z, but you can also sort the other way for Z to A. Sorting lines is useful for tidying name lists, keyword lists, import files, configuration entries, CSV columns, and any text where you want a predictable order. Because each line is treated as a single item, an alphabetized list is far easier to scan, compare, and deduplicate than a random pile of rows.
How to sort lines online
Putting your lines in order with ToolsSoup takes just a few seconds:
- Type directly into the text box or paste the list you want to sort.
- Pick the order (ascending A to Z or descending Z to A) and how to sort (alphabetical, natural, by numeric value, or by line length).
- Turn on any options you need — ignore case, trim each line, remove duplicates, or remove blank lines.
- Click Sort lines, then click Copy result to grab the ordered list.
Alphabetical, natural, numeric, and length sorting
Alphabetical sorting compares lines character by character, which is perfect for words and names. Natural (alphanumeric) sorting also reads embedded numbers as numbers, so item2 comes before item10 instead of after it — exactly the order a human expects. Numeric value sorting reads the number at the start of each line and orders the lines smallest to largest, with non-numeric lines pushed to the end. Line length sorting arranges lines from shortest to longest. Turn on Ignore case to sort without distinguishing upper and lower case, and combine any sort type with the ascending or descending order to flip the direction.
Sort lines vs. remove duplicate lines
Sorting lines is about order, while removing duplicate lines is about uniqueness. This tool focuses on order first and gives you several sort modes, but it can also remove duplicates and blank lines in the same pass so a single click both cleans and arranges your list. If your only goal is to delete repeated rows without reordering, a dedicated remove-duplicate-lines tool keeps the original order; if you want the result sorted, this Sort Lines tool does both at once.
Why use this sort lines tool?
- Sort any list alphabetically A to Z or Z to A in one click.
- Choose alphabetical, natural alphanumeric, numeric, or line-length sorting.
- Ignore case so capitalization does not affect the order.
- Trim each line, remove duplicates, and drop blank lines while you sort.
- See how many lines went in and how many came out.
- Runs entirely in your browser — your text is never uploaded, and the result copies in one click.
Frequently asked questions
How do I sort lines alphabetically?
Paste your list into the box, leave the order on Ascending and the sort type on Alphabetical, then click Sort lines. The tool reorders every line A to Z and puts the result in the output box ready to copy.
Can I sort lines in reverse order?
Yes. Set the order to Descending (Z to A) before clicking Sort lines and the list is reversed, so it runs from Z to A or, with numeric sorting, from largest to smallest.
What is natural sort and when should I use it?
Natural (alphanumeric) sort reads numbers inside text as numbers, so file2 comes before file10. Use it for filenames, versions, or any list that mixes words and numbers and you want them in the order a person would expect.
Can I sort numbers correctly?
Yes. Choose Numeric value and the tool reads the number at the start of each line and sorts the lines by that value from smallest to largest. Lines without a number are placed at the end.
Can it remove duplicates while sorting?
Yes. Turn on Remove duplicates and the tool keeps one copy of each line before sorting, so the result is both unique and ordered. Combine it with Ignore case to treat lines that differ only in capitalization as the same.
Is my text private?
Absolutely. All sorting happens locally in your browser using JavaScript, so the text you enter is never sent to or stored on any server.