Quick Answer
Paste your list with one item per line and choose a sort: A → Z, Z → A, Numbers, Length, Reverse order or Shuffle. Natural order is on by default, so “item 2” comes before “item 10”. The sorted list appears instantly — copy it or download it. Options let you trim spaces, remove empty lines and duplicates, and make sorting case-sensitive.
What is a Sort Lines Tool?
A Sort Lines tool (लाइनें क्रम में लगाएँ) puts the lines of a list into order — alphabetically, by number, by length, in reverse or at random. Sorting is one of the most common text chores: alphabetising names for a register, ordering product codes, arranging keywords, preparing a glossary, sorting prices, organising a bibliography, or randomising quiz questions and team assignments. Spreadsheets can sort, but opening one just to order a pasted list is slow, and simple sorters often get numbers wrong.
This free tool sorts instantly as you paste and uses natural order by default, so “Item 2” comes before “Item 10” — the way people expect. Alphabetical sorting is language-aware, so accented letters and Hindi words are ordered correctly. Numeric sorting finds the number inside each line, even when it is surrounded by text or a currency symbol. And the shuffle uses a proven unbiased algorithm with strong randomness, so every order is equally likely.
Key Features
- Six ways to order — A → Z, Z → A, Numbers, Length, Reverse order and Shuffle.
- Natural number order inside text.
- Locale-aware alphabetical sorting for English, Hindi and other languages.
- Smart numeric sorting — finds decimals and negatives, ignores thousands commas.
- Length sorting that counts visible characters.
- Fair shuffle using Fisher–Yates and cryptographic randomness.
- Clean-up options — trim spaces, remove empty lines and duplicates.
- Copy or download the result; nothing is uploaded.
How to Sort Lines — Step by Step
- Paste your list, one item per line.
- Choose the sort with the buttons.
- Adjust options — natural order, case-sensitivity, descending, trimming, blanks and duplicates.
- Read the sorted list in the Result box.
- Copy it or download it as a text file. For Shuffle, press “Shuffle again” for a new order.
Alphabetical Sorting Done Right
Computers store letters as numbers, and naive sorting by those numbers puts all capital letters before small letters (so “Zebra” comes before “apple”) and digits in character order (so “10” comes before “2”). This tool uses the browser's Intl.Collator, the same language-aware comparison used by operating systems, which:
- treats capital and small letters as equal unless you choose Case-sensitive;
- places accented letters next to their base letters (é next to e);
- sorts Devanagari words in proper Hindi order;
- with natural order on, compares numbers inside text by value.
| Simple character sort | This tool (natural, case-insensitive) |
|---|---|
| Item 1, Item 10, Item 2, apple, banana | apple, banana, Item 1, Item 2, Item 10 |
| Zebra, apple, Mango | apple, Mango, Zebra |
Sorting by Numbers
Numbers mode looks for the first number in each line and sorts by its value. It understands decimals (7.5), negative numbers (−3) and numbers with thousands separators (1,25,000 or 125,000), and it ignores surrounding text and symbols, so “₹250”, “Order 42” and “7.5 kg” all sort correctly. Lines that contain no number are kept and placed at the end in alphabetical order, and the tool tells you how many there were. Tick Descending to see the largest values first — handy for prices, scores and quantities.
Sorting by Length
Length sorting orders lines from shortest to longest (or longest first with Descending). Lines of the same length are then ordered alphabetically so the result is stable and predictable. Length is measured in visible characters, so an emoji or a Hindi conjunct counts as one. This is useful for finding very long titles that need shortening, grouping short keywords, or building word lists for puzzles.
Fair Random Shuffling
Many quick shuffles on the web are subtly biased — some orders come up more often than others. This tool uses the Fisher–Yates shuffle, which is mathematically unbiased when the random numbers are fair, and draws those numbers from crypto.getRandomValues, your browser's cryptographically secure generator, with rejection sampling to avoid rounding bias. Use it to randomise quiz questions, decide presentation order, assign tasks or seats, or pick names for an informal draw. Press “Shuffle again” for a fresh order.
Worked Example
The sample list contains: item 10, Item 2, banana, apple, item 1, Cherry, ₹250, 42 and 7.5.
- A → Z (natural): ₹250, 7.5, 42, apple, banana, Cherry, item 1, Item 2, item 10.
- Numbers: item 1, Item 2, 7.5, item 10, 42, ₹250, then apple, banana and Cherry (no numbers) at the end.
- Length: the shortest entries (42, 7.5, ₹250) first, the longest (item 10) last.
In alphabetical mode, symbols such as ₹ come first, then digits, then letters — the standard collation order. Note that 7.5 comes before 42 because natural order compares the number 7 with 42; use Numbers mode when you want values compared as decimals throughout.
Sorting Lists in Hindi and Mixed Languages
Hindi words follow the Devanagari alphabet order — vowels (अ, आ, इ…) first, then consonants from क to ह — and the tool's language-aware collation applies that order automatically. For example, आम, कमल, गाय and नदी sort in that sequence. In a list that mixes English and Hindi, the browser's collation groups the scripts sensibly rather than interleaving them randomly. Because collation depends slightly on your browser's language settings, a few rare characters may sort differently on different devices, but common words are consistent.
Under the Hood
All sorting runs in your browser with standard, well-tested methods: JavaScript's built-in sort with an Intl.Collator comparison for alphabetical modes, a numeric comparison of the parsed values for Numbers mode, and grapheme counting with Intl.Segmenter for Length mode. Ties are broken alphabetically so the result does not change between runs. The shuffle draws 32-bit random numbers from the Web Crypto API and discards values that would cause a tiny modulo bias, then swaps items from the end of the list to the start — the textbook Fisher–Yates method. Even lists with tens of thousands of lines sort in a fraction of a second.
Everyday Uses
- Alphabetising student names, attendance lists and contact lists.
- Ordering keywords, tags and categories.
- Sorting prices, scores or quantities with Numbers mode.
- Preparing glossaries, indexes and reference lists.
- Finding the longest titles or file names with Length mode.
- Randomising quiz questions, raffle names or team members.
- Reversing logs or timelines from oldest-first to newest-first.
Which Sort Should I Use?
- Names, words, titles: A → Z with natural order.
- Prices, marks, quantities: Numbers (tick Descending for highest first).
- Finding long or short entries: Length.
- Newest first from an oldest-first log: Reverse order.
- Fair random order: Shuffle — and copy the result straight away if you need to keep that order.
Combine with Other Tools
Sorting works well with other clean-up steps. Remove repeats with Remove Duplicate Lines, standardise formats with Find & Replace, or change capitalisation with the Case Converter. To see what changed between two sorted lists, use Text Compare — sorting both lists first makes the differences much easier to read.
Common Mistakes to Avoid
- Turning natural order off for numbered items — you will get 1, 10, 11, 2…
- Several items on one line — the tool sorts whole lines; split lists into lines first.
- Using alphabetical sort for prices — use Numbers mode instead.
- Expecting the same shuffle twice — every shuffle is new; copy the result if you need to keep it.
Troubleshooting
- Some lines appear at the end in Numbers mode — they contain no number; the note tells you how many.
- Capital letters are mixed in — that is case-insensitive sorting; tick Case-sensitive to separate them.
- Blank lines disappeared — untick Remove empty lines.
- Leading spaces changed the order — keep Trim spaces ticked.
Quick Glossary
- Collation: language-aware rules for ordering text.
- Natural sort: ordering that treats numbers in text by value.
- Ascending / descending: smallest-to-largest / largest-to-smallest.
- Fisher–Yates shuffle: an unbiased algorithm for random ordering.
- Stable sort: equal items keep a predictable order.
- Tie-breaker: a second rule used when two items are equal under the first, such as alphabetical order for lines of the same length.
- Locale: the language and region settings that decide sorting rules for a particular language.
Why Use This Sort Lines Tool?
It sorts the way people expect — natural numbers, proper language rules, real numeric values — includes a genuinely fair shuffle and handles clean-up in the same step, all free and private in your browser.
Sort Lines — Key Facts
| Sorts | A–Z, Z–A, numbers, length, reverse order, random shuffle |
|---|---|
| Natural order | item 2 before item 10 (on by default) |
| Languages | Locale-aware — English, Hindi and other scripts sort correctly |
| Numbers | Uses the first number in each line; lines without numbers go last |
| Shuffle | Fisher–Yates with cryptographic randomness — every order equally likely |
| Clean-up | Trim spaces, remove empty lines, remove duplicates |
Frequently Asked Questions
How do I sort a list alphabetically?
Paste the list with one item per line and choose A → Z. The sorted list appears instantly in the Result box. Choose Z → A for reverse alphabetical order.
What is natural sort order?
Natural order sorts numbers inside text by their value, the way people expect: “item 2” before “item 10”. Plain character order would put “item 10” first because the character 1 comes before 2. Natural order is on by default.
Does it sort capital letters separately?
Not by default — “apple” and “Apple” sort together. Tick Case-sensitive to put capital letters first when two words are otherwise equal.
How does numeric sorting work?
Numbers mode finds the first number in each line — including decimals and negative numbers, ignoring thousands commas — and sorts by its value. Lines without any number are placed at the end in alphabetical order. Tick Descending for largest first.
Can I sort lines by length?
Yes. Choose Length to put the shortest lines first, or tick Descending for longest first. Lines of equal length are ordered alphabetically. Length counts characters as you see them, so emoji and Hindi conjuncts count once.
How do I shuffle a list randomly?
Choose Shuffle. The tool uses the Fisher–Yates algorithm with your browser's cryptographic random number generator, so every possible order is equally likely. Press Shuffle again for a new order.
Is the shuffle fair enough for a lucky draw?
The algorithm is unbiased and uses strong randomness, which is suitable for informal draws, picking quiz order or assigning tasks. For official or legally regulated draws, follow the required procedure and keep records.
Can I sort Hindi words?
Yes. Alphabetical sorting uses your browser's language-aware collation, so Hindi words sort in Devanagari order, and mixed lists are handled sensibly.
What does Reverse order do?
It simply flips the list so the last line becomes the first — useful for turning oldest-first lists into newest-first.
Can it remove duplicates while sorting?
Yes. Tick Remove duplicates. For more control over duplicates, use our Remove Duplicate Lines tool.
Is my list uploaded?
No. Sorting happens entirely in your browser.
Is Sort Lines free?
Yes. It is free, unlimited and needs no sign-up.
Put Any List in Order!
Alphabetical, numeric, by length or random — free and instant.
Explore More Prompt Minds Tools
Sort Lines works great alongside our other free tools. Every Prompt Minds tool runs entirely in your browser — no sign-up, no uploads, no watermarks. Browse all free tools.
