Blog
Image Tools
Crop Image
Resize Image
Rotate & Flip
Compress Image
Photo Filters
Meme Generator
GIF Maker
Collage Maker
Watermark Image
Blur Image
Convert
JPG to PNG
PNG to JPG
HEIC to JPG
DNG to JPG
Image Converter
PDF to JPG
JPG to PDF
Merge PDF
Compress PDF
MP4 to MP3
Video to GIF
MOV to MP4
MP3 Converter
Video & Audio
Trim Video
Crop Video
Remove Audio
Text to Speech
Audio Cutter
MP3 Compressor
Design & Editor
Resume Builder
Design Editor
Add Text to Photo
Social Media Resizer
QR Code Generator
Signature Generator
More Tools
Word Counter
Password Generator
Random Picker
Dice Roller
Spinner Wheel
Favicon Generator
Barcode Generator
Browse All Tools

Sort Lines

Put any list in order in a second: names, words, products, tags or file names. Sort alphabetically, in reverse, by length or by the last word (handy for surnames), with numbers sorted the natural way, or shuffle the list randomly.

100% Free
No Sign-up
Natural Numbers
Shuffle
Private · Nothing Saved Online
Sort Lines
Your Text
Input Characters—
Output Characters—
Lines In → Out—
Input Words—
Type or paste in the input box, or open a file. The result updates as you type.
Your listType, paste or drop a file
Sorted list
Input—
Result—
Status—
Settings forYour text
Order
Sort By
Options
File Name

How to Sort Lines of Text

Quick answer: paste one item per line, choose A → Z, Z → A or Shuffle and what to sort by; the sorted list appears straight away.

  1. 1

    Paste your list

    One item per line.

  2. 2

    Choose the order

    A–Z, Z–A or shuffle.

  3. 3

    Choose what to sort by

    Whole line, length or last word.

  4. 4

    Copy or download

    Use the sorted list anywhere.

What You Get

Many Orders
A–Z, Z–A, length
Last Word
Sort by surname
Natural Numbers
2 before 10
Shuffle
Random order
Private
Nothing is uploaded
Any Device
Phone or computer

Sorting Made Simple

Sorting a list by hand is slow and easy to get wrong, and spreadsheets are overkill for a quick list of names or words. Paste your list with one item on each line and it is sorted instantly. The sorting understands accented letters and different alphabets, so "Émile" sits with the other E names instead of at the end.

Sorting Options Explained

A → Z and Z → A sort alphabetically. Length sorts from the shortest line to the longest, useful for finding short codes or long titles. Last word sorts by the final word on each line, perfect for lists of full names sorted by surname.

Natural number order sorts "Item 2" before "Item 10", the way people expect, instead of the computer order where 10 comes first. Case-sensitive keeps capitals and small letters apart. Shuffle mixes the lines randomly, which is handy for quiz questions, team orders and draws.

Work With Your Lists

Remove repeated entries with Remove Duplicate Lines, number the final list with the Numbered List Maker, or add bullets with the Bulleted List Maker. Press Use as input to carry the sorted list straight into the next step.

Example

You have a list of 40 guests written as "first name last name". Choose A → Z and Last word, and the list is sorted by surname in a second: Adams, Brown, Chen, and so on, ready to print as a seating list.

Who Sorts Lines?

Teachers alphabetising class lists, event organisers sorting guest lists, writers ordering glossaries and indexes, developers sorting imports, dependencies and configuration keys, shop owners organising product lists, and anyone tidying a list of tags, keywords or file names. Shuffling is popular for quizzes, presentations, raffles and choosing the order of speakers or teams fairly.

Tips for Sorting

Remove empty lines and extra spaces first so they do not end up at the top of the sorted list. To sort and remove repeats, run Remove Duplicate Lines after sorting. For names written as "Surname, First name", sort by whole line; for "First name Surname", sort by last word. Each shuffle gives a new random order, so press a setting again to reshuffle.

Good to Know

Alphabetical sorting uses the rules of your browser's language, so accented letters sit next to their plain versions and different alphabets are ordered correctly. Without case-sensitive sorting, capital and small letters are treated as equal; with it, capitals come first when two lines are otherwise the same. Lines that are exactly equal keep their original order relative to each other. Sorting by length counts characters, including spaces, and lines of the same length are then ordered alphabetically, so the result is always predictable.

The tool handles very long lists, including tens of thousands of lines, in well under a second.

Private, Free and Instant

The tool is free and sorts lists with hundreds of thousands of lines. There is no sign-up, no limit and no watermark. The conversion runs entirely inside your browser, so your text is never uploaded, stored or shared, which makes the tool safe for emails, contracts, student work and anything confidential. It works the same on Windows, Mac, Linux, Chromebooks, iPhone and Android, and the result updates instantly as you type or paste. You can also open a text file from your device and download the converted text as a new .txt file.

Sorting Lines of Text: Alphabetical, Numeric and Reverse

Sorting lines puts a list in order so you can find items, spot duplicates and compare lists.

Sort types

  • Alphabetical: A to Z, and Z to A for reverse.
  • Numeric: treats numbers as numbers, so 10 comes after 9 rather than after 1.
  • By length: shortest or longest first.

Tips

Decide whether upper and lower case should be treated the same. Remove blank lines and repeats first with remove duplicate lines.

Frequently Asked Questions

Questions about sorting lines

How do I sort a list alphabetically?

Paste the list with one item per line and choose A → Z.

Can I sort by surname?

Yes. Choose Last word to sort by the final word on each line.

Why does 10 come after 2?

Natural number order is on by default, so numbers inside lines sort the way people expect.

Can I shuffle a list?

Yes. Choose Shuffle for a random order.

Can I convert a whole file?

Yes. Press Open File to load a .txt, .csv, .md or similar text file up to 5 MB, then copy or download the result.

Is my text stored or sent anywhere?

No. Everything happens in your browser on your own device. Your text is never uploaded, saved or seen by anyone.