Home › Text Tools › Sort Lines Alphabetically

Sort Lines Alphabetically

Paste a list with one item per line and sort it A to Z, Z to A, naturally, by number or by length, or shuffle it. Duplicates, extra spaces and empty lines can be removed in the same step.

Last updated:

0 lines
0 lines

Advertisement
Advertisement

How to use the Sort Lines Alphabetically

  1. Paste your list into the left box, one item per line.
  2. Pick a sort mode: alphabetical, natural, numeric, length, reverse or shuffle.
  3. Tick the clean-up options you need: ignore case, remove duplicates, trim spaces, remove empty lines.
  4. Press Sort lines. The result also updates as you type.
  5. Copy the sorted list or download it as a text file.

Sort modes compared

The same four lines sorted with each mode show how different the results can be:

InputA → ZNaturalNumericLength
file 10file 1file 1file 1file 1
file 2file 10file 2file 2file 2
file 1file 100file 10file 10file 10
file 100file 2file 100file 100file 100

Alphabetical order compares one character at a time, so “10” and “100” land before “2”. Natural sort and numeric sort read the digits as numbers. Numeric sort looks only at the first number in the line, which makes it ideal for lists such as “42 apples” or prices.

How alphabetical order is decided

  • Language-aware: letters with accents sort next to their base letter, so “Éclair” comes right after “date”, not after “z”.
  • Case: with Ignore case on, “apple” and “Apple” are equal and keep their original order. With it off, the uppercase form comes first.
  • Spaces and punctuation: leading spaces would push a line to the top, which is why Trim spaces is on by default.
  • Ties in length or numeric sort are broken alphabetically, so the result is always predictable.

Tips for cleaning up lists

  • Combine Remove duplicates with Ignore case to merge entries such as “Paris” and “paris”. The first occurrence is kept.
  • Use Reverse current order to flip a list without sorting it, for example to turn a chronological log newest-first.
  • Use Random shuffle to pick a fair order for presentations, raffles or team line-ups.
  • Press Use as input to chain operations, such as removing duplicates first and then sorting by length.

Frequently asked questions

How do I alphabetize a list?

Paste the list with one item per line, choose Alphabetical A → Z and press Sort lines. The sorted list appears on the right and can be copied or downloaded.

What is natural sort?

Natural sort reads numbers inside text as whole numbers, so "item 2" comes before "item 10". A plain alphabetical sort compares character by character and would put "item 10" first because 1 comes before 2.

How does numeric sort work?

Numeric sort uses the first number found in each line, including decimals, negatives and numbers with thousands commas. Lines without any number are kept in their original order at the end.

Does ignore case change my text?

No. Ignore case only affects comparison, so Apple and apple are treated as equal when sorting and removing duplicates. The lines keep their original capitalisation. With ignore case off, an uppercase line sorts just before the same word in lowercase and both are kept as different lines.

Is the shuffle really random?

Yes. Shuffle uses the Fisher-Yates algorithm with your browser's cryptographic random number generator, so every order is equally likely. Press Sort lines again for a new order.

Is my list uploaded?

No. Sorting happens entirely in your browser and nothing is sent to a server.

Are all the tools on FreeToolCabin tested for quality and accuracy?

Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

Related tools

Remove Line BreaksStrip line breaks and extra spaces, keep paragraphs if you want.Case ConverterConvert text to UPPERCASE, lowercase, Title Case, camelCase and more.Text CompareFind the differences between two texts.Word CounterCount words and characters and clean up text.Add Line NumbersNumber every line of your text with custom start, step, padding and separator, or remove numbers.Add Prefix and Suffix to LinesAdd text to the start and end of every line: quotes, commas, bullets or SQL lists.Bibliography GeneratorBuild an alphabetized bibliography in APA 7, MLA 9, Chicago or Harvard style.Comma SeparatorTurn a column of lines into a comma separated list and back, with any delimiter.Online Word ProcessorFree browser word processor with headings, lists, tables and images. Autosaves; export DOCX or PDF.MLA Format GeneratorBuild an MLA 9 heading, title page layout and Works Cited entries.Lorem Ipsum GeneratorGenerate placeholder text as paragraphs, words or lists, with HTML.Text RepeaterRepeat any text or emoji up to 100,000 times with custom separators.Find and Replace TextFind and replace words or regex patterns in any text, with match highlighting and undo.Text to Handwriting ConverterTurn typed text into realistic handwriting on notebook paper and save it as PNG or PDF.Japanese Kana ConverterConvert romaji to hiragana or katakana, kana to romaji, and hiragana to katakana instantly.Pinyin Tone ConverterTurn pinyin tone numbers (ni3 hao3) into tone marks (nǐ hǎo), or tone marks back into numbers.Remove Duplicate LinesDelete duplicate lines from any list, ignoring case or spaces, keep first or last, and sort.Remove Extra SpacesClean up double spaces, tabs, blank lines, non-breaking and invisible spaces in one click.Random Word GeneratorGenerate random English words by type, length, first letter and syllables, then copy them.List RandomizerShuffle a list into random order, pick random items or split it into fair teams.Email ExtractorPull every unique email address out of text or files, sort, filter by domain and export CSV.URL ExtractorExtract every link from text or HTML, remove duplicates, filter by domain or protocol.Strip HTML TagsRemove HTML tags and get clean plain text with line breaks and decoded entities.Online NotepadPrivate notepad that autosaves notes in your browser, with find, word count and .txt download.Remove PunctuationStrip all or only selected punctuation from text, with smart options for apostrophes and numbers.Text SplitterSplit long text into chunks by characters, words, lines or a delimiter, with numbering and copy.Remove AccentsStrip accents and diacritics from text (é→e, ñ→n, ß→ss, ø→o) instantly, live as you type.Sort NumbersPull numbers out of any text and sort them ascending or descending, with sum, average and median.Thread SplitterSplit long text into numbered X, Threads, Bluesky or Mastodon posts at sentence boundaries.Duplicate Word FinderFind repeated words in your text: doubled words like "the the" and overused words, highlighted.Alternating Caps GeneratorTurn text into aLtErNaTiNg caps, random caps or alternating words, then copy it.Random Paragraph GeneratorGenerate readable random English paragraphs by topic and length for writing and design.Random Sentence GeneratorGenerate random grammatical sentences: simple, compound, complex and questions.Markdown to Plain TextStrip Markdown syntax and keep clean plain text with lists, line breaks and link URLs.SRT to TextTurn SRT or VTT subtitles into a clean transcript with paragraphs, with or without timestamps.Transcript CleanerRemove timestamps, speaker labels and filler words like um and uh, and fix broken line breaks.Extract Numbers from TextPull every number out of text: decimals, negatives and percentages, with sum, average and CSV.Extract Phone NumbersFind phone numbers in any text, normalize them to E.164, remove duplicates and export CSV.Remove Text FormattingPaste rich text from Word, Google Docs or the web and get clean plain text instantly.Smart Quotes ConverterConvert curly quotes, dashes and ellipses to straight ASCII, or straight quotes to typographic ones.Text to HTML ConverterTurn plain text into clean HTML: paragraphs, line breaks, links, lists and escaped entities.Text to Word ConverterTurn text or a .txt file into a Word .docx with your font, margins and page size.WhatsApp Text FormatterFormat WhatsApp messages with bold, italic, strikethrough, monospace, lists and quotes, then copy.Word CombinerBlend two or more words into portmanteaus, compound and clipped names for brands and wordplay.Word to HTML ConverterConvert Word .docx files or pasted rich text into clean, semantic HTML with live preview.Word Wrap ToolWrap text at any column width with hard line breaks, indents and prefixes, or unwrap it again.Daily Affirmation GeneratorGet random positive affirmations by theme; save favorites, copy them or make an image card.Business Plan GeneratorFill in a guided form and get a formatted business plan with financial tables, as Word or PDF.Keyword Match Type ConverterTurn a keyword list into broad, "phrase", [exact] and negative match types for PPC ads.Discord Text FormatterFormat Discord messages with bold, spoilers, headers, quotes, lists and code blocks, with live preview.DNA Reverse ComplementGet the reverse, complement or reverse complement of DNA/RNA, FASTA and IUPAC codes supported.Filter Lines Containing TextKeep or remove lines that contain words or match a pattern, with match counts and regex.Focus Reading ConverterBold the first letters of every word for faster, focused reading. Copy as rich text or HTML.Memo GeneratorWrite a business memo in standard To/From/Date/Subject format, then print, copy or save as .docx.PDF Text CleanerFix text copied from a PDF: join broken lines, undo hyphen splits, drop page numbers and headers.Pros and Cons List MakerWeigh a decision with a weighted pros and cons list, a score, a verdict and easy export.Remove Numbers from TextStrip all numbers and digits from text, keep MP3-style words or ordinals, and tidy the spaces.Return Policy GeneratorCreate a return and refund policy for your store as text or HTML, with a refund example.Screenplay FormatterType a script in plain text (Fountain) and get a properly formatted screenplay, page count and PDF.Word ChangerSwap words for synonyms in your text, then click any word to cycle through alternatives.Words That End WithFind English words ending in any letters or suffix, filtered by length and sorted by score.Annotated Bibliography GeneratorBuild an APA or MLA annotated bibliography with hanging indents and download it as DOCX.EPUB to Text ConverterExtract plain text from EPUB e-books, pick chapters, count words and download a TXT file.Extract Dates from TextFind every date in text, in any common format, and convert them all to one format you choose.Extract Text Between DelimitersPull out every piece of text between brackets, quotes, HTML tags or your own start and end markers.Recipe Shopping List GeneratorPaste several recipes and get one combined grocery list with merged amounts, by store section.One Word Per LineSplit any text into a list with one word per line; strip punctuation, dedupe, lowercase and sort.Recipe FormatterPaste a messy recipe and get clean ingredients, numbered steps, scaling and a printable card.
See all 96 Text Cleaning & Formatting →