1. Home
  2. Writing & text tools
  3. Sort Text Lines

Sort Text Lines

Alphabetize a guest list, put version numbers in the right order or rank lines by length. Natural sorting puts “item 2” before “item 10”, which plain alphabetical sorting gets wrong.

Free, no sign-up. Runs in your browser: nothing is uploaded.

How to use Sort Text Lines

  1. Paste one item per line.
  2. Choose how to sort and the direction.
  3. Copy or download the sorted list.

Features

  • Alphabetical, natural, numeric, by length or word count, reverse and random
  • Sort by a column of comma, tab or semicolon separated lines
  • Ignore case and leading “The”, “A”, “An”
  • Remove duplicates and empty lines in the same step
  • Accented letters sorted the way your language expects

Supported formats

You can open

  • Typed or pasted text
  • TXT

You get

  • Copied text
  • TXT

Private by design

Your files are opened and processed by your browser on this device. They are never uploaded to openWorkstand or anyone else, so the Sort Text Lines is safe for contracts, IDs, photos and work documents. After you have used it once while online, it also works without an internet connection. How local processing works

Good to know

  • Sorting follows your browser’s language rules for accented letters; numbers inside words sort naturally only in Natural mode.

Guide

Sorting lines of text: alphabetical, natural, numeric and by column

A list looks sorted only if it is sorted the way the reader expects. Sort “item 1, item 2, item 10” character by character and “item 10” lands before “item 2”. Sort names with capital letters first and “apple” ends up after “Zebra”. This tool lets you pick the rule that matches the content, and shows what happened to empty and duplicate lines on the way.

Natural or alphabetical?

Alphabetical mode compares lines character by character. That is right for words, but it treats digits as characters, so 10 comes before 2 because “1” comes before “2”. Natural mode reads a run of digits as one number, which is what people expect for file names (photo-9.jpg before photo-10.jpg), chapter titles, version numbers and anything else with numbers inside. Both modes use your browser’s language rules, so accented letters such as é and ö are sorted next to their plain letters rather than after z.

Sorting by the number in a line

“By number in the line” looks for the first number in each line and sorts by its value. It understands minus signs, thousands separators and decimals, so “-4”, “3” and “1,200” come out in the right order even when the lines also contain words, like “Room 12 – 4 beds”. Lines without any number keep their original order at the end, and the counter under the result tells you how many there were, so nothing silently disappears.

Length, word count, reverse and random

Sorting by length counts characters as you see them, so an emoji or a flag counts once. It is handy for checking headlines, finding the longest product names or spotting truncated entries. Word count does the same per word. Reverse simply flips the current order, which turns an oldest-first log into newest-first. Random puts the lines in a fair random order; for more shuffling options, such as groups or a random subset, use Shuffle Text Lines.

Sorting by a column

When each line holds several fields, such as “Lee,30” or tab-separated values copied from a spreadsheet, choose a column and its separator. Only that field is compared, but the whole line moves. Lines that have fewer fields sort as if the field were empty, so they gather at the top in ascending order.

Tidying while you sort

Trimming removes spaces at the start and end of each line, which otherwise make “ apple” sort before “apple”. Removing empty lines and duplicates in the same step saves a second pass; duplicates are compared without regard to case when “Ignore upper/lower case” is on. For a detailed duplicate report, Remove Duplicate Lines is the specialised tool. Ignoring “The”, “A” and “An” gives library-style title order, so “The Zoo” files under Z.

Your list stays on your device

Sorting happens in your browser. Customer names, inventory lists and anything else you paste are not uploaded, and the text is kept only in this tab’s storage until you clear it.

Number the sorted list with Add Line Numbers, wrap each line in quotes or tags with Add Prefix and Suffix, or turn the column into a comma-separated list with Column to Comma-Separated List.

Checked against the current version of the Sort Text Lines on .

Troubleshooting

The file does not open

Check that it is one of the supported formats above and opens in another app. Damaged files and password-protected PDFs cannot be read until they are repaired or unlocked.

It is slow or stops on a very large file

Everything runs on your device, so speed depends on its memory. Close other tabs, use a computer rather than a phone, or split the file into smaller parts first.

The download did not start

Look for your browser’s download bar or icon. Some browsers ask once before a site may download files; allow it and click the button again.

Frequently asked questions

How do I sort a list by last name when lines look like “Ann Lee”?

Choose “Sort by: Column 2” and “Columns separated by: Spaces”. Each line is then ordered by its second word. For names with middle names or two-part surnames, split the names into columns first with Split Names in CSV.

Does Z→A keep lines that compare equal in their original order?

Yes. The sort is stable in both directions: lines that are equal for the chosen mode, such as two lines of the same length, keep the order they had in your input.

Can I sort lines by the date at the start of each line?

If the dates are written year first (2026-03-14), alphabetical or natural sorting puts them in date order. Dates like 14/03/2026 do not sort correctly as text; convert them to the year-first form with Find and Replace first.

Why does “item 10” come before “item 2” in other tools?

Plain alphabetical sorting compares character by character, and “1” comes before “2”. Natural sorting reads the whole number, so 2 comes before 10. Choose Natural for file names, versions and numbered items.

Where do lines without a number go when sorting by number?

They keep their original order at the end of the list, and the counter below the result tells you how many there were.

Keep working with the result

After you download, choose “Save to Workstand” to keep the result in a folder on your computer, attach it to a project and create a follow-up task. It is saved by your browser, not uploaded.